-
Notifications
You must be signed in to change notification settings - Fork 40
/
setup.py
executable file
·89 lines (75 loc) · 2.76 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
#!/usr/bin/env python3
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
# Load version
with open("autoprotocol/version.py", encoding="utf-8") as file:
pattern = re.compile(r"[0-9]+.[0-9]+.[0-9]+")
__version__ = pattern.findall(file.read()).pop()
with open("README.rst", encoding="utf-8") as file:
long_description = file.read()
# Test Runner (reference: https://docs.pytest.org/en/latest/goodpractices.html)
class PyTest(TestCommand):
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = "--cov=autoprotocol --cov-report=term" # pylint: disable=attribute-defined-outside-init
def run_tests(self):
import shlex
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
# Test and Documentation dependencies
test_deps = [
"coverage>=6, <7",
"pre-commit>=2.4, <3",
"pylint==2.5.2", # should be consistent with .pre-commit-config.yaml
"pytest>=6.2.5, <7",
"pytest-cov>=3.0.0, <4",
"tox>=3.15, <4",
]
doc_deps = [
"jinja2==3.0.0",
"releases>=1.6.3, <2",
"sphinx==4.2.0",
"sphinx_rtd_theme==1.0.0",
"readthedocs-sphinx-search==0.1.1",
"semantic-version==2.6.0",
"six>=1.15.0, <2",
"click==8.0.2",
"black==22.3.0",
]
setup(
name="autoprotocol",
url="https://github.com/autoprotocol/autoprotocol-python",
maintainer="The Autoprotocol Development Team",
description="Python library for generating Autoprotocol",
long_description=long_description,
long_description_content_type="text/x-rst",
license="BSD",
maintainer_email="[email protected]",
version=__version__, # pylint: disable=undefined-variable
install_requires=["Pint==0.9"],
python_requires=">=3.7",
tests_require=test_deps,
extras_require={"docs": doc_deps, "test": test_deps},
cmdclass={"pytest": PyTest},
packages=["autoprotocol", "autoprotocol.liquid_handle", "autoprotocol.types"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)