Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide root pip warning and upgrade check #1311

Merged
merged 3 commits into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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