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

high-yak-85899

04/29/2022, 7:52 PM
Something that I've noticed that would be cool to avoid if it's possible/there are ideas: Whenever I change anything about
requirements.txt
and generate a new lockfile (not doing it with pants until 2.11 is a stable release), all of my tests that have third party dependencies have to get rerun even if their dependency wasn't the thing that was modified. Obviously this is less frequent than changing first party code, but I'm curious if there's been any talk on if that could ever be improved (or if the improvements that 2.11 brings helps already).
b

bitter-ability-32190

04/29/2022, 7:55 PM
I would assume the 2.11 changes would certainly "fix" this. There's levers/knobs in older pants, but you make tradeoffs that are not fun to make. 2.11 w/ PEX lockfiles makes this breezy with no tradeoffs 😊
w

witty-crayon-22786

04/29/2022, 7:56 PM
that is slightly surprising, as use of a
--pex-repository
should be deterministic. but yea, as @bitter-ability-32190 said, 2.11.x and the PEX lockfile implementation will be the place to focus fixes like that. if it doesn’t already work in 2.11.x, it should definitely be able to.
@high-yak-85899: which pants version are you using?
h

high-yak-85899

04/29/2022, 7:58 PM
2.10.1rc0 to get some fixes that were needed for putting a
python_distribution
in a pex binary
w

witty-crayon-22786

04/29/2022, 7:59 PM
with
--enable-resolves
, or with
--resolve-all-constraints
…?
h

high-yak-85899

04/29/2022, 8:00 PM
Copy code
[python]
interpreter_constraints = ["CPython>=3.8,<3.9"]
enable_resolves = true
resolves_generate_lockfiles = false
resolves = { python-default = "constraints.txt" }
w

witty-crayon-22786

04/29/2022, 8:23 PM
interesting. i’ll open a ticket about validating that subsetting is deterministic with PEX lockfiles in 2.11.x at least… will mention checking out this case as well though.
h

high-yak-85899

04/29/2022, 8:24 PM
Cool! Thanks
w

witty-crayon-22786

04/29/2022, 8:27 PM
although, actually: one thing to confirm here: when you diff the lockfiles, you’re certain that none of the transitive deps of the relevant tests have changed?
h

high-yak-85899

04/29/2022, 8:29 PM
Yup. In this particular case, I added
dohq-artifactory
to
requirements.txt
which I'm certain is only used by a new client module I added that nothing yet depends on. When I generate
constraints.txt
, I only see
dohq-artifactory
and
pyjwt
added (which was only needed by
dohq-artifactory
as reported in the comments of the file). Yet invoking
./pants test ::
seems to have triggered revealed a bunch of cache invalidation.
w

witty-crayon-22786

04/29/2022, 8:30 PM
it will still have to generate a bunch of subset PEXes, but it shouldn’t actually have to run tests (see comment on the ticket re: “early cutoff”)
k, thanks: will look.
2 Views