forked from jllorencetti/pytest-deadfixtures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
74 lines (59 loc) · 2.18 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
import codecs
import os
import re
from setuptools import Command, setup
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding="utf-8").read()
def get_version():
changes_path = os.path.join(BASE_PATH, "CHANGES.rst")
regex = r"^#*\s*(?P<version>[0-9]+\.[0-9]+(\.[0-9]+)?)$"
with codecs.open(changes_path, encoding="utf-8") as changes_file:
for line in changes_file:
res = re.match(regex, line)
if res:
return res.group("version")
return "0.0.0"
version = get_version()
class VersionCommand(Command):
description = "print current library version"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print(version)
setup(
name="pytest-deadfixtures",
version=version,
author="João Luiz Lorencetti",
author_email="[email protected]",
maintainer="João Luiz Lorencetti",
maintainer_email="[email protected]",
license="MIT",
url="https://github.com/jllorencetti/pytest-deadfixtures",
description="A simple plugin to list unused fixtures in pytest",
long_description=read("README.rst"),
py_modules=["pytest_deadfixtures"],
install_requires=["pytest>=3.0.0"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"Topic :: Software Development :: Testing",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
],
cmdclass={"version": VersionCommand},
entry_points={"pytest11": ["deadfixtures = pytest_deadfixtures"]},
)