forked from uktrade/directory-constants
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (31 loc) · 978 Bytes
/
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
"""
Export Directory constants
"""
import ast
import pip.download
from pip.req import parse_requirements
import re
from setuptools import setup, find_packages
def get_version():
pattern = re.compile(r'__version__\s+=\s+(.*)')
with open('directory_constants/version.py', 'rb') as src:
return str(ast.literal_eval(
pattern.search(src.read().decode('utf-8')).group(1)
))
def get_requirements():
return [str(r.req) for r in list(parse_requirements(
'requirements.txt',
session=pip.download.PipSession()
))]
setup(
name='directory_constants',
version=get_version(),
url='https://github.com/uktrade/directory-constants',
license='MIT',
author='Department for International Trade',
description='Constant values shared between Directory apps.',
packages=find_packages(),
long_description=open('README.md').read(),
include_package_data=True,
install_requires=get_requirements()
)