diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-01-06 21:55:17 +0000 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-01-06 22:51:05 +0000 |
commit | 6c5c22e357705b922b775ad1aeee663398eb1b8c (patch) | |
tree | 4bfe7fb794c0629e89be45205fd38c20a8fadd40 | |
parent | f4776f2e5c624f47b803221f3211c30b05f4000d (diff) | |
download | python-setuptools-git-6c5c22e357705b922b775ad1aeee663398eb1b8c.tar.gz |
Use setuptools wheel instead of source tree in integration tests
-rw-r--r-- | setup.cfg | 6 | ||||
-rw-r--r-- | setuptools/tests/integration/test_pip_install_sdist.py | 12 |
2 files changed, 8 insertions, 10 deletions
@@ -69,9 +69,13 @@ testing-integration = pytest pytest-xdist pytest-enabler - virtualenv + virtualenv>=13.0.0 tomli wheel + jaraco.path>=3.2.0 + jaraco.envs>=2.2 + build[virtualenv] + filelock>=3.4.0 docs = diff --git a/setuptools/tests/integration/test_pip_install_sdist.py b/setuptools/tests/integration/test_pip_install_sdist.py index 23801bc4..54955938 100644 --- a/setuptools/tests/integration/test_pip_install_sdist.py +++ b/setuptools/tests/integration/test_pip_install_sdist.py @@ -22,15 +22,11 @@ from urllib.request import urlopen import pytest from packaging.requirements import Requirement -import setuptools - from .helpers import Archive, run pytestmark = pytest.mark.integration -SETUPTOOLS_ROOT = os.path.dirname(next(iter(setuptools.__path__))) - LATEST, = list(Enum("v", "LATEST")) """Default version to be checked""" # There are positive and negative aspects of checking the latest version of the @@ -117,7 +113,7 @@ ALREADY_LOADED = ("pytest", "mypy") # loaded by pytest/pytest-enabler @pytest.mark.parametrize('package, version', EXAMPLES) -def test_install_sdist(package, version, tmp_path, venv_python): +def test_install_sdist(package, version, tmp_path, venv_python, setuptools_wheel): venv_pip = (venv_python, "-m", "pip") sdist = retrieve_sdist(package, version, tmp_path) deps = build_deps(package, sdist) @@ -127,10 +123,8 @@ def test_install_sdist(package, version, tmp_path, venv_python): run([*venv_pip, "install", *deps]) # Use a virtualenv to simulate PEP 517 isolation - # but install setuptools to force the version under development - correct_setuptools = os.getenv("PROJECT_ROOT") or SETUPTOOLS_ROOT - assert os.path.exists(os.path.join(correct_setuptools, "pyproject.toml")) - run([*venv_pip, "install", "-Ie", correct_setuptools]) + # but install fresh setuptools wheel to ensure the version under development + run([*venv_pip, "install", "-I", setuptools_wheel]) run([*venv_pip, "install", *SDIST_OPTIONS, sdist]) # Execute a simple script to make sure the package was installed correctly |