Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add packages and modules keys to config file format #9883

Closed
trws opened this issue Jan 6, 2021 · 1 comment
Closed

Add packages and modules keys to config file format #9883

trws opened this issue Jan 6, 2021 · 1 comment
Labels
feature topic-configuration Configuration files and flags

Comments

@trws
Copy link
Contributor

trws commented Jan 6, 2021

Feature

Offer configuration variables for packages and modules to match the command-line flags, much like files matches listing files on the command line. Intended to work exactly like the command line flags, with the exception that they would not override a files key and having files and either of the new keys in the same config file would create a conflict.

Usage meant to be something like this (actual code this would work with linked below):

[mypy]
python_version = 3.7
packages=spack,builtin.packages,builtin_mock.packages
mypy_path=bin,lib/spack,lib/spack/external,var/spack/repos/builtin

To match a command line like mypy -p spack -p builtin.packages -p builtin_mock.packages

Pitch

The main use comes from, spack, a project I'm adding type checking to. It's a package manager where the libraries, tool and all package definition files are written in python. Having mypy check the library without arguments is simple, I can just write a files key that covers all files and it will work fine, but the packages are in a structure like this:

./var/spack/repos/
├── builtin
│   ├── packages
│   │   ├── 3proxy
│   │   │   └── package.py
│   │   ├── abduco
│   │   │   └── package.py
│   │   ├── abi-compliance-checker
│   │   │   └── package.py
... etc.

If I use a files key for these, they are all treated as duplicate package modules, and mypy errors out (probably appropriately). They can however be treated as a package, and mypy works quite well on the library and the whole package tree in that mode (especially after the recursive checking fixes). The trick now is that I can't make running mypy check the packages tree without arguments or wrapping or similar.

I'd like to add support for specifying these in the configuration file to bring them up to the same level of support as listing files, as mentioned in PR #9834.

@hauntsaninja
Copy link
Collaborator

Fixed by #13404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-configuration Configuration files and flags
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants