Skip to content

Commit

Permalink
Remove use of deprecated 'setup.py test' (#187)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jdufresne committed Dec 8, 2020
1 parent 4650dbf commit 6a59c4b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
3 changes: 0 additions & 3 deletions setup.cfg
@@ -1,6 +1,3 @@
[aliases]
test=pytest

[bdist_wheel]
universal = 1

Expand Down
8 changes: 0 additions & 8 deletions setup.py
@@ -1,14 +1,8 @@
#!/usr/bin/env python

import sys

from setuptools import find_packages, setup


needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []


# Get version without importing, which avoids dependency issues
def get_version():
import re
Expand Down Expand Up @@ -55,7 +49,5 @@ def readme():
"Topic :: Text Processing :: Linguistic"],
packages=find_packages(),
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
setup_requires=pytest_runner,
tests_require=['pytest', 'hypothesis'],
entry_points={'console_scripts':
['chardetect = chardet.cli.chardetect:main']})

0 comments on commit 6a59c4b

Please sign in to comment.