Hi, I am having trouble getting mypy to use a reso...
# general
p
Hi, I am having trouble getting mypy to use a resolve; I have generated a resolve lockfile, but when I try to use it:
Copy code
[python]
interpreter_constraints = ["CPython>=3.11"]
enable_resolves = true

[python.resolves]
python-default = "3rdparty/python/default.lock"
mypy-resolve = "3rdparty/python/mypy.lock"

[mypy]
install_from_resolve = "mypy-resolve"
requirements =["//3rdparty/python:mypy#mypy"]
I get this error:
Copy code
11:54:27.07 [ERROR] Invalid option 'install_from_resolve' under [mypy] in /home/kuza/dev/espresso/pants.toml
11:54:27.07 [ERROR] Invalid option 'requirements' under [mypy] in /home/kuza/dev/espresso/pants.toml
b
had the same issue, I added mypy as dev dependency to python-default in the end and used that resolve
p
can you explain your solution a bit more (or point to the config)? I'm not sure exactly what adding a dev dependency means
b
we use poetry to define dependencies, you can define dev-only dependencies (i.e. that are not included in the distributed package)
setuptools have a similar concept AFAIK but haven't tried that one
the main point is to add mypy and related dependencies to the python-default resolve and use that one
p
I see, I guess I am not super clear how the python-default resolve is generated, but I will see if adding a mypy dep explicitly of the version I want works
b
I think you can define a requirements.txt, a python_requirement to own it and in the latter you specify your resolve
p
So I think the reason for this is that install_from_resolve was added in 2.16 and I was running 2.15
👆 1
b
very possible 😀
h
Yes, "Invalid option" means the Pants version you're running doesn't recognize the option name at all, regardless of its value.
If it does recognize the option but the value is invalid you'd get a different, more specific, error