Skip to content

Commit 9274755

Browse files
committed
Remove use of deprecated 'setup.py test'
Since setuptools v41.5.0 (27 Oct 2019), the 'test' command is formally deprecated and should not be used. The pytest-runner package also lists itself as deprecated: https://github.com/pytest-dev/pytest-runner > Deprecation Notice > > 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 pypa/setuptools#1684.
1 parent f318ade commit 9274755

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ universal = 1
33

44
[metadata]
55
license_file = LICENSE
6-
7-
[aliases]
8-
test = pytest

setup.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import with_statement
3-
import sys
43

54
from setuptools import setup
65

7-
needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
8-
pytest_runner = ['pytest-runner'] if needs_pytest else []
9-
106

117
def get_version(fname='mccabe.py'):
128
with open(fname) as f:
@@ -37,8 +33,6 @@ def get_long_description():
3733
license='Expat license',
3834
py_modules=['mccabe'],
3935
zip_safe=False,
40-
setup_requires=pytest_runner,
41-
tests_require=['pytest'],
4236
entry_points={
4337
'flake8.extension': [
4438
'C90 = mccabe:McCabeChecker',

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ envlist =
44

55
[testenv]
66
deps =
7+
pytest
78
commands =
8-
python setup.py test -q
9+
pytest
910

1011
[testenv:flake8]
1112
deps =

0 commit comments

Comments
 (0)