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

high-magician-46188

02/06/2023, 2:27 PM
Hi, Is there a command I can run that tells me whether or not the lock file is synced with the reqs and constraints? To clarify, I'm not asking if packages could be pinned to a newer version in the lockfile. Instead, I'd like to know if that lockfile is still valid. For example, if I have a constraint for
pytest<=1.0.0
and the lockfile has
pytest==1.0.0
, than I consider the lockfile valid. However, if I then change the constraint to
pytest>1.0.0
, then the lockfile is no longer valid and needs to be re-generated. Also, please feel free to LMK if I'm wrong about the terminology.
d

dazzling-elephant-33766

02/06/2023, 2:35 PM
Won’t you just run into an
InvalidLockfileError
when you attempt to run a target that depends on the dep in question? I’m not sure there’s a specific check that can be ran independently
☝️ 1
h

high-magician-46188

02/06/2023, 3:42 PM
I'm still in the process of integrating Pants into our flow and, unfortunately, the process will take a few more months. In the meantime, people push new commits that might make this lockfile invalid without it being flagged in CI.
h

happy-kitchen-89482

02/06/2023, 4:38 PM
Interesting, I think it would be straightforward to add a
--check
option to
generate-lockfiles
that just validates but does not regenerate.
Can you open a ticket?
h

high-magician-46188

02/06/2023, 5:31 PM
I will
h

happy-kitchen-89482

02/06/2023, 7:03 PM
Thanks!
5 Views