aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-05-07 15:52:49 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2019-05-07 15:52:49 -0400
commitab115a9d1953f4e71be818b614beba96fd96df22 (patch)
tree95029c3499cc20e2c08ea42fddb246e715d21720 /setup.py
parenta7e09d8b4f7c25fec4e270d9549dff521648ca3c (diff)
downloadcryptography-ab115a9d1953f4e71be818b614beba96fd96df22.tar.gz
cryptography-ab115a9d1953f4e71be818b614beba96fd96df22.tar.bz2
cryptography-ab115a9d1953f4e71be818b614beba96fd96df22.zip
Drop setup.py test support. (#4879)
* Drop setup.py test support. It's fragile and relies on eggs. While our downstream redistributors don't love this (sorry!), it seems like the right tradeoff. * Remove unused * Added a changelog entry * typo * line length
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py64
1 files changed, 7 insertions, 57 deletions
diff --git a/setup.py b/setup.py
index 482ec596..bf560dd9 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,6 @@ from __future__ import absolute_import, division, print_function
import os
import platform
-import subprocess
import sys
from distutils.command.build import build
@@ -17,7 +16,6 @@ import pkg_resources
import setuptools
from setuptools import find_packages, setup
from setuptools.command.install import install
-from setuptools.command.test import test
if (
@@ -41,8 +39,6 @@ with open(os.path.join(src_dir, "cryptography", "__about__.py")) as f:
exec(f.read(), about)
-VECTORS_DEPENDENCY = "cryptography_vectors=={0}".format(about['__version__'])
-
# `setup_requirements` must be kept in sync with `pyproject.toml`
setup_requirements = ["cffi>=1.8,!=1.11.3"]
@@ -53,42 +49,6 @@ if platform.python_implementation() == "PyPy":
"PyPy to use this library."
)
-test_requirements = [
- "pytest>=3.6.0,!=3.9.0,!=3.9.1,!=3.9.2",
- "pretend",
- "iso8601",
- "pytz",
- "hypothesis>=1.11.4,!=3.79.2",
-]
-
-
-# If there's no vectors locally that probably means we are in a tarball and
-# need to go and get the matching vectors package from PyPi
-if not os.path.exists(os.path.join(base_dir, "vectors/setup.py")):
- test_requirements.append(VECTORS_DEPENDENCY)
-
-
-class PyTest(test):
- def finalize_options(self):
- test.finalize_options(self)
- self.test_args = []
- self.test_suite = True
-
- # This means there's a vectors/ folder with the package in here.
- # cd into it, install the vectors package and then refresh sys.path
- if VECTORS_DEPENDENCY not in test_requirements:
- subprocess.check_call(
- [sys.executable, "setup.py", "install"], cwd="vectors"
- )
- pkg_resources.get_distribution("cryptography_vectors").activate()
-
- def run_tests(self):
- # Import here because in module scope the eggs are not loaded.
- import pytest
- test_args = [os.path.join(base_dir, "tests")]
- errno = pytest.main(test_args)
- sys.exit(errno)
-
def keywords_with_side_effects(argv):
"""
@@ -183,7 +143,6 @@ def keywords_with_side_effects(argv):
"cmdclass": {
"build": DummyBuild,
"install": DummyInstall,
- "test": DummyPyTest,
}
}
else:
@@ -195,9 +154,6 @@ def keywords_with_side_effects(argv):
return {
"setup_requires": setup_requirements,
- "cmdclass": {
- "test": PyTest,
- },
"cffi_modules": cffi_modules
}
@@ -229,17 +185,6 @@ class DummyInstall(install):
raise RuntimeError(setup_requires_error)
-class DummyPyTest(test):
- """
- This class makes it very obvious when ``keywords_with_side_effects()`` has
- incorrectly interpreted the command line arguments to ``setup.py test`` as
- one of the 'side effect free' commands or options.
- """
-
- def run_tests(self):
- raise RuntimeError(setup_requires_error)
-
-
with open(os.path.join(base_dir, "README.rst")) as f:
long_description = f.read()
@@ -291,11 +236,16 @@ setup(
"asn1crypto >= 0.21.0",
"six >= 1.4.1",
] + setup_requirements,
- tests_require=test_requirements,
extras_require={
":python_version < '3'": ["enum34", "ipaddress"],
- "test": test_requirements,
+ "test": [
+ "pytest>=3.6.0,!=3.9.0,!=3.9.1,!=3.9.2",
+ "pretend",
+ "iso8601",
+ "pytz",
+ "hypothesis>=1.11.4,!=3.79.2",
+ ],
"docs": [
"sphinx >= 1.6.5,!=1.8.0",
"sphinx_rtd_theme",