Skip to content

Commit d7fa650

Browse files
committed
Don't put test requirements in setup.py
test_require and test_suite are not meant to be used that way. Rely on poetry and tox for creating test environments instead. Also, tox should be installed separately, not with Poetry.
1 parent d10ea84 commit d7fa650

File tree

6 files changed

+31
-87
lines changed

6 files changed

+31
-87
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
build
1515
dist
1616
docs/_build
17+
pip-wheel-metadata
18+
wheels
1719

1820
play
1921

poetry.lock

Lines changed: 7 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ packages = [
2929
python = "^3.6"
3030

3131
[tool.poetry.dev-dependencies]
32-
pytest = "^4.6"
33-
pytest-asyncio = "^0.10"
32+
pytest = "^5"
33+
pytest-asyncio = ">=0.10"
3434
pytest-cov = "^2.7"
35-
pytest-describe = "^0.12"
35+
pytest-describe = ">=0.12"
3636
pyyaml = "^5.1"
37-
black = "^19.3b0"
37+
black = ">=19.3b0"
3838
flake8 = "^3.7"
39-
mypy = "^0.711"
40-
tox = "^3.13"
41-
codecov = "^2.0"
39+
mypy = ">=0.711"
40+
codecov = "^2"
4241
sphinx = "^2.1"
43-
sphinx_rtd_theme = "^0.4"
44-
check-manifest = "^0.38"
45-
bump2version = "^0.5"
42+
sphinx_rtd_theme = ">=0.4"
43+
check-manifest = ">=0.39"
44+
bump2version = ">=0.5"
4645

4746
[tool.black]
4847
target-version = ['py36', 'py37', 'py38']

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ python-tag = py3
33

44
[aliases]
55
test = pytest
6-

setup.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,20 @@
1919
author="Christoph Zwerschke",
2020
author_email="[email protected]",
2121
license="MIT license",
22-
# PEP-561: https://www.python.org/dev/peps/pep-0561/
23-
package_data={"graphql": ["py.typed"]},
2422
classifiers=[
2523
"Development Status :: 5 - Production/Stable",
2624
"Intended Audience :: Developers",
27-
'Topic :: Software Development :: Libraries',
25+
"Topic :: Software Development :: Libraries",
2826
"License :: OSI Approved :: MIT License",
2927
"Programming Language :: Python :: 3",
3028
"Programming Language :: Python :: 3.6",
3129
"Programming Language :: Python :: 3.7",
3230
],
3331
install_requires=[],
3432
python_requires=">=3.6",
35-
test_suite="tests",
36-
tests_require=[
37-
"pytest",
38-
"pytest-asyncio",
39-
"pytest-cov",
40-
"pytest-describe",
41-
"black",
42-
"flake8",
43-
"mypy",
44-
"tox",
45-
"codecov",
46-
"check-manifest",
47-
"bump2version",
48-
],
4933
packages=find_packages(include=["graphql"]),
34+
# PEP-561: https://www.python.org/dev/peps/pep-0561/
35+
package_data={"graphql": ["py.typed"]},
5036
include_package_data=True,
5137
zip_safe=False,
5238
)

tox.ini

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,43 @@ envlist = py{36,37}, black, flake8, mypy, docs, manifest
33

44
[testenv:black]
55
basepython = python3.7
6-
deps = black
6+
deps = black>=19.3b0
77
commands =
88
black graphql tests --check
99

1010
[testenv:flake8]
1111
basepython = python3.7
12-
deps = flake8
12+
deps = flake8>=3.7,<4
1313
commands =
1414
flake8 graphql tests
1515

1616
[testenv:mypy]
1717
basepython = python3.7
18-
deps = mypy
18+
deps = mypy>=0.711
1919
commands =
2020
mypy graphql
2121

2222
[testenv:docs]
2323
basepython = python3.7
2424
deps =
25-
sphinx
26-
sphinx_rtd_theme
25+
sphinx>=2.1,<3
26+
sphinx_rtd_theme>=0.4
2727
commands =
2828
sphinx-build -b html -nEW docs docs/_build/html
2929

3030
[testenv:manifest]
3131
basepython = python3.7
32-
deps = check-manifest
32+
deps = check-manifest>=0.39
3333
commands =
3434
check-manifest -v
3535

3636
[testenv]
3737
setenv =
3838
PYTHONPATH = {toxinidir}
3939
deps =
40-
pytest
41-
pytest-asyncio
42-
pytest-cov
43-
pytest-describe
40+
pytest>=5.0,<6
41+
pytest-asyncio>=0.10
42+
pytest-cov>=2.7,<3
43+
pytest-describe>=0.12
4444
commands =
4545
pytest tests {posargs}

0 commit comments

Comments
 (0)