File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -447,6 +447,33 @@ Platform configuration
447447 invocation of mypy cannot type-check different parts of a monorepo using
448448 different Python versions.
449449
450+ If your project contains directories or packages that target different
451+ Python versions, you can use one of the following workarounds:
452+
453+ * **Run mypy multiple times **, selecting a different version for each
454+ directory.
455+
456+ Example::
457+
458+ mypy --python-version=3.9 src/py39_package
459+ mypy --python-version=3.11 backend/py311
460+
461+ * **Use separate configuration files **, each specifying its own
462+ ``python_version ``.
463+
464+ Example::
465+
466+ mypy --config-file=mypy_py39.ini src/py39_package
467+ mypy --config-file=mypy_py311.ini backend/
468+
469+ * **Use an external build/monorepo tool ** (such as Pants, Bazel, or a CI
470+ pipeline) to orchestrate multiple mypy invocations automatically.
471+
472+ This documentation update clarifies the current limitation and addresses
473+ :issue: `16944 `.
474+
475+
476+
450477.. confval :: platform
451478
452479 :type: string
You can’t perform that action at this time.
0 commit comments