rhythmic-morning-87313
01/05/2025, 7:24 AMmypy
(pants check ::
to include both the main codebase and the pants-plugins) against the pants-plugins target, it breaks up with:
Dependency on tomli (via: mypy==1.14.1 -> tomli>=1.1.0; python_version < "3.11") not satisfied, no candidates found.
Pants seems to try make an isolated pex environment for Python 3.9 (pants-plugins) with the mypy
resolve locks generated for Python 3.12 (main codebase).
How could I resolve this issue? For instance, could I have two lock files for a single resolve targetting different Python interpreter versions?rhythmic-morning-87313
01/05/2025, 7:34 AMrhythmic-morning-87313
01/05/2025, 8:59 AMtomli
to the mypy's own requirements and lock (regardless of the target Python version), and also added explicit interpreter_constraints = ["==3.9.*", "==3.12.*"]
to pants.toml's [mypy]
section. It no longer says the above error, but just hangs while creating a mypy pex environment:rhythmic-morning-87313
01/05/2025, 9:02 AMrhythmic-morning-87313
01/05/2025, 9:37 AM[resolves_to_interpreter_constraints]
→ mypy = ["==3.9.*", "==3.12.*"]
(making the lockfile to have both 3.9/3.12 dependencies)
• [mypy]
→ interpreter_constraints = ["==3.9.*", "==3.12.*"]
(allows having two different interpreters)rhythmic-morning-87313
01/05/2025, 9:38 AMrhythmic-morning-87313
01/05/2025, 9:44 AMpants export --resolve=mypy
only creates the venv for Python 3.9.... T_Trhythmic-morning-87313
01/05/2025, 9:44 AMrhythmic-morning-87313
01/05/2025, 9:52 AM[mypy] interpreter_constraints = ...
but keeping [resolves_to_interpreter_constraints] mypy = ...
resolves the Python version issue when checking the main codebase partition. ;;;rhythmic-morning-87313
01/05/2025, 9:54 AMpants export --resolve=mypy
only creates venv for 3.9... (the interim progress message says that it's running for ==3.9.* OR == 3.12.*
)rhythmic-morning-87313
01/05/2025, 9:54 AMrhythmic-morning-87313
01/07/2025, 3:13 PMrhythmic-morning-87313
01/07/2025, 3:14 PMrhythmic-morning-87313
01/07/2025, 3:17 PMrhythmic-morning-87313
01/07/2025, 3:17 PMrhythmic-morning-87313
01/07/2025, 3:17 PMrhythmic-morning-87313
01/08/2025, 2:06 AMrich-london-74860
02/15/2025, 8:55 AM[mypy].install_from_resolve = “mypy”
and [mypy].requirements = [“tomli”]
?rich-london-74860
02/15/2025, 8:57 AM