Hey :wave: , I have a question about probably an e...
# general
r
Hey 👋 , I have a question about probably an edge case, if you have
pytest
as a dependency in your
requirements.txt
and you import
pytest
in your test files or
conftest.py
so it is discovered by dependency inference, what pytest distribution is used for the tests ? the global defined in
pants.toml
or the one in the user defined lock file ? I know It's confusing adding
pytest
as a dependency, but the main use case is for IDE support, ie: when running
./pants export //:poetry
, I'd like to have
black
,
isort
,
pytest
, ... exported too
h
It will use the version in requirements.txt I believe
@hundreds-father-404 can confirm
the version in pants.toml is for "pytest as a tool that pants invokes", the version in requirements.txt is for "pytest as a dependency"
It would be good to be able to sync those two automatically, I think there's a todo for that
r
ex: in a
python_test
use pytest as a tool in a
python_source
use pytest as a dep ?
h
https://github.com/pantsbuild/pants/issues/12449. Not at all weird, it makes sense to do this - it's a shame Pants does not support this better
It will use the version in requirements.txt I believe
It will install Pytest twice (bleh), then I can't quite remember how Pex handles merging the two PEXes when there's the same dep. I want to say it goes with the first one encountered..
h
@rapid-crayon-8232 can you open a ticket for the exporting-a-tool-for-use-by-IDE case? cc @acoustic-librarian-3937
👍 2
r