Skip to content

Commit

Permalink
Merge pull request #12787 from mgorny/no-isol-tests
Browse files Browse the repository at this point in the history
Use `--no-build-isolation` in tests to avoid using Internet
  • Loading branch information
sbidoul authored and pradyunsg committed Jul 7, 2024
1 parent 41772d8 commit a56129c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def pip_editable_parts(
"-m",
"pip",
"install",
"--no-build-isolation",
"--target",
pip_self_install_path,
"-e",
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def test_config_settings_implies_pep517(
)
result = script.pip(
"wheel",
"--no-build-isolation",
"--config-settings",
"FOO=Hello",
pkg_path,
Expand Down
13 changes: 11 additions & 2 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,9 @@ def test_link_hash_in_dep_fails_require_hashes(
# Build a wheel for pkga and compute its hash.
wheelhouse = tmp_path / "wheehouse"
wheelhouse.mkdir()
script.pip("wheel", "--no-deps", "-w", wheelhouse, project_path)
script.pip(
"wheel", "--no-build-isolation", "--no-deps", "-w", wheelhouse, project_path
)
digest = hashlib.sha256(
wheelhouse.joinpath("pkga-1.0-py3-none-any.whl").read_bytes()
).hexdigest()
Expand Down Expand Up @@ -905,7 +907,14 @@ def test_editable_install__local_dir_setup_requires_with_pyproject(
"setup(name='dummy', setup_requires=['simplewheel'])\n"
)

script.pip("install", "--find-links", shared_data.find_links, "-e", local_dir)
script.pip(
"install",
"--no-build-isolation",
"--find-links",
shared_data.find_links,
"-e",
local_dir,
)


def test_install_pre__setup_requires_with_pyproject(
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_self_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ def test_self_update_editable(script: Any, pip_src: Any) -> None:
# Step 1. Install pip as non-editable. This is expected to succeed as
# the existing pip in the environment is installed in editable mode, so
# it only places a .pth file in the environment.
proc = script.pip("install", pip_src)
proc = script.pip("install", "--no-build-isolation", pip_src)
assert proc.returncode == 0
# Step 2. Using the pip we just installed, install pip *again*, but
# in editable mode. This could fail, as we'll need to uninstall the running
# pip in order to install the new copy, and uninstalling pip while it's
# running could fail. This test is specifically to ensure that doesn't
# happen...
proc = script.pip("install", "-e", pip_src)
proc = script.pip("install", "--no-build-isolation", "-e", pip_src)
assert proc.returncode == 0

0 comments on commit a56129c

Please sign in to comment.