-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Implement monorepo-friendly mypy.ini discovery rule #16070
Labels
Comments
Could the priority on this be bumped please, we have a pressing need for mypy to play a little nicer with monorepos. Currently, I am unsure as to why mypy cannot follow the same rules as Python ... could someone explain to me why this is not possible? |
+1 |
hauntsaninja
added a commit
that referenced
this issue
Jan 20, 2025
wesleywright
pushed a commit
that referenced
this issue
Jan 22, 2025
x612skm
pushed a commit
to x612skm/mypy-dev
that referenced
this issue
Feb 24, 2025
Follow up to python#16965 Fixes python#16070 Handles other mypy configuration files and handles precedence between them. Also fixes few small things, like use in git worktrees
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature
Enhance mypy's
mypy.ini
discovery rules to look in ancestor directories, in the same way thatruff
looks for itsruff.toml
file.Pitch
Let's say I'm working in a monorepo, where subpackages live next to each other in a file system layout similar to this:
When I
cd libs/subpackageA
to do development work in justsubpackageA
, I would like for my type checking to be driven by a commonmypy.ini
file, at the top level of my repo. However, mypy won't walk up the filesystem to discover themypy.ini
file at the top-level. Contrast that with ruff's discovery rules which do walk up the filesystem until it finds aruff.toml
file.There are workarounds: 1) symlink the subprojects's
mypy.ini
to the root levelmypy.ini
; 2) copy the samemypy.ini
file into each subpackage directory. Neither option is all that great. A rule similar to ruff's would let me eliminate the symlinks and move themypy.ini
file to the root of my repo, so that its settings can be easily shared across all subpackages in my monorepo.The text was updated successfully, but these errors were encountered: