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 legacy repositories information not being set on packages #2484

Merged
merged 1 commit into from
Jun 5, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions poetry/repositories/legacy_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ def find_packages(

for version in versions:
package = Package(name, version)
package.source_type = "legacy"
package.source_reference = self.name
package.source_url = self._url

if extras is not None:
Expand Down Expand Up @@ -313,6 +315,7 @@ def package(
if release_info["requires_python"]:
package.python_versions = release_info["requires_python"]

package.source_type = "legacy"
package.source_url = self._url
package.source_reference = self.name

Expand Down
7 changes: 7 additions & 0 deletions tests/repositories/test_legacy_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def test_get_package_information_fallback_read_setup():

package = repo.package("jupyter", "1.0.0")

assert package.source_type == "legacy"
assert package.source_reference == repo.name
assert package.source_url == repo.url
assert package.name == "jupyter"
assert package.version.text == "1.0.0"
assert (
Expand Down Expand Up @@ -142,6 +145,10 @@ def test_find_packages_no_prereleases():

assert len(packages) == 1

assert packages[0].source_type == "legacy"
assert packages[0].source_reference == repo.name
assert packages[0].source_url == repo.url


def test_get_package_information_chooses_correct_distribution():
repo = MockRepository()
Expand Down