Skip to content

Make a genuinely relocatable variant of --relocatable (i.e. fix or remove activate.csh/nu) #16973

@amluto

Description

@amluto

Summary

Right now, uv venv --relocatable hardcodes the venv path in bin/activate.csh and bin/activate.nu. I'm trying to use uv to build a deployable artifact for a Python application (not for outside distribution -- wheels are fine for this; I want to deploy it to my own prod system).

Prior to using uv, I worked fairly hard to avoid leaking the working directory into the build. Right now, I have:

uv venv --relocatable "$dist_path"
# uv venv --relocatable will create two non-relocatable files.  We don't need them.
rm -- "$dist_path/bin/activate.csh" "$dist_path/bin/activate.nu"

which is rather sad. Would uv consider either finding a way to fix up activate.csh and activate.nu or having a variant of --relocatable that means "make it genuinely fully relocatable" and omits the offending files?

See also #6970. uv is so close to being a fantastic tool for deploying Python code.

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionalityhelp wantedContribution especially encouraged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions