python-poetry / python-poetry/poetry
Improvement: Enhance Error Message for Main Package Not Found
Nobody has claimed this yet.
- 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 FAQ and general documentation and believe that my question is not already covered.
Description
Replace the generic error message "No file/folder found for package" with a more descriptive message that better explains the issue and how to resolve it.
Current Behavior
Currently, when encountering issues related to the main package in Poetry scripts, users receive a generic error message that may not be entirely relevant or descriptive enough to help them understand the problem.
Desired Behavior
I propose replacing the generic error message with one that specifically addresses the problem, or at least provides clearer guidance on how to troubleshoot and resolve it.
Use Case
As a user of Poetry, when encountering errors related to the main package in scripts, I want to receive informative error messages that help me quickly identify and fix the issue, rather than having to spend time deciphering vague messages or starting from scratch.
Benefits
- Improved user experience: Clearer error messages will reduce frustration and confusion for users encountering issues with their main package.
- Faster troubleshooting: Users will spend less time trying to understand the problem and more time resolving it, leading to quicker resolution of issues.
Possible Implementation
Replace the current error message with one similar to the following:
"Main package was not found. Poetry assumes your package contains a folder with the same name as [tool.poetry.name] located in the root of your project. If this is not the case, populate [tool.poetry.packages] to specify your packages and their locations. Check https://python-poetry.org/docs/basic-usage/ for more info."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name a source file, test, or entry point. Start by locating the generic "No file/folder found for package" message in Poetry's package-handling code, then inspect related tests and update the expected error wording and guidance. Done means the main-package failure provides actionable information and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100