Skip to content

Commit 36a6101

Browse files
authored
Merge pull request #1311 from henryiii/henryiii/fix/rootpip2
fix: hide root pip warning and upgrade check
2 parents 8672fee + db12084 commit 36a6101

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

cibuildwheel/linux.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ def build_in_container(
189189
log.step("Setting up build environment...")
190190

191191
env = container.get_environment()
192+
env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
193+
env["PIP_ROOT_USER_ACTION"] = "ignore"
192194

193195
# put this config's python top of the list
194196
python_bin = config.path / "bin"

test/test_0_basic.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)
2121

2222

23-
def test(tmp_path, build_frontend_env):
23+
def test(tmp_path, build_frontend_env, capfd):
2424
project_dir = tmp_path / "project"
2525
basic_project.generate(project_dir)
2626

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

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

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

0 commit comments

Comments
 (0)