forked from discopy/discopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
57 lines (51 loc) · 2.11 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
"""
Setup discopy package.
"""
if __name__ == '__main__': # pragma: no cover
from re import search, M
from setuptools import setup, find_packages
def get_version(filename="discopy/__init__.py",
pattern=r"^__version__ = ['\"]([^'\"]*)['\"]"):
with open(filename, 'r') as file:
MATCH = search(pattern, file.read(), M)
if MATCH:
return MATCH.group(1)
else:
raise RuntimeError("Unable to find version string.")
VERSION = get_version()
def get_reqs(filename):
try:
with open(filename, 'r') as file:
return [line.strip() for line in file.readlines()]
except FileNotFoundError:
from warnings import warn
warn("{} not found".format(filename))
return []
TEST_REQS = get_reqs("test/requirements.txt")
DOCS_REQS = get_reqs("docs/requirements.txt")
setup(name='discopy',
version=VERSION,
package_dir={'discopy': 'discopy'},
packages=find_packages(),
description='The Python toolkit for computing with string diagrams.',
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
url='https://discopy.org',
project_urls={
'Documentation': 'https://docs.discopy.org',
'Source': 'https://github.com/discopy/discopy',
'Tracker': 'https://github.com/discopy/discopy/issues',
},
keywords='diagrams category-theory quantum-computing nlp',
author='Alexis Toumi',
author_email='[email protected]',
download_url='https://github.com/discopy/discopy/archive/'
f'{VERSION}.tar.gz',
install_requires=[
l.strip() for l in open('requirements.txt').readlines()],
tests_require=TEST_REQS,
extras_require={'test': TEST_REQS, 'docs': DOCS_REQS},
data_file=[('test', ['test/requirements.txt']),
('docs', ['docs/requirements.txt'])],
python_requires='>=3.9',
)