Skip to content

Commit 51d08a0

Browse files
committed
solutions proposés pour differentes versions python
1 parent ddbe761 commit 51d08a0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/source/config_file.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)