-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup.py
79 lines (74 loc) · 2.52 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
"""Setup for this package."""
import ast
import os
import typing
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
src = os.path.join(here, "src")
with open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
README = fh.read()
with open(os.path.join(here, "LICENSE.md"), encoding="utf-8") as fh:
LICENSE = fh.read()
with open(os.path.join(src, "package", "__init__.py"), encoding="utf-8") as fh:
module = ast.parse(next(filter(lambda line: line.startswith("__version__"), fh)))
assign = typing.cast(ast.Assign, module.body[0])
# See also: https://github.com/relekang/python-semantic-release/issues/388
VERSION = typing.cast(ast.Constant, assign.value).s
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#setup-args
# https://docs.python.org/3/distutils/apiref.html#distutils.core.setup
setuptools.setup(
name="package",
version=VERSION,
description="",
long_description=README,
long_description_content_type="text/markdown",
url="https://project.url/",
author="Author",
author_email="author@email",
maintainer="Maintainer",
maintainer_email="maintainer@email",
license=LICENSE,
# https://pypi.org/classifiers/
classifiers=[
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
],
python_requires=">=3.9",
keywords="",
project_urls={
"Homepage": "https://foo.bar/",
},
packages=setuptools.find_packages(where="src"),
package_dir={"": "src"},
package_data={
"package": ["py.typed"],
},
include_package_data=True,
install_requires=[],
extras_require={
"test": ["hypothesis==6.30.1", "pytest==6.2.5", "pytest-cov==3.0.0"],
"dev": [
"flake8==4.0.1",
"flake8-builtins==1.5.3",
"flake8-docstrings==1.6.0",
"flake8-rst-docstrings==0.2.3",
"hypothesis==6.30.1",
"mypy==0.910",
"pep8-naming==0.12.1",
"pre-commit==2.16.0",
"pylint==2.12.2",
"tox==3.24.4",
"types-setuptools==57.4.2",
],
"docs": ["sphinx==4.3.1"],
},
options={},
platforms="",
zip_safe=False,
)