-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add more context to Poetry error messages #5885
Comments
a lot was improved in the incoming 1.2 release. You can check it out from |
When hitting an exception the stack is available by running with You didn't say how to reproduce either of the errors that you're complaining about.
#4597 shows the way: reports for specific errors are useful and actionable, and if you can do that for your But as a catch-all "please be better" - I suggest this can only be closed. |
If your pyproject.toml includes something like this: [tool.poetry.scripts]
foo = "foo.main" then you get this behaviour: $ poetry install
Installing dependencies from lock file
No dependencies to install or update
Installing the current project: foo (0.1.0)
not enough values to unpack (expected 2, got 1) Using $ poetry -v install
Using virtualenv: /home/ash/src/foo/.venv
Installing dependencies from lock file
Finding the necessary packages for the current system
Package operations: 0 installs, 0 updates, 0 removals, 10 skipped
• Installing aiohttp (3.8.3): Skipped for the following reason: Already installed
• Installing aiosignal (1.3.1): Skipped for the following reason: Already installed
• Installing attrs (22.2.0): Skipped for the following reason: Already installed
• Installing discord-py (2.1.0): Skipped for the following reason: Already installed
• Installing async-timeout (4.0.2): Skipped for the following reason: Already installed
• Installing multidict (6.0.4): Skipped for the following reason: Already installed
• Installing yarl (1.8.2): Skipped for the following reason: Already installed
• Installing charset-normalizer (2.1.1): Skipped for the following reason: Already installed
• Installing idna (3.4): Skipped for the following reason: Already installed
• Installing frozenlist (1.3.3): Skipped for the following reason: Already installed
Installing the current project: foo (0.1.0)
ValueError
not enough values to unpack (expected 2, got 1)
at /nix/store/ipjcly953nwlisk5gvay1895zs95k5a2-python3.10-poetry-1.3.0/lib/python3.10/site-packages/poetry/masonry/builders/editable.py:177 in _add_scripts
173│
174│ scripts = entry_points.get("console_scripts", [])
175│ for script in scripts:
176│ name, script = script.split(" = ")
→ 177│ module, callable_ = script.split(":")
178│ callable_holder = callable_.split(".", 1)[0]
179│
180│ script_file = scripts_path.joinpath(name)
181│ self._debug( but I feel like – when the issue is "I typed a |
Is this an issue for Cleo? What I would like to see is an explainer for an unhandled exception along the lines of: Desired:> poetry install
An unexpected error occurred during execution of poetry:
TOMLDecodeError: Cannot overwrite a value (at line 10, column 20)
You can run again with `--verbose` and raise an issue at https://github.com/python-poetry/poetry/issues |
Feature Request
I'm using Poetry 1.1.13.
I've recently gotten some Poetry errors for the first time. When Poetry works, it just works and it's great, but when Poetry has an issue it does not provide any context - at least with the 2 errors I've seen so far. This makes it difficult to understand what the issue is and how to even find the general thing that is causing the issue.
For example, I was getting a "ValueError - not enough values to unpack (expected 2, got 1)" for a script entry that was not complete in pyproject.toml, but Poetry only gives the quoted error statement, without mentioning that it was trying to parse the [tool.poetry.scripts] section of pyproject.toml, or that this was during pyproject.toml parsing at all. Preferrably it would also give the line number where the error occurred.
The other error was attempting to parse a non-semver version that was installed to the venv - again, no context to understand what Poetry was trying to do at the time. Thankfully I had just installed that alternate package, and the version name itself was clear, but I didn't know Poetry could fail just parsing the version of an item that was installed to the venv, that Poetry didn't install itself or was mentioned in pyproject.toml at all as a dependency (I hadn't done anything with it yet), so it was originally quiet stunning to get a message that Poetry could not parse a version when I hadn't changed my pyproject.toml at all.
Request:
Please add more context to the error messages, where possible. We need to at least know what Poetry was doing generally, or what line of which file it was parsing, etc. to be able to decipher what is going on.
Some possibilities:
The text was updated successfully, but these errors were encountered: