-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup.py
114 lines (98 loc) · 3.5 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
103
104
105
106
107
108
109
110
111
112
113
114
import re
import os
import sys
from pathlib import Path
from setuptools import setup
def find_version(filename):
_version_re = re.compile(r"__version__ = ['\"](.*)['\"]")
last = None # match python semantics
for line in open(filename):
version_match = _version_re.match(line)
if version_match:
last = version_match.group(1)
return last
__version__ = find_version('sparcur/__init__.py')
def tangle_files(*files):
""" emacs org babel tangle blocks to files for release """
argv = [
'emacs',
'--batch',
'--quick',
'--directory', '.',
'--load', 'org',
'--load', 'ob-shell',
'--load', 'ob-python',
] + [arg
for f in files
for arg in ['--eval', f'"(org-babel-tangle-file \\"{f}\\")"']]
os.system(' '.join(argv))
def fix_relative_links(md):
group = 'SciCrunch'
repo = 'sparc-curation'
return md.replace('](./', f'](https://github.com/{group}/{repo}/blob/master/')
with open('README.md', 'rt') as f:
long_description = fix_relative_links(f.read())
RELEASE = '--release' in sys.argv
NEED_SIMPLE = not Path('sparcur', 'simple').exists()
if RELEASE or NEED_SIMPLE:
if RELEASE:
sys.argv.remove('--release')
tangle_files(
'./docs/developer-guide.org',)
cron_requires = ['celery', 'redis']
tests_require = ['pytest', 'pytest-runner'] + cron_requires
setup(name='sparcur',
version=__version__,
description='assorted',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/SciCrunch/sparc-curation',
author='Tom Gillespie',
author_email='[email protected]',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
],
keywords='SPARC curation biocuration ontology pennsieve protc protocols hypothesis',
packages=['sparcur', 'sparcur.export', 'sparcur.extract', 'sparcur.sparcron', 'sparcur.simple'],
python_requires='>=3.6',
tests_require=tests_require,
install_requires=[
'augpathlib>=0.0.29',
'beautifulsoup4',
'pennsieve',
'dicttoxml',
"ipython; python_version < '3.7'",
'jsonschema>=3.0.1', # need the draft 6 validator
'ontquery>=0.2.8',
'openpyxl',
'protcur>=0.0.11',
'pyontutils>=0.1.35',
'pysercomb>=0.0.11',
'terminaltables',
'xlsx2csv',
],
extras_require={'dev': ['wheel'],
'filetypes': ['nibabel', 'pydicom', 'scipy'],
'cron': cron_requires,
'test': tests_require},
scripts=[],
entry_points={
'console_scripts': [
'spc=sparcur.cli:main',
],
},
data_files=[('share/sparcur/resources/', ['resources/mimetypes.json']),],
)