I tend to keep up on Pip changes via whatever John...
# development
w
I tend to keep up on Pip changes via whatever John is cooking up on pex. This latest seems like it could be helpful https://pip.pypa.io/en/stable/news/#v25-3 Looks like dry-run is actually a dry run now
This upcoming one (and maybe the previous couple, where something similar sorta happens) might help with lockfile generation?
I haven't dug through lockfile generation in depth enough to speak coherently about it, though
p
pip_version = latest
has some gotchas. It means "use the latest version registered in pex, but if that's not compatible with the interpreter constraints, fall back to the oldest compatible version of pip, which is often the vendored version of pip". There's also a
pip_version = latest_compatible
but that is only a partial fix. The information about interpreter_constraints is not available when pex is bootstrapping (which includes selecting the pip version), so
latest_compatible
provides a partial work around by checking for the latest version that is compatible with the version of python that is currently running pex. If that version of python happens to be a version outside the range of
interpreter_constraints
, then it will, again, fall back to the the oldest compatible version of pip, which is often the vendored version of pip. So, both
pip_version = latest
and
pip_version = latest_compatible
adjust the logic during pex bootstrap, but they do NOT impact the fallback version used once pex reexecs with a python interpreter that matches the requested interpreter constraints. I looked at adding a
fallback_to_latest_compatible
option, but I did not want to spend time figuring out how to test that, so I have abandoned it (anyone is welcome to pick it up and polish it into something John would accept) .https://github.com/pex-tool/pex/compare/main...cognifloyd:pex:lock-with-latest-compatible-pip
w
Ahhh, interesting. Thanks for the extra info!
p
edit: I just clarified the fallback logic in my comment. The fallback version is the oldest compatible version of pip, and when falling back pex tries the vendored version of pip first, so that is often the version used