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

high-yak-85899

10/25/2022, 7:52 PM
I needed to do something like https://stackoverflow.com/questions/50174130/how-do-i-pytest-a-project-using-pep-420-namespace-packages/50175552#50175552 in my
conftest.py
. Pants doesn't know that
_pytest
comes from the
pytest
package. Where's the most appropriate place to inform that? I could get by with a
# pants: no-infer-dep
, but curious about a more proper fix.
https://github.com/pantsbuild/pants/pull/14604
The pull request first appeared in release_2.11.0.dev2
h

high-yak-85899

10/25/2022, 7:54 PM
The requirement comes from pants internally, though. I tried adding it to the only
python_requirements
I have, but it doesn't pick that up.
b

bitter-ability-32190

10/25/2022, 7:55 PM
oh right, that issue 🙄
You probably wanna add
pytest
to your
requirements.txt
Which has its own issues.
Altenratively, if you aren't using pylint/mypy on the file you can
# pants: no-infer-dep
that line
h

high-yak-85899

10/25/2022, 8:00 PM
yeah, I'll probably just do that for now to keep requirements.txt "clean". Thanks for confirming
oof, actually, it's happening on every usage of
pytest
too. To the requirements we go