Hi all! Thanks for all the great work you put in, ...
# general
f
Hi all! Thanks for all the great work you put in, I really enjoy using pants 😁 I am developing a few pypi packages with support for both pydantic v1 & v2. I am using a
python_distribution
target and wanted to know if you have any good ways of “relaxing” a requirement for the wheel (in my case:
pydantic>=1.10.2,<3
? I was using one resolve
python-default
with
pydantic==2.1.1
And another resolve
pydantic-v1
with
pydantic==1.10.2
Then to relax the dependency in the
python_distribution
I first tried to add a resolve in this commit and set an explicit dependency:
f"//3rdparty:pydantic_v1_or_later"
and explicitly ignore the
f"!!//3rdparty:pydantic_v2"
dependency. As I felt having a separate resolve was a bit “overkill” I ended up removing the extra resolve and relaxing the pydantic requirement in the `python-default` resolve This worked, but I would like to know if there is a “better-way” 😅? e.g., some argument to
python_distribution(override_requirements=["pydantic>=1.10.2,<3"])
instead of changing the resolve requirements