Skip to content

Commit 22cb2ec

Browse files
committed
setup.py: use the same file reader as in pip
https://github.com/pypa/pip/blob/master/setup.py streamlink 0.14.0 is required
1 parent 60e86b5 commit 22cb2ec

File tree

3 files changed

+33
-31
lines changed

3 files changed

+33
-31
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ before_install:
1919
pip install doctr;
2020
fi
2121
# only Tested with this streamlink version
22-
- pip install -U git+https://github.com/streamlink/streamlink.git@aee0b9e34f2f64b118c0e7f81f7ed1be83ac06da
22+
# - pip install -U git+https://github.com/streamlink/streamlink.git@aee0b9e34f2f64b118c0e7f81f7ed1be83ac06da
2323

2424
install:
2525
- pip install -e .

liveproxy/__init__.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
__all__ = (
4-
'__title__', '__summary__', '__uri__', '__version__', '__author__',
5-
'__email__', '__license__', '__copyright__'
6-
)
7-
8-
__title__ = 'liveproxy'
9-
__summary__ = 'LiveProxy is a local Proxyserver between Streamlink and an URL.'
10-
__uri__ = 'https://github.com/back-to/liveproxy'
11-
12-
__version__ = '0.0.1'
13-
14-
__author__ = 'back-to'
15-
__email__ = 'backto@protonmail.ch'
16-
17-
__license__ = 'BSD 2-Clause "Simplified" License'
18-
__copyright__ = 'Copyright 2018 back-to and individual contributors'
3+
__version__ = '0.0.3'

setup.py

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,62 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import io
4+
import codecs
55
import os
6+
import re
67

78
from setuptools import setup
89

9-
import liveproxy
10-
1110
here = os.path.abspath(os.path.dirname(__file__))
1211

13-
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
14-
long_description = '\n' + f.read()
12+
13+
def read(*parts):
14+
with codecs.open(os.path.join(here, *parts), 'r') as fp:
15+
return fp.read()
16+
17+
18+
def find_version(*file_paths):
19+
version_file = read(*file_paths)
20+
version_match = re.search(
21+
r'''^__version__ = ['"]([^'"]*)['"]''',
22+
version_file,
23+
re.M,
24+
)
25+
if version_match:
26+
return version_match.group(1)
27+
28+
raise RuntimeError('Unable to find version string.')
29+
30+
31+
long_description = read('README.md')
1532

1633
setup(
17-
name=liveproxy.__title__,
18-
version=liveproxy.__version__,
19-
description=liveproxy.__summary__,
34+
name='liveproxy',
35+
version=find_version('liveproxy', '__init__.py'),
36+
description='LiveProxy is a local Proxyserver between Streamlink and an URL.',
2037
long_description=long_description,
2138
long_description_content_type='text/markdown',
22-
license=liveproxy.__license__,
23-
url=liveproxy.__uri__,
39+
license='BSD 2-Clause "Simplified" License',
40+
url='https://github.com/back-to/liveproxy',
2441
project_urls={
2542
'Documentation': 'https://liveproxy.github.io/',
2643
'Source': 'https://github.com/back-to/liveproxy/',
2744
'Tracker': 'https://github.com/back-to/liveproxy/issues',
2845
},
29-
author=liveproxy.__author__,
30-
author_email=liveproxy.__email__,
46+
author='back-to',
47+
author_email='backto@protonmail.ch',
3148
packages=['liveproxy'],
3249
entry_points={
3350
'console_scripts': [
3451
'liveproxy=liveproxy.main:main'
3552
],
3653
},
3754
install_requires=[
38-
'streamlink>=0.13.0, <1',
55+
'streamlink>=0.14.0, <1',
3956
],
4057
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
4158
classifiers=[
42-
'Development Status :: 1 - Planning',
59+
'Development Status :: 4 - Beta',
4360
'Environment :: Console',
4461
'Intended Audience :: End Users/Desktop',
4562
'License :: OSI Approved :: BSD License',

0 commit comments

Comments
 (0)