https://pantsbuild.org/ logo
#general
Title
# general
a

adamant-magazine-16751

03/31/2023, 12:06 PM
Hi, I'd appreciate some help on how to handle requirements that are implicitly present when running certain targets, but I still need to import them in code. In particular I mean importing
pytest
in files that belong to
python_tests
. It's there when running
./pants test
and works fine, but it's rightfully not recognized by the IDE when using the env from
./pants export
How should I approach this? Should I add
pytest
to
requirements
? If so, is there a way to keep the versions synchronized?
b

broad-processor-92400

03/31/2023, 8:25 PM
Yeah, we’ve got it in requirements and that works well. Unfortunately “manually” is the only way to keep them synced for now… I think 2.16 or 2.17 resolves that situation by allowing pants to just use the one from requirements instead of trying to have its own.
a

adamant-magazine-16751

03/31/2023, 9:07 PM
Thanks! That's what I'll do then. Also, that sounds like a nice quality of life improvement. Can't wait to see that 🙂
👍 1
2 Views