-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
72 lines (54 loc) · 1.92 KB
/
setup.py
File metadata and controls
72 lines (54 loc) · 1.92 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""Package installation logic"""
import re
from pathlib import Path
from setuptools import find_packages, setup
PACKAGE_REQUIREMENTS = Path(__file__).parent / 'requirements.txt'
DOCUMENTATION_REQUIREMENTS = Path(__file__).parent / 'docs' / 'requirements.txt'
def get_long_description():
"""Return a long description of tha parent package"""
readme_file = Path(__file__).parent / 'README.md'
return readme_file.read_text()
def get_requirements(path):
"""Return a list of package dependencies"""
with path.open() as req_file:
return req_file.read().splitlines()
def get_meta():
"""Return package metadata including the:
- author
- version
- license
"""
init_path = Path(__file__).resolve().parent / 'bank/__init__.py'
init_text = init_path.read_text()
version_regex = re.compile("__version__ = '(.*?)'")
version = version_regex.findall(init_text)[0]
author_regex = re.compile("__author__ = '(.*?)'")
author = author_regex.findall(init_text)[0]
# license_regex = re.compile("__license__ = '(.*?)'")
# license_type = license_regex.findall(init_text)[0]
return author, version
_author, _version = get_meta()
setup(
name='crc-bank',
description='Banking application for resource allocation in Slurm based HPC systems.',
version=_version,
packages=find_packages(),
python_requires='>=3.7',
entry_points="""
[console_scripts]
crc-bank=bank.cli:CommandLineApplication.execute
""",
install_requires=get_requirements(PACKAGE_REQUIREMENTS),
extras_require={
'docs': get_requirements(DOCUMENTATION_REQUIREMENTS),
'tests': ['coverage'],
},
author=_author,
keywords='Pitt, CRC, HPC',
long_description=get_long_description(),
long_description_content_type='text/markdown',
# license=_license_type,
classifiers=[
'Programming Language :: Python :: 3',
]
)