-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
47 lines (41 loc) · 1.45 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
import re
from pathlib import Path
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
def get_reqs():
"""Reads requirements from the pip-tools generated requirements/main.txt
because of the strict dependency on pytest, that requirement's version constraints will
be parsed, but all others will ignore version constraints
:return: Required package names
:rtype: list
"""
path = Path("requirements/main.txt")
with open(path, "r") as f:
text = f.read()
pattern = re.compile(r"^\w.*?")
lines = text.split("\n")
reqs = ['pytest>=7.0.0' if line[:6] == 'pytest' else line.split("==")[0] for line in lines if re.search(pattern, line)]
return reqs
setuptools.setup(
name="pytest-factory",
version="0.1.0", # TODO pull from changelog
author="Q2 Software",
author_email="[email protected]",
description="pytest factories for web services",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=get_reqs(),
url="https://github.com/pytest-factory/pytest-factory",
packages=setuptools.find_packages(),
include_package_data=True,
package_data={
"pytest_factory": ["template.py.jinja"]
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache LICENSE-2.0",
"Operating System :: OS Independent",
],
python_requires='>=3.7',
)