Skip to content

Commit 65ffc40

Browse files
committed
repo/legacy: remove unwanted stubbing of packages
This change removes a stubbing change added in 46ae4f5. This change was incorrect, as the base class already sets package list to an empty list. The test case was also incorrect as it forced addition to internal package list.
1 parent 6b3f767 commit 65ffc40

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

src/poetry/repositories/legacy_repository.py

-12
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@ def __init__(
3838

3939
super().__init__(name, url.rstrip("/"), config, disable_cache, pool_size)
4040

41-
@property
42-
def packages(self) -> list[Package]:
43-
# LegacyRepository._packages is not populated and other implementations
44-
# implicitly rely on this (e.g. Pool.search via
45-
# LegacyRepository.search). To avoid special-casing Pool or changing
46-
# behavior, we stub and return an empty list.
47-
#
48-
# TODO: Rethinking search behaviour and design.
49-
# Ref: https://github.com/python-poetry/poetry/issues/2446 and
50-
# https://github.com/python-poetry/poetry/pull/6669#discussion_r990874908.
51-
return []
52-
5341
def package(
5442
self, name: str, version: Version, extras: list[str] | None = None
5543
) -> Package:

tests/repositories/test_legacy_repository.py

-7
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ def _download(
6262
shutil.copyfile(str(filepath), dest)
6363

6464

65-
def test_packages_property_returns_empty_list() -> None:
66-
repo = MockRepository()
67-
repo._packages = [repo.package("jupyter", Version.parse("1.0.0"))]
68-
69-
assert repo.packages == []
70-
71-
7265
def test_page_relative_links_path_are_correct() -> None:
7366
repo = MockRepository()
7467

0 commit comments

Comments
 (0)