Something that I've noticed that would be cool to ...
# general
h
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
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
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
2.10.1rc0 to get some fixes that were needed for putting a
python_distribution
in a pex binary
w
with
--enable-resolves
, or with
--resolve-all-constraints
…?
h
Copy code
[python]
interpreter_constraints = ["CPython>=3.8,<3.9"]
enable_resolves = true
resolves_generate_lockfiles = false
resolves = { python-default = "constraints.txt" }
w
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
Cool! Thanks
w
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
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
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.