python-poetry / python-poetry/poetry

Improve Error Messaging for Poetry Scripts when Missing Main Package

Open
#9,011 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

Feature Request

Description

When trying to run a script, users may receive a generic error message about the main package not being found. Sometimes this error message is not entirely related to the problem, as the absence of the main package should not affect the running of unrelated scripts. Additionally, it is misleading because it points users towards an error that is not caused by the script itself.

Current Behavior

When attempting to run a script, users encounter a generic error message about the main package not being found.

Desired Behavior

  1. Improve the error message for missing main packages, as suggested in this issue.
  2. Remove this error message entirely unless the script is related to the main package itself.

Use Case

A user tries to run a script that utilizes Poetry for dependency management. However, the script does not rely on the main package, yet it refuses to run giving a confusing message.

Benefits

  • Enhances user experience by providing clearer error messages.
  • Reduces confusion and frustration among users encountering this issue.
  • Improves the overall usability of Poetry for managing Python projects.

Additional Context

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

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 reading the related issue 9010, then trace the Poetry script execution path that produces the missing-main-package error. The work is complete when unrelated scripts no longer show that error and scripts related to the main package receive the clearer message described by the linked issue; the payload names no files or tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.