Skip to content

Commit abd993c

Browse files
authored
remove special cases for setuptools and wheel (#8600)
1 parent a029b36 commit abd993c

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

src/poetry/puzzle/transaction.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,9 @@ def calculate_operations(
9898
result_package_names = {
9999
result_package.name for result_package, _ in self._result_packages
100100
}
101-
# We preserve pip/setuptools/wheel when not managed by poetry, this is
102-
# done to avoid externally managed virtual environments causing
103-
# unnecessary removals.
104-
preserved_package_names = {
105-
"pip",
106-
"setuptools",
107-
"wheel",
108-
} - result_package_names
101+
# We preserve pip when not managed by poetry, this is done to avoid
102+
# externally managed virtual environments causing unnecessary removals.
103+
preserved_package_names = {"pip"} - result_package_names
109104

110105
for installed_package in self._installed_packages:
111106
if installed_package.name in uninstalls:

tests/installation/test_installer.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import itertools
43
import json
54

65
from pathlib import Path
@@ -46,8 +45,6 @@
4645
from tests.conftest import Config
4746
from tests.types import FixtureDirGetter
4847

49-
RESERVED_PACKAGES = ("pip", "setuptools", "wheel")
50-
5148

5249
class Executor(BaseExecutor):
5350
def __init__(self, *args: Any, **kwargs: Any) -> None:
@@ -628,12 +625,7 @@ def test_run_install_removes_no_longer_locked_packages_if_installed(
628625

629626
@pytest.mark.parametrize(
630627
"managed_reserved_package_names",
631-
itertools.chain(
632-
[()],
633-
itertools.permutations(RESERVED_PACKAGES, 1),
634-
itertools.permutations(RESERVED_PACKAGES, 2),
635-
[RESERVED_PACKAGES],
636-
),
628+
[(), ("pip",)],
637629
)
638630
def test_run_install_with_synchronization(
639631
managed_reserved_package_names: tuple[str, ...],
@@ -647,16 +639,12 @@ def test_run_install_with_synchronization(
647639
package_b = get_package("b", "1.1")
648640
package_c = get_package("c", "1.2")
649641
package_pip = get_package("pip", "20.0.0")
650-
package_setuptools = get_package("setuptools", "20.0.0")
651-
package_wheel = get_package("wheel", "20.0.0")
652642

653643
all_packages = [
654644
package_a,
655645
package_b,
656646
package_c,
657647
package_pip,
658-
package_setuptools,
659-
package_wheel,
660648
]
661649

662650
managed_reserved_packages = [

0 commit comments

Comments
 (0)