python-poetry / python-poetry/poetry

Dots in dependencies can cause confusing errors

Open
#1,846 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/error-handling
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

If I try to add a dependency with a name like zope.sqlalchemy and make a mistake of not quoting the name, I get a confusing exception:

[KeyError]
'version'

(that's because the constraint is {'sqlalchemy': '*'})

I know the definition is a mistake, but maybe a better handling of this exception could be possible - with a suggestion of what the problem is.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the dependency definition using an unquoted name such as zope.sqlalchemy and observe the resulting KeyError: 'version'. Trace the dependency parsing and error-handling entry point, then make the diagnostic explain the malformed constraint and suggest quoting the dependency name; done means this case no longer reports only the confusing KeyError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.