python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.62k stars 2.27k forks source link

poetry add pre-commit fails to resolve dependencies #6697

Closed JasonF-BJSS closed 2 years ago

JasonF-BJSS commented 2 years ago

Issue

With pyproject.toml https://gist.github.com/JasonF-BJSS/d4fe8281cb7b21ba5eb8e90fd1cda13e

running poetry add pre-commit fails to resolve dependencies

JasonF-BJSS commented 2 years ago

raised also with pre-commit: https://github.com/pre-commit/pre-commit/issues/2536 as not sure where bug sits.

Secrus commented 2 years ago

could you clear your cache (poetry cache clear pypi --all) and try it again? it's not a bug with pre-commit for sure, because we are using pre-commit ourselves in Poetry and it resolves fine.

dimbleby commented 2 years ago

you forgot to provide any output that could help anyone to understand what is happening

JasonF-BJSS commented 2 years ago

poetry add pre-commit Using version ^2.20.0 for pre-commit

Updating dependencies Resolving dependencies... (3754.207s)

running in verbose mode it stops here:

poetry add pre-commit -vvv ... Source (PyPI): No release information found for setuptools-13.0, skipping Source (PyPI): 493 packages found for setuptools * 1: fact: virtualenv (20.16.5) depends on distlib (>=0.3.5,<1) 1: fact: virtualenv (20.16.5) depends on filelock (>=3.4.1,<4) 1: fact: virtualenv (20.16.5) depends on platformdirs (>=2.4,<3) 1: selecting virtualenv (20.16.5) 1: derived: filelock (>=3.4.1,<4) 1: derived: distlib (>=0.3.5,<1) [urllib3.connectionpool] Starting new HTTPS connection (1): pypi.org:443 [urllib3.connectionpool] https://pypi.org:443 "GET /pypi/filelock/json HTTP/1.1" 304 0

JasonF-BJSS commented 2 years ago

ohh wait looks like filelock is the issue?:

poetry add filelock -vvv Loading configuration file /Users/jason.francis/Library/Preferences/pypoetry/config.toml Using virtualenv: /Users/jason.francis/Library/Caches/pypoetry/virtualenvs/jml-automation-scripts-deYEdmxQ-py3.10 Project environment contains an empty path in sys_path, ignoring. [keyring.backend] Loading KWallet [keyring.backend] Loading SecretService [keyring.backend] Loading Windows [keyring.backend] Loading chainer [keyring.backend] Loading libsecret [keyring.backend] Loading macOS Creating new session for pypi.org [urllib3.connectionpool] Starting new HTTPS connection (1): pypi.org:443 [urllib3.connectionpool] https://pypi.org:443 "GET /pypi/filelock/json HTTP/1.1" 304 0

dimbleby commented 2 years ago

do you mean that it is hanging at that point? plausibly a stray .lock file in your cache, try find ~/.cache/pypoetry/ -name '*.lock' -delete (or whatever the macOS equivalent is)

neersighted commented 2 years ago

I am unable to reproduce this either -- please try what @dimbleby has suggested. Fixes for this deadlock are in the 1.3 branch.

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.