uv/crates/uv-virtualenv
chisato 9774f8f1d4
Fix relocatable nushell activation script (#17036)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
Nushell activation now computes the venv root dynamically via path self
for relocatable venvs, while non-relocatable venvs still embed a quoted
absolute path

Still keep `activate.csh` (maybe delete is also an option)

close https://github.com/astral-sh/uv/issues/16973

<!-- How was it tested? -->
2025-12-09 14:39:55 +00:00
..
src Fix relocatable nushell activation script (#17036) 2025-12-09 14:39:55 +00:00
Cargo.toml Bump version to 0.9.16 (#17008) 2025-12-06 07:52:06 -06:00
README.md chore: fix typo in crates/uv-virtualenv/README.md (#16700) 2025-11-12 09:45:37 -06:00

README.md

uv-virtualenv

uv-virtualenv is a rust library to create Python virtual environments. It also has a CLI.

Syncing with upstream virtualenv activation scripts

This crate tries to stay in sync with pypa/virtualenv project's activation scripts. However, there are some deviations that are specific to this crate's implementation.

License disclaimers added

This crate includes license information at the top of each activation script. This is done in accordance with the pypa/virtualenv project's MIT License. Do not remove the declarative license comments from this crate's activation scripts.

Placeholder names are slightly different

Note, these activation scripts are actually templates that are populated with certain values when a virtual environment is created.

In upstream, the placeholder names are found in virtualenv.activation.ViaTemplateActivator.replacements().

In this crate, the placeholder names are found in uv_virtualenv::virtualenv::create()

It is important that the placeholder names (as used in the activation scripts) conform to the placeholders names used in this crate's source.

Relocatable virtual environments

This crate uses some additional tweaks in the activation scripts to ensure the virtual environment is relocatable. Thus, the patch in astral-sh/uv#5640 shall be retained.

TCL/TK library locations

The patches in upstream virtualenv (pypa/virtualenv#2928 and pypa/virtualenv#2940) implement dynamically locating the TCL/TK libraries of a base Python distribution (see upstream approach).

This upstream implementation is considered an undesirable complexity in this project. As such, the upstream TCL/TK related patches shall be omitted when syncing activation scripts with upstream sources.