with -p or -m, error if the package name is not importable
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Feature
When the command line is issued specifying scan targets using -p or -m, verify that a package is importable under that name and fail if not.
Pitch
I was scanning two related packages using:
mypy --namespace_packages -p namesp.pkg1 -p namesp_pkg2
The second was a typo, the folder name for the (namespace) package that was a child of $PWD. I got error messages, but they were very confusing, about a file being found in two locations (where the "same" command line, as I thought, had worked properly just two days before). I didn't figure out it was a typo for quite some time.
But obviously, there is no package namesp_pkg2 and an error to that effect would have saved me some time.
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
Start with mypy's command-line handling for the -p and -m options and reproduce the example with a deliberately misspelled package name. Trace where scan targets are validated, then confirm that an unimportable package produces a direct error instead of confusing duplicate-file diagnostics.
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
- 45/100