-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
80 lines (68 loc) · 2.41 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
"""Setup for ocfl-py."""
import os
import re
from pathlib import Path
from setuptools import setup, Command
# Extract version number
verfile = Path("ocfl/_version.py").read_text(encoding="utf-8")
match = re.search(r'''^__version__ = "(\d\.\d.\d+(\.\d+)?)"''',
verfile, re.MULTILINE)
if match:
version = match.group(1)
else:
raise RuntimeError("Unable to find version string")
class ShellCommand(Command):
"""Class to with defaults for adding extra shell commnads from setup."""
user_options = []
def initialize_options(self):
"""Empty initialize_options."""
def finalize_options(self):
"""Empty finalize_options."""
class Coverage(ShellCommand):
"""Class to allow coverage run from setup."""
description = "run coverage"
def run(self):
"""Run coverage program."""
os.system("coverage run --source=ocfl setup.py test")
os.system("coverage report")
os.system("coverage html")
print("See htmlcov/index.html for details.")
setup(
name='ocfl-py',
version=version,
author='Simeon Warner',
author_email='[email protected]',
packages=['ocfl'],
package_data={'ocfl': ['data/*']},
scripts=['ocfl.py', 'ocfl-object.py', 'ocfl-sidecar.py', 'ocfl-validate.py'],
classifiers=["Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: "
"Libraries :: Python Modules"],
url='https://github.com/zimeon/ocfl-py',
description='ocfl-py - A Python implementation of OCFL',
long_description=Path('README').read_text(encoding="utf-8"),
install_requires=[
'bagit>=1.8.1',
'dateutils>=0.6.6',
'fs>2.4.13',
'fs_s3fs>=1.1.1',
'pairtree>=0.8.1'
],
tests_require=[
'mock>=5.1'
],
test_suite="tests",
cmdclass={
'coverage': Coverage
},
)