Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more control over the locking timestamp used #10

Open
ncoghlan opened this issue Sep 9, 2024 · 1 comment
Open

Allow more control over the locking timestamp used #10

ncoghlan opened this issue Sep 9, 2024 · 1 comment
Labels
Affects: Command Line Affects the command line interface Affects: Python API Affects the public Python API of the project Category: Enhancement New feature or request

Comments

@ncoghlan
Copy link
Collaborator

ncoghlan commented Sep 9, 2024

Lock timestamps are recorded via a dedicated metadata file stored alongside each requirements file generated with uv pip compile. This timestamp is then used in the generated artifact metadata (and to set the upper limit on file timestamps in the generated archives).

In combination with the --exclude-newer feature in uv pip compile, this approach to recording the lock timestamps means it is possible to specify a lock time that is earlier than the current time when that particular environment is locked.

API and CLI options to select between the following two modes should be provided:

  1. Specific time lock: a single timestamp is used for every environment lock (defaulting to the current time when the locking process starts)
  2. Platform sync lock: for each environment, every platform is locked to the highest timestamp recorded across the platform-specific lock metadata files for that environment

The existing "record the actual locking time" behaviour does NOT need to be retained (since it's a strictly worse alternative to the behaviour where every lock timestamp is set to the current time immediately before the locking process starts).

@ncoghlan ncoghlan added the Category: Enhancement New feature or request label Sep 10, 2024
@ncoghlan
Copy link
Collaborator Author

ncoghlan commented Sep 24, 2024

The current workaround for the lack of this feature is setting UV_EXCLUDE_NEWER in the calling environment. The downside of that approach is it means the locked_at metadata for each environment isn't correct (as the real locked_at time will be earlier than the nominal locked_at time, and the real locked_at time isn't recorded anywhere in the metadata for built archives or exported environments).

@ncoghlan ncoghlan transferred this issue from another repository Oct 18, 2024
@ncoghlan ncoghlan added Affects: Python API Affects the public Python API of the project Affects: Command Line Affects the command line interface labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Command Line Affects the command line interface Affects: Python API Affects the public Python API of the project Category: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant