Poetry stuck while trying to add pre-commit package
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Ubuntu 20.04.4 LTS
- Poetry version: 1.1.13
- Contents of your pyproject.toml file: It is a brand new toml file with the only requirement being
python = "3.7.12"
Issue
I am simply trying to add pre-commit to a brand new poetry environment and it is getting stuck at the first try. The log below is all that is printed at the highest verbose level.
❯ poetry add -D pre-commit -vvv
Using virtualenv: /home/use/repos/mydirectory/.venv
PyPI: 169 packages found for pre-commit *
Using version ^2.19.0 for pre-commit
Updating dependencies
Resolving dependencies...
1: fact: mymodule is 2022.06.2a
1: derived: mymodule
1: fact: mymodule depends on pre-commit (^2.19.0)
1: fact: mymodule depends on pre-commit (^2.19.0)
1: selecting mymodule (2022.06.2a)
1: derived: pre-commit (>=2.19.0,<3.0.0)
PyPI: 1 packages found for pre-commit >=2.19.0,<3.0.0
1: fact: pre-commit (2.19.0) depends on cfgv (>=2.0.0)
1: fact: pre-commit (2.19.0) depends on identify (>=1.0.0)
1: fact: pre-commit (2.19.0) depends on nodeenv (>=0.11.1)
1: fact: pre-commit (2.19.0) depends on pyyaml (>=5.1)
1: fact: pre-commit (2.19.0) depends on toml (*)
1: fact: pre-commit (2.19.0) depends on virtualenv (>=20.0.8)
1: fact: pre-commit (2.19.0) depends on importlib-metadata (*)
1: selecting pre-commit (2.19.0)
1: derived: importlib-metadata
1: derived: virtualenv (>=20.0.8)
1: derived: toml
1: derived: pyyaml (>=5.1)
1: derived: nodeenv (>=0.11.1)
1: derived: identify (>=1.0.0)
1: derived: cfgv (>=2.0.0)
PyPI: 89 packages found for importlib-metadata *
PyPI: 63 packages found for virtualenv >=20.0.8
PyPI: 16 packages found for toml *
PyPI: No release information found for pyyaml-3.01, skipping
PyPI: No release information found for pyyaml-3.02, skipping
PyPI: No release information found for pyyaml-3.03, skipping
PyPI: No release information found for pyyaml-3.04, skipping
PyPI: No release information found for pyyaml-3.05, skipping
PyPI: No release information found for pyyaml-3.06, skipping
PyPI: No release information found for pyyaml-3.07, skipping
PyPI: No release information found for pyyaml-3.08, skipping
PyPI: No release information found for pyyaml-3.09, skipping
PyPI: 9 packages found for pyyaml >=5.1
PyPI: 28 packages found for nodeenv >=0.11.1
PyPI: No release information found for identify-0.0.0.dev1, skipping
PyPI: 126 packages found for identify >=1.0.0
PyPI: 7 packages found for cfgv >=2.0.0
1: selecting cfgv (3.3.1)
1: selecting pyyaml (6.0)
1: selecting toml (0.10.2)
1: selecting nodeenv (1.6.0)
1: fact: virtualenv (20.14.1) depends on distlib (>=0.3.1,<1)
1: fact: virtualenv (20.14.1) depends on filelock (>=3.2,<4)
1: fact: virtualenv (20.14.1) depends on platformdirs (>=2,<3)
1: fact: virtualenv (20.14.1) depends on six (>=1.9.0,<2)
1: fact: virtualenv (20.14.1) depends on importlib-metadata (>=0.12)
1: selecting virtualenv (20.14.1)
1: derived: importlib-metadata (>=0.12)
1: derived: six (>=1.9.0,<2)
1: derived: platformdirs (>=2,<3)
1: derived: filelock (>=3.2,<4)
1: derived: distlib (>=0.3.1,<1)
PyPI: 8 packages found for six >=1.9.0,<2
The message after I force close the process is this:
1: Version solving took 47.674 seconds.
1: Tried 1 solutions.
It only tries one solution no matter how long I leave it there processing something. The environment is using Python 3.7.12 and Poetry (1.1.13) is installed using pipx in an environment using Python 3.8.5
I tried changing the versions of the pre-commit package but it still gets stuck at the same spot, I tried forcing different versions of the virtualenv package also and the result is the same.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to have a single source of truth for poetry and pre-commit ...
This hook just keeps in sync the repos rev in .pre-commit-config.yaml with the packages version locked into poetry.lock . If you use:.
Read more >Python HOW: Using Poetry, Make, and pre-commit-hooks to ...
We use Poetry to manage the project virtual environment and resolve dependencies. Install Poetry as described here. Open a new CLI and check ......
Read more >FAQ | Documentation | Poetry - Python dependency ...
Thus, dependencies are resolved by pip in the first place. But afterwards we run Poetry, which will install the locked dependencies into the...
Read more >How to create a Python package in 2022 - Mathspp
I want to create a Python package with all the bells and whistles, ... First, we add pre-commit as a development dependency with...
Read more >I developed a template for starting new Python projects ...
For individuals who just want to install packages... sure might ... I'm a bit stuck in a MacBook-bubble at my current and previous...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, if you’ve got something weird that only happens on your computer then I duck out!
Clearing the cache is also sometimes worth a try when strange stuff happens:
rm -fr ~/.cache/pypoetry
Clearing the cache fixed it. Thanks