Skip to content

Conversation

@henryiii
Copy link
Collaborator

@henryiii henryiii commented May 18, 2025

Description

This restructures the venv creation support. You can now run multiple times safely with different interpreters by adding --fresh. Before:

cmake --preset venv -DPYBIND11_CREATE_WITH_UV:PATH=~/.pyenv/versions/3.14.0b1t/bin/python
cmake --build --preset venv --target cpptest

rm -rf build .venv  # <-- Bug to forget this!
cmake --preset venv -DPYBIND11_CREATE_WITH_UV=3.13t
cmake --build --preset venv --target cpptest

After:

cmake --preset venv -DPYBIND11_CREATE_WITH_UV:PATH=~/.pyenv/versions/3.14.0b1t/bin/python
cmake --build --preset venv --target cpptest

cmake --preset venv -DPYBIND11_CREATE_WITH_UV=3.13t --fresh
cmake --build --preset venv --target cpptest

It also doesn't interfere with a developer .venv.

Maybe this should be in a distinct folder now, to keep default and venv from interfering?

Suggested changelog entry:

  • Restucture venv support to support --fresh, make in build folder

Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii merged commit cc86e8b into pybind:master May 19, 2025
67 checks passed
@henryiii henryiii deleted the henryiii/chore/cmakefresh branch May 19, 2025 01:12
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label May 19, 2025
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant