Skip to content

Commit

Permalink
Merge pull request #1311 from henryiii/henryiii/fix/rootpip2
Browse files Browse the repository at this point in the history
fix: hide root pip warning and upgrade check
  • Loading branch information
joerick committed Oct 26, 2022
2 parents 8672fee + db12084 commit 36a6101
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cibuildwheel/linux.py
Expand Up @@ -189,6 +189,8 @@ def build_in_container(
log.step("Setting up build environment...")

env = container.get_environment()
env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
env["PIP_ROOT_USER_ACTION"] = "ignore"

# put this config's python top of the list
python_bin = config.path / "bin"
Expand Down
8 changes: 7 additions & 1 deletion test/test_0_basic.py
Expand Up @@ -20,7 +20,7 @@
)


def test(tmp_path, build_frontend_env):
def test(tmp_path, build_frontend_env, capfd):
project_dir = tmp_path / "project"
basic_project.generate(project_dir)

Expand All @@ -31,6 +31,12 @@ def test(tmp_path, build_frontend_env):
expected_wheels = utils.expected_wheels("spam", "0.1.0")
assert set(actual_wheels) == set(expected_wheels)

# Verify pip warning not shown
captured = capfd.readouterr()
for stream in (captured.err, captured.out):
assert "WARNING: Running pip as the 'root' user can result" not in stream
assert "A new release of pip available" not in stream


@pytest.mark.skip(reason="to keep test output clean")
def test_sample_build(tmp_path, capfd):
Expand Down

0 comments on commit 36a6101

Please sign in to comment.