MYPYPATH should override mypy_path in config file (not extend it)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Feature
The MYPYPATH environment variable should override the mypy_path config file option (not extend it).
Pitch
I propose the ability to override the mypy_path config file option with the the MYPYPATH environment variable. To make Visual Studio Code work with the Mypy extension for namespace packages, it is necessary to set mypy_path and explicit_package_bases, whereas I would like to disable the mypy_path option when running Tox (to typecheck the installed package). It is usually the case that environment variables have higher precedence over config file options, and this change would make Mypy consistent with the expected behavior.
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 by locating mypy's configuration parsing and the existing MYPYPATH and mypy_path handling, then find tests covering configuration precedence or environment variables. Confirm the current behavior before changing it. Done means MYPYPATH replaces the config-file mypy_path value, while the existing behavior and related options remain covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100