pex-tool / pex

A tool for generating .pex (Python EXecutable) files, lock files and venvs.
https://docs.pex-tool.org/
Apache License 2.0
2.5k stars 257 forks source link

Implement more permissive `pex3 lock sync` locked resolve selection in multi-resolve locks. #2386

Open jsirois opened 4 months ago

jsirois commented 4 months ago

Unlike a pex3 lock update, a pex3 lock sync can update any characteristic of an existing lock; not just individual top-level requirements. As such, changing options that affect accepted artifact types, like syncing from a --style universal lock that admits sdists to a --style universal --no-build that does not or changing --interpreter-constraints when syncing a lock that contains platform-specific artifacts, requires ignoring existing artifacts when selecting which locked resolve to sync using which target. Currently a full subset match is required which includes matching a compatible artifact and this leads to a failure to sync locks with multiple locked resolves and platform specific artifacts when settings are changed that shift the artifacts that are acceptable in the new lock. Instead of using a subset operation to select locked resolves, pex3 lock sync should use a softer match that ignores artifacts and just looks at requires_python and individual requirement environment markers when determining compatibility with a target.