-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
49 lines (41 loc) · 1.3 KB
/
setup.py
File metadata and controls
49 lines (41 loc) · 1.3 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
import setuptools
import os
def readfile(filename):
with open(filename, 'r+') as f:
return f.read()
def get_version():
"""Gets the version from pscs.__init__ without importing it"""
here_dir = os.path.dirname(__file__)
pscs_init = os.path.join(here_dir, 'pscs', '__init__.py')
init_contents = readfile(pscs_init).split('\n')
version = "unknwon"
for line in init_contents:
if "__version__" in line:
version = line.split('=')[1].replace('"', '').strip()
break
print(version)
return version
def get_requirements():
"""Loads the contents of requirements.txt and returns them as a list."""
here_dir = os.path.dirname(__file__)
return readfile(os.path.join(here_dir, 'requirements.txt')).splitlines()
setuptools.setup(
name="pscs",
version=get_version(),
author="Alexandre Hutton",
author_email="",
description="",
long_description="",
url="",
classifiers=[
"Development Status :: 2 - Alpha",
'Intended Audience :: Science/Research',
"Programming Language :: Python :: 3",
"License :: OSI Approved :: AGPL 3"
],
packages=setuptools.find_packages(),
include_package_data=True,
python_requires='>=3.11',
license="AGPL",
install_requires=get_requirements(),
)