diff --git a/poetry/repositories/pypi_repository.py b/poetry/repositories/pypi_repository.py index 767a7353b3c..b47b2710e4e 100644 --- a/poetry/repositories/pypi_repository.py +++ b/poetry/repositories/pypi_repository.py @@ -123,7 +123,7 @@ def find_packages( continue try: - package = Package(name, version) + package = Package(info["info"]["name"], version) except ParseVersionError: self._log( 'Unable to parse version "{}" for the {} package, skipping'.format( diff --git a/tests/repositories/test_pypi_repository.py b/tests/repositories/test_pypi_repository.py index f8a0f9336aa..a4730e71650 100644 --- a/tests/repositories/test_pypi_repository.py +++ b/tests/repositories/test_pypi_repository.py @@ -215,3 +215,11 @@ def test_urls(): assert "https://pypi.org/simple/" == repository.url assert "https://pypi.org/simple/" == repository.authenticated_url + + +def test_use_pypi_pretty_name(): + repo = MockRepository(fallback=True) + + package = repo.find_packages("twisted") + assert len(package) == 1 + assert package[0].pretty_name == "Twisted"