-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
44 lines (33 loc) · 1.08 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
35
36
37
38
39
40
41
42
43
44
import ast
import os
import re
import sys
from setuptools import find_packages, setup
_version_re = re.compile(r'__version__\s+=\s+(.*)')
def read_requirements_file(fname):
with open(fname, 'r') as f:
return [dep.strip() for dep in f.readlines() if not (dep.startswith('-') or '://' in dep)]
def get_requirements():
return read_requirements_file(os.path.join(os.path.dirname(__file__), 'requirements.txt'))
with open('ursh/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(f.read().decode('utf-8')).group(1)))
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
setup(
name='ursh',
version=version,
description='A URL shortening microservice',
url='https://github.com/indico/ursh',
download_url='https://github.com/indico/ursh',
zip_safe=False,
include_package_data=True,
packages=find_packages(),
install_requires=get_requirements(),
entry_points={
'console_scripts': {'ursh = ursh.cli.core:cli'}
},
extras_require={
'tests': [
'pytest'
]
},
)