-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
102 lines (86 loc) · 3.38 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
"""Setup-script for audioprotopnet package."""
import os
import sys
import importlib
from setuptools import setup, find_packages
import versioneer
PACKAGE_NAME = 'audioprotopnet' # name used by PIP
IMPORT_NAME = 'audioprotopnet' # name used for imports
NAMESPACE = ""
with open('requirements.txt', 'r') as f:
requirements_install = f.readlines()
# Add all the packages in requirements.txt to an extra named '[dev]'
with open('requirements-dev.txt', 'r') as f:
requirements_dev = f.readlines()
# All the requirements
requirements = {
'install': [
r for r in requirements_install if not r.startswith('-r ')
],
'test': [ # testing
'pytest',
'coverage',
],
'docs': [ # documentation generation and tools
'Sphinx',
'sphinx-rtd-theme', # nicer theme for the html docs
'sphinx-autodoc-typehints', # use typehints to provide types
],
'dev': [
r for r in requirements_dev if not r.startswith('-r ')
],
}
URLS = {
'JIRA': 'http://applik-84.iwes.fraunhofer.de/', # TODO: add link to project
'GITLAB': 'https://gitlab.cc-asp.fraunhofer.de/iee_oe224/AudioProtoPNet', # TODO add link for this to coookiecutter props?
# 'Documentation': '???', # should link to the docs
}
SCRIPTS = [] # no scripts necessary
CLASSIFIERS = [
'Development Status :: 3 - Alpha', # TODO: change classifiers
'Programming Language :: Python :: 3.10',
]
# ======================================================================================
# No configurable options below this line
# Get current version etc. from the `__about__.py` file --------------------------------
# Very evil way to retrieve the variables contained in about.
# Those will be added to the current scope
PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(PROJECT_PATH)
about = importlib.import_module(IMPORT_NAME + '.__about__')
# def find_version(*file_paths):
# """Function used to find the version of the package."""
# version_file = read(*file_paths)
# version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
# version_file, re.MULTILINE)
# if version_match:
# return version_match.group(1)
# raise RuntimeError("Unable to find version string for the package.")
if __name__ == '__main__':
setup(
# General ---
name=PACKAGE_NAME,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
packages=find_packages(exclude=['docs', 'tests', 'tests.*']),
namespace_packages=([NAMESPACE] if NAMESPACE else []),
scripts=SCRIPTS,
install_requires=requirements['install'],
extras_require={k: r for k, r in requirements.items() if k != 'install'},
# Testing ---
test_suite='pytest.collector',
tests_require=requirements['test'],
package_data={
# If any package contains *.rst files, include them:
'': ['*.rst'],
},
# Metadata --- (needed if we ever have a private Package Index)
author=about.__author__,
description=about.__description__,
classifiers=CLASSIFIERS,
# long_description='???',
# license='???',
# url='???' # should link somewhere, perhaps to the docs
project_urls=URLS,
# could also include long_description, download_url, classifiers, etc.
)