diff --git a/src/poetry/factory.py b/src/poetry/factory.py index 18e7cdc1df5..e4807aa00c2 100644 --- a/src/poetry/factory.py +++ b/src/poetry/factory.py @@ -154,16 +154,16 @@ def create_pool( if repository.name.lower() == "pypi": explicit_pypi = True - # Only add PyPI if no default repository is configured + # Only add PyPI if no primary repository is configured if not explicit_pypi: if pool.has_primary_repositories(): if io.is_debug(): io.write_line("Deactivating the PyPI repository") else: - from poetry.repositories.pypi_repository import PyPiRepository - pool.add_repository( - PyPiRepository(disable_cache=disable_cache), + cls.create_package_source( + {"name": "pypi"}, config, disable_cache=disable_cache + ), priority=Priority.PRIMARY, )