-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
34 lines (30 loc) · 1.02 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from setuptools import setup, find_packages
version = ''
with open('audiobookshelf/__init__.py') as f:
for line in f.readlines():
if line.startswith('__version__'):
version = line.split('= \'')[-1][:-2].strip()
if version.endswith(('a', 'b', 'rc')):
try:
import subprocess
p = subprocess.Popen(['git', 'rev-list', '--count', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
version += out.decode('utf-8').strip()
p = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
version += '+g' + out.decode('utf-8').strip()
except:
pass
setup(
packages=find_packages(),
version=version,
keywords=['audiobookshelf', 'api'],
install_requires=[
'aiohttp>=3.9.3',
'python-dateutil>=2.8.2',
'aiofiles'
],
package_data={'audiobookshelf': ['py.typed']}
)