average-breakfast-91545
07/19/2025, 6:04 PMpytest
lockfile with pytest plus the various plugins I need. Some of my tests import pytest, which then fails cos pytest is in the pytest lockfile, and not the lock for the code under test. Do I just add my pytest requirements to every lockfile?
Sorry if that's hard to parse 😄happy-kitchen-89482
07/21/2025, 3:28 AMpytest
needs to be in the lockfile for code that imports it, just like any other 3rd party distribution. So the initial thing to do is to have pytest
in the tool lockfile and the code lockfile(s) and keep them in sync. But if you want to get more sophisticated, and avoid that duplication, you can tell Pants to resolve the pytest
tool from a code lockfile: https://www.pantsbuild.org/2.26/docs/python/overview/lockfiles#sharing-lockfiles-between-tools-and-codeaverage-breakfast-91545
07/21/2025, 6:27 AM