-
Notifications
You must be signed in to change notification settings - Fork 26
/
setup.py
executable file
·103 lines (93 loc) · 3.93 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
#!/usr/bin/env python
# Copyright 2019-2024 The University of Manchester, UK
# Copyright 2020-2024 Vlaams Instituut voor Biotechnologie (VIB), BE
# Copyright 2020-2024 Barcelona Supercomputing Center (BSC), ES
# Copyright 2020-2024 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT
# Copyright 2022-2024 École Polytechnique Fédérale de Lausanne, CH
# Copyright 2024 Data Centre, SciLifeLab, SE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from setuptools import setup, find_packages
from codecs import open
from os import path
import re
# https://www.python.org/dev/peps/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions # noqa
PEP440_PATTERN = r"([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?" # noqa
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
required = f.read().splitlines()
with open(path.join(here, 'rocrate', '_version.py'), encoding='utf-8') as f:
# "parse" rocrate/_version.py which MUST have this pattern
# __version__ = "0.1.1"
# see https://www.python.org/dev/peps/pep-0440
v = f.read().strip()
m = re.match(r'^__version__ = "(' + PEP440_PATTERN + ')"$', v)
if not m:
msg = ('rocrate/_version.py did not match pattern '
'__version__ = "0.1.2" (see PEP440):\n') + v
raise Exception(msg)
__version__ = m.group(1)
setup(
name='rocrate',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
version=__version__, # update in rocrate/_version.py
description='RO-Crate metadata generator/parser',
long_description_content_type='text/markdown',
long_description=long_description,
author=", ".join((
'Eli Chadwick',
'Paul De Geest',
'Bert Droesbeke',
'Ignacio Eguinoa',
'Alban Gaignard',
'Matthias Hörtenhuber',
'Sebastiaan Huber',
'Bruno Kinoshita',
'Simone Leo',
'Luca Pireddu',
'Laura Rodríguez-Navas',
'Raül Sirvent',
'Stian Soiland-Reyes'
)),
python_requires='>=3.9',
author_email='stain@apache.org',
package_data={'': ['data/*.jsonld', 'templates/*.j2']},
# SPDX, pending https://github.com/pombredanne/spdx-pypi-pep/pull/2
license="Apache-2.0",
url='https://github.com/ResearchObject/ro-crate-py/',
download_url=('https://github.com/researchobject/ro-crate-py/archive/'
f'{__version__}.tar.gz'),
keywords="researchobject ro-crate ro metadata jsonld",
install_requires=[required],
classifiers=[
'Operating System :: OS Independent',
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Topic :: Software Development :: Libraries',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Internet',
'Topic :: Internet :: WWW/HTTP',
'Topic :: System :: Archiving',
'Topic :: System :: Archiving :: Packaging',
],
entry_points={
"console_scripts": ["rocrate=rocrate.cli:cli"],
},
)