Can somebody give me a hint on how to generate a p...
# general
s
Can somebody give me a hint on how to generate a pytest lockfile with specific versions of dependencies? We’re using some plugins for pytest & django (i.e.
pytest-django
) which are loaded when pytest starts. When I generate a lockfile using
./pants generate-lockfile
I get
pytest-django==3.10.0
but
pytest-django==4.1.0
is what I need and what is written in our
requirements-dev.txt
actually 🤔
1
b
s
Thank you, I guess so 🤔 do you mean
extra_requirements
for the
pants.toml
is the correct place?
1
r
There are 2 ways to have what you want: • in
pants.toml
add the extra requirements you want for pytest:
Copy code
[pytest]
version = "pytest>=7.0,<8.0"
args = ["-ra -q -vv --no-header"]
extra_requirements.add = ["pytest-icdiff", "pygments", "pytest-django==4.10.0"]
lockfile = "monorepo/build-support/lockfiles/pytest.txt"
• or simply add
pytest-django
(added in
requirements.txt
) as a dependency to you
python_test
target
s
Thanks you two, I tried the latter which didn’t work. That’s why I was asking. Thanks! 🙏
It works, awesome! 🙌
Thanks again @rapid-crayon-8232 & @bitter-ability-32190
🙌 1