-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
73 lines (62 loc) · 2.21 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
import re
from pathlib import Path
from setuptools import setup, find_packages
CURRENT_DIR = Path(__file__).parent
def get_long_description() -> str:
readme = CURRENT_DIR / "README.rst"
with open(readme) as file:
return file.read()
def find_version(fname, var_name="__version__") -> str:
"""Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
"""
version = None
regex = re.compile(rf'{var_name} = [\'"]([^\'"]*)[\'"]')
with open(fname, "r") as file:
for line in file:
match = regex.match(line)
if match:
version = match.group(1)
break
if not version:
raise RuntimeError("Cannot find version information.")
return version
EXTRAS_REQUIRE = {
"test": ["pytest==6.2.5", "pytest-cov==3.0.0"],
"docs": ["sphinx==4.3.2", "sphinx-autodoc-typehints==1.15.2"],
}
EXTRAS_REQUIRE["dev"] = (
EXTRAS_REQUIRE["test"]
+ EXTRAS_REQUIRE["docs"]
+ ["pre-commit==2.16.0", "flake8==4.0.1", "tox==3.24.5"]
)
setup(
name="gimme-that",
description="Simple and flexible dependency injection framework.",
long_description=get_long_description(),
long_description_content_type="text/x-rst",
keywords="inversion-of-control IoC DI dependency-injection",
author="Pelle Koster",
url="https://github.com/elfjes/gimme-that",
license="MIT",
packages=find_packages("src"),
package_dir={"": "src"},
python_requires=">=3.6",
extras_require=EXTRAS_REQUIRE,
test_suite="tests",
version=find_version("src/gimme/__init__.py"),
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries",
],
project_urls={"Documentation": "https://gimme-that.readthedocs.io/"},
)