Skip to content

Expose UV_PROJECT_ENVIRONMENT as flag to uv sync #20060

Description

@maxmynter

Summary

I've noticed that UV_PROJECT_ENVIRONMENT has no corresponding flag (docs) to specify it via a flag to the command as e.g. uv sync --venv <my_env>.

Is there a reason for it, would you be open to a PR that introduces this and as how involved would you estimate the change?

Perhaps, I could get some time from work to spend on this as we're interested in that feature.

(I made minor contributions to UV about a year ago but may require some handholding).

Context

We're using UV on our slurm clusters usually have a first job that later launches other child or first class jobs. To avoid races on the shared filesystem as well as redundant work, we pre-build the environments of our uv projects running in these jobs. Now we have new nodes with different architectures which sometimes makes using the prebuild envs blow up. We can simply set the environment variable conditionally, but they are propagated to inherting slurm jobs and it would be nicer to also be able to just pass it as a CLI flag.

Maybe there is also a better way to handle x86 / arm mismatches. Happy for pointers if you have ideas.

Cheers and thank you for making Python a better place :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions