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

Poetry install might hang in some machines, but there's a workaround. #47

Open
liweintu opened this issue Mar 11, 2024 · 7 comments
Open

Comments

@liweintu
Copy link
Contributor

Some Ubuntu machines might encounter an hanging issue caused by poetry install.

After some investigation, I found it's stuck at keyring, which is a known issue here: python-poetry/poetry#8623

The workaround is export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring, which works for me for now.

@alecandido
Copy link
Member

Yes, it was known even in Qibo (@andrea-pasquale wrestled with it for a while, and most likely he was not alone).

However, with the latest Poetry release (i.e. 1.8.0) you don't need any workaround, they added a suitable configuration
https://python-poetry.org/docs/configuration/#keyringenabled
announced in:
https://python-poetry.org/blog/announcing-poetry-1.8.0/#added
introduced by:
python-poetry/poetry#8910

@andrea-pasquale
Copy link

However, with the latest Poetry release (i.e. 1.8.0) you don't need any workaround, they added a suitable configuration
https://python-poetry.org/docs/configuration/#keyringenabled
announced in:
https://python-poetry.org/blog/announcing-poetry-1.8.0/#added
introduced by:
python-poetry/poetry#8910

Good to know that poetry finally addressed the issue!
@alecandido at this point we can propagate this fix in the pyproejct.toml for all our repos, right?

@alecandido
Copy link
Member

Yes, @andrea-pasquale, that was part of the reason I mentioned you :)

We are actually always using the latest version in the workflows (i.e. latest release, not the default branch), so the feature is available
https://github.com/qiboteam/qibocal/actions/runs/8208980790/job/22453567462#step:4:52

@andrea-pasquale
Copy link

Great, I can propagate the change to qibocal.

I've seen that the qrccluster is using poetry 1.7.1. Most of the issues with keyring were happening in the cluster, although if I understand correctly poetry is used just to create the default env for non-developers. That being said it might be worth to keep an eye on this in case we see again something weird happening with poetry and keyring.

@alecandido
Copy link
Member

although if I understand correctly poetry is used just to create the default env for non-developers.

Yes, exactly, it is the module load env. You can always install yourself your own Poetry with pipx and similar (or just curl ... | sh the official installer).

That being said it might be worth to keep an eye on this in case we see again something weird happening with poetry and keyring.

Not a bad idea :)

@liweintu
Copy link
Contributor Author

liweintu commented Mar 12, 2024

Thanks @alecandido and @andrea-pasquale for the pointer. This new configuration, as a fix, is much clearer and better organised than the workaround of directly manipulating the environment variable.

As for the env, I believe, most of our folks here use miniforge, even for a cluster, so it's quite similar to a conda env, where poetry lives.

@alecandido
Copy link
Member

alecandido commented Mar 12, 2024

Thanks @alecandido and @andrea-pasquale for the pointer. This new configuration, as a fix, is much clearer and better organised than the workaround of directly manipulating the environment variable.

No worries, it's a weeks-old fix, against a years-old bug (well, not truly a bug, but definitely an annoying behavior...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants