Skip to content

Commit 30c0ad2

Browse files
committed
Fix test_debian_egg_name_workaround
Run setup.py install manually since pip does not do it anymore.
1 parent b159aff commit 30c0ad2

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tests/functional/test_install_compat.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
"""
55
import os
6+
from pathlib import Path
67

78
import pytest
89

@@ -11,7 +12,11 @@
1112

1213

1314
@pytest.mark.network
14-
def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None:
15+
def test_debian_egg_name_workaround(
16+
script: PipTestEnvironment,
17+
shared_data: TestData,
18+
tmp_path: Path,
19+
) -> None:
1520
"""
1621
We can uninstall packages installed with the pyversion removed from the
1722
egg-info metadata directory name.
@@ -22,10 +27,17 @@ def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None:
2227
https://bitbucket.org/ianb/pip/issue/104/pip-uninstall-on-ubuntu-linux
2328
2429
"""
25-
result = script.pip("install", "INITools==0.2")
30+
result = script.run(
31+
"python",
32+
"setup.py",
33+
"install",
34+
"--single-version-externally-managed",
35+
f"--record={tmp_path / 'record'}",
36+
cwd=shared_data.src / "simplewheel-2.0",
37+
)
2638

2739
egg_info = os.path.join(
28-
script.site_packages, f"INITools-0.2-py{pyversion}.egg-info"
40+
script.site_packages, f"simplewheel-2.0-py{pyversion}.egg-info"
2941
)
3042

3143
# Debian only removes pyversion for global installs, not inside a venv
@@ -35,7 +47,7 @@ def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None:
3547
result.did_create(egg_info, message=f"Couldn't find {egg_info}")
3648

3749
# The Debian no-pyversion version of the .egg-info
38-
mangled = os.path.join(script.site_packages, "INITools-0.2.egg-info")
50+
mangled = os.path.join(script.site_packages, "simplewheel-2.0.egg-info")
3951
result.did_not_create(mangled, message=f"Found unexpected {mangled}")
4052

4153
# Simulate a Debian install by copying the .egg-info to their name for it
@@ -46,7 +58,7 @@ def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None:
4658
assert os.path.isdir(full_mangled)
4759

4860
# Try the uninstall and verify that everything is removed.
49-
result2 = script.pip("uninstall", "INITools", "-y")
61+
result2 = script.pip("uninstall", "simplewheel", "-y")
5062
assert_all_changes(result, result2, [script.venv / "build", "cache"])
5163

5264

0 commit comments

Comments
 (0)