-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
77 lines (62 loc) · 2.1 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
import codecs
import os
import re
from setuptools import setup, Command
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]+)?([a-z])?)$'
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-envvars',
version=version,
author='Rafael Henrique da Silva Correia',
author_email='[email protected]',
maintainer='Rafael Henrique da Silva Correia',
maintainer_email='[email protected]',
license='MIT',
url='https://github.com/rafaelhenrique/pytest-envvars',
description='Pytest plugin to validate use of envvars on your tests ',
long_description=read('README.rst'),
packages=['pytest_envvars'],
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.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
],
cmdclass={
'version': VersionCommand,
},
entry_points={
'pytest11': [
'envvars = pytest_envvars',
],
},
)