Skip to content

Commit ece4af2

Browse files
authored
Recommend uv for virtual environment management (#617)
Resolves #615 - Switches `uv` to recommended / green and `conda` to good / yellow in _Virtual environments_ page. - Changes template README to suggest using `uv` to create a project specific virtual environment and changes `pip` commands to instead be `uv pip`. - I also noticed our language around `docs` dependencies hadn't been updated when we switched to dependency group so this also changes that. - I have currently not changed any of the commands in template README for running tests / building docs to use `uv run` so these would implicitly require project virtual environment to be activated.
1 parent b108629 commit ece4af2

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

docs/pages/virtual.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ layout: default
55

66
## Virtual environments
77

8-
| Name | Short description | 🚦 |
9-
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------: |
10-
| conda-forge [miniforge] | Installs, runs, and updates packages and their dependencies. Uses `conda`, but with community maintained packages from `conda-forge` channel instead of commercially maintained packages. | <span class="label label-green">Best</span> |
11-
| [uv] | Fast dependency (and project) management tool. A drop-in replacement for `venv`. This will probably become our <span class="label label-green">Best</span> tool, but for now we are playing cautious as there are some open bugs and features. If you're comfortable using `venv` syntax we'd recommend this. | <span class="label label-yellow">Good</span> |
12-
| [pipenv] | Automatically creates and manages a virtualenv for your projects. | <span class="label label-yellow">Good</span> |
13-
| [pixi] | A fast drop-in replacement for `conda`. | <span class="label label-yellow">Good</span> |
14-
| [pyenv] | Lets you easily switch between multiple versions of Python. | <span class="label label-yellow">Good</span> |
15-
| [virtualenv] | Creates isolated Python environments, and offers more features than venv. | <span class="label label-yellow">Good</span> |
16-
| [venv] | Creates isolated Python environments. Fewer features than other tools, but very widely used and comes built into Python. | <span class="label label-yellow">Good</span> |
17-
| [anaconda] | Due to recent [licensing ambiguity][anaconda-problems], we recommend avoiding anaconda and many of the default channels. We recommend installing miniforge and sticking to the `conda-forge` channel. | <span class="label label-red">Avoid</span> |
8+
| Name | Short description | 🚦 |
9+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------: |
10+
| [uv] | Fast dependency (and project) management tool. A drop-in replacement for `venv` with additional features including easy management of multiple Python versions. | <span class="label label-green">Best</span> |
11+
| conda-forge [miniforge] | Installs, runs, and updates packages and their dependencies. Uses `conda`, but with community maintained packages from `conda-forge` channel instead of commercially maintained packages. | <span class="label label-yellow">Good</span> |
12+
| [pipenv] | Automatically creates and manages a virtualenv for your projects. | <span class="label label-yellow">Good</span> |
13+
| [pixi] | A fast drop-in replacement for `conda`. | <span class="label label-yellow">Good</span> |
14+
| [pyenv] | Lets you easily switch between multiple versions of Python. | <span class="label label-yellow">Good</span> |
15+
| [virtualenv] | Creates isolated Python environments, and offers more features than venv. | <span class="label label-yellow">Good</span> |
16+
| [venv] | Creates isolated Python environments. Fewer features than other tools, but very widely used and comes built into Python. | <span class="label label-yellow">Good</span> |
17+
| [anaconda] | Due to recent [licensing ambiguity][anaconda-problems], we recommend avoiding anaconda and many of the default channels. We recommend installing miniforge and sticking to the `conda-forge` channel. | <span class="label label-red">Avoid</span> |
1818

1919
<!-- links here for a more readable table -->
2020

tests/data/test_package_generation/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ Centre for Advanced Research Computing, University College London
5757

5858
We recommend installing in a project specific virtual environment created using
5959
a environment management tool such as
60-
[Conda](https://docs.conda.io/projects/conda/en/stable/). To install the latest
61-
development version of `cookiecutter-test` using `pip` in the currently active
60+
[uv](https://docs.astral.sh/uv/). To install the latest
61+
development version of `cookiecutter-test` using `uv pip` in the currently active
6262
environment run
6363

6464
```sh
65-
pip install git+https://github.com/test-user/cookiecutter-test.git
65+
uv pip install git+https://github.com/test-user/cookiecutter-test.git
6666
```
6767

6868
Alternatively create a local clone of the repository with
@@ -74,7 +74,7 @@ git clone https://github.com/test-user/cookiecutter-test.git
7474
and then install in editable mode by running
7575

7676
```sh
77-
pip install -e .
77+
uv pip install -e .
7878
```
7979

8080
### Running Locally
@@ -112,7 +112,7 @@ from the root of the repository. The built documentation will be written to
112112
`site`.
113113

114114
Alternatively to build and preview the documentation locally, in a Python
115-
environment with the optional `docs` dependencies installed, run
115+
environment with the `docs` dependency group installed, run
116116

117117
```sh
118118
mkdocs serve

{{cookiecutter.project_slug}}/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ Centre for Advanced Research Computing, University College London
6363

6464
We recommend installing in a project specific virtual environment created using
6565
a environment management tool such as
66-
[Conda](https://docs.conda.io/projects/conda/en/stable/). To install the latest
67-
development version of `{{cookiecutter.project_slug}}` using `pip` in the currently active
66+
[uv](https://docs.astral.sh/uv/). To install the latest
67+
development version of `{{cookiecutter.project_slug}}` using `uv pip` in the currently active
6868
environment run
6969

7070
```sh
71-
pip install git+{{cookiecutter.__repo_url}}.git
71+
uv pip install git+{{cookiecutter.__repo_url}}.git
7272
```
7373

7474
Alternatively create a local clone of the repository with
@@ -80,7 +80,7 @@ git clone {{cookiecutter.__repo_url}}.git
8080
and then install in editable mode by running
8181

8282
```sh
83-
pip install -e .
83+
uv pip install -e .
8484
```
8585

8686
### Running Locally
@@ -118,7 +118,7 @@ from the root of the repository. The built documentation will be written to
118118
`site`.
119119

120120
Alternatively to build and preview the documentation locally, in a Python
121-
environment with the optional `docs` dependencies installed, run
121+
environment with the `docs` dependency group installed, run
122122

123123
```sh
124124
mkdocs serve

0 commit comments

Comments
 (0)