Remove deprecated pytest-runner support

The pytest-runner package is deprecated and its use is discouraged. See:

https://github.com/pytest-dev/pytest-runner/

> pytest-runner depends on deprecated features of setuptools and relies
> on features that break security mechanisms in pip. For example
> 'setup_requires' and 'tests_require' bypass pip --require-hashes. See
> also https://github.com/pypa/setuptools/issues/1684.
>
> It is recommended that you:
>
> - Remove 'pytest-runner' from your 'setup_requires', preferably
>   removing the setup_requires option.
> - Remove 'pytest' and any other testing requirements from
>   'tests_require', preferably removing the setup_requires option.
> - Select a tool to bootstrap and then run tests such as tox

Running tests should go through the tox entrypoint.
This commit is contained in:
Jon Dufresne 2020-01-27 05:52:31 -08:00
parent 5965437402
commit e1ccc296f2
3 changed files with 1 additions and 10 deletions

View File

@ -15,8 +15,7 @@ co:
done done
coverage: coverage:
python3 selftest.py pytest -qq
python3 setup.py test
rm -r htmlcov || true rm -r htmlcov || true
coverage report coverage report

View File

@ -1,6 +1,3 @@
[aliases]
test=pytest
[flake8] [flake8]
extend-ignore = E203, W503 extend-ignore = E203, W503
max-line-length = 88 max-line-length = 88

View File

@ -845,9 +845,6 @@ def debug_build():
return hasattr(sys, "gettotalrefcount") return hasattr(sys, "gettotalrefcount")
needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
pytest_runner = ["pytest-runner"] if needs_pytest else []
try: try:
setup( setup(
name=NAME, name=NAME,
@ -884,8 +881,6 @@ try:
cmdclass={"build_ext": pil_build_ext}, cmdclass={"build_ext": pil_build_ext},
ext_modules=[Extension("PIL._imaging", ["_imaging.c"])], ext_modules=[Extension("PIL._imaging", ["_imaging.c"])],
include_package_data=True, include_package_data=True,
setup_requires=pytest_runner,
tests_require=["pytest"],
packages=["PIL"], packages=["PIL"],
package_dir={"": "src"}, package_dir={"": "src"},
keywords=["Imaging"], keywords=["Imaging"],