Closed mfriedenhagen closed 1 year ago
When running poetry install in a project without a lock file, poetry was stuck
I do have access to the internet from my workstation (but not from our CI-system, there I have to go via an Artifactory instance).
This was a new project without a poetry.lock
file.
Given I unset POETRY_PYPI_MIRROR_URL
and poetry.lock
does exist When I run poetry install
again Then everything is fine. poetry does not need no resolve stuff but probably just checks the SHASUMs.
GIven I change the environment (poetry env use /usr/local/bin/python3.9
) and poetry.lock
does exist When I run poetry install
Then poetry is able to install all dependencies into the new environment.
Given I delete poetry lock
And use the python3.9 environment When I run poetry install
Then poetry runs into a timeout.
Given I delete poetry lock
And use the python3.9 environment When I run poetry lock
Then poetry runs into a timeout.
Given I set POETRY_PYPI_MIRROR_URL
And use the python3.9 environment When I run poetry lock
Then the lock file is created in 5 seconds.
Given poetry.lock
does exist And I unset POETRY_PYPI_MIRROR_URL
When I run poetry lock
again Then I run into a timeout again.
So basically resolving the dependencies does not work.
I do have access to the internet from my workstation (but not from our CI-system, there I have to go via an Artifactory instance).
This was a new project without a
poetry.lock
file.Given I unset
POETRY_PYPI_MIRROR_URL
andpoetry.lock
does exist When I runpoetry install
again Then everything is fine. poetry does not need no resolve stuff but probably just checks the SHASUMs.GIven I change the environment (
poetry env use /usr/local/bin/python3.9
) andpoetry.lock
does exist When I runpoetry install
Then poetry is able to install all dependencies into the new environment.Given I delete
poetry lock
And use the python3.9 environment When I runpoetry install
Then poetry runs into a timeout.Given I delete
poetry lock
And use the python3.9 environment When I runpoetry lock
Then poetry runs into a timeout.Given I set
POETRY_PYPI_MIRROR_URL
And use the python3.9 environment When I runpoetry lock
Then the lock file is created in 5 seconds.Given
poetry.lock
does exist And I unsetPOETRY_PYPI_MIRROR_URL
When I runpoetry lock
again Then I run into a timeout again.So basically resolving the dependencies does not work.
This is the behavior you run into within your CI system, right? Do you also encounter this on your workstation that has access to pypi.org?
No, this is the behavior on my workstation where I have access to pypi.org but forgot the set the environment variable.
I have not been able to reproduce the condition you're encountering, could you run through the steps you're following with -vvv
appended and share the output?
As for displaying a warning in general when POETRY_PYPI_MIRROR_URL
is not set, I'm not sure if this is the right behavior. I imagine that there are situations where the plugin is installed yet the user would like to use a PyPI mirror in some situations but not others. Displaying a warning would be disruptive when the user has deliberately left POETRY_PYPI_MIRROR_URL
, and AFAIK there's no way to toggle plugins on/off easily (e.g. per-project).
Perhaps the plugin should keep track of projects that used a mirror at some point, and warn when poetry interacts with those projects subsequently without POETRY_PYPI_MIRROR_URL
set? I'd need to think about this possibility some more, and decide how information about such projects would be persisted.
After install the plugin with
poetry self add poetry-plugin-pypi-mirror
I forgot to set the environment variable.When running
poetry install
in a project without a lock file, poetry was stuck:It looks like https://github.com/arcesium/poetry-plugin-pypi-mirror/blob/05cd8dd5604394b6e19d440610c1c5122a6e3187/src/poetry_plugin_pypi_mirror/plugins.py does always return immediately and may no repositories are set?
After setting the environment variable, it ran tremendously fast (< 2 seconds) and succeeded.
System setup: