feat: Allow `-` in module name discovery
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Feature
Can we allow - in module name discovery in https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules
with a flag allow_all_module_names or something
such that we can do:
For example, say your directory tree consists solely of
src/namespace-pkg/mod.py. If you run the following command, mypy will correctly associate mod.py withnamespace-pkg.mod:
MYPYPATH=src mypy --namespace-packages --explicit-package-bases .
Pitch
This option is needed to circumvent the Duplicate module names. I want to treat everything as a module also if technically the name is not consistent with a python module. Could we make that more agnostic?
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 the module-mapping documentation linked in the issue and reproduce the shown MYPYPATH/mypy command using a namespace-pkg directory. Determine how a flag such as allow_all_module_names should affect hyphenated module names and the Duplicate module names case. Done should include an agreed option behavior and coverage for the documented example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100