You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/README.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,15 +55,22 @@ See [documentation](https://rstudio.github.io/renv/) if you need to tweak the R
55
55
56
56
#### Python
57
57
58
-
We use [**pipenv**](https://pipenv.pypa.io/en/latest/) to manage dependencies and recreate easily on all OS. `pipenv` will be installed as part of the configuration if not already.
59
-
A virtual environment will be created locally in `.venv` folder (ignored on git) and activated when running tests. `pipenv run` and `pipenv shell` can help activating the environment outside of running tests.
58
+
We now use [**uv**](https://docs.astral.sh/uv) (previously, it was [**pipenv**](https://pipenv.pypa.io/en/latest/)) to manage dependencies and recreate easily on all OS. `uv` will **not** be installed as part of the configuration - so it needs to be installed manually - see various way at: https://docs.astral.sh/uv/getting-started/installation/
60
59
61
-
`Pipfile` contains our requirement for the tests project. It can be manually updated but it is best to just use `pipenv` commands. For instance, adding a new dependency can be done with `pipenv install plotly` and it will update the file.
62
-
It will also update the `Pipfile.lock` - this file should never be updated manually.
60
+
**uv** will handle the python versions, including its installation, based on the `.python-version` we have in `tests/` folder. It will also manage the virtual environment in `.venv` folder.
63
61
64
-
See other [`pipenv` command](https://pipenv.pypa.io/en/latest/#basic-commands-and-concepts) if you need to tweak the python environment.
62
+
A virtual environment will be created locally in `.venv` folder (ignored on git) and activated when running tests. `uv run` can help activating the environment outside of running tests to run a command in the environment.
65
63
66
-
For a change of python versionn, `pipenv --rm` will need to be called so that the current virtual environment is removed and a new one is created with the new python version when running `pipenv install` inside `configure-test-env` script.
64
+
`pyproject.toml` contains our dependencies requirement for the tests project. It can be manually updated but it is best to just use `uv` commands. For instance, adding a new dependency can be done with `uv add plotly` and it will update the file, update the `uv.lock` and install in the virtual environment. `uv.lock` should never be updated manually, and it is tracked by git, as it allows to recreate the exact environment on different environment (Linux, Mac, Windows, locally and on CI).
65
+
66
+
See other [`uv` command](https://docs.astral.sh/uv/getting-started/features/) if you need to do more.
67
+
68
+
For a change of python versionn, `.python-version` needs to be updated, and then `uv` will take care of the rest. `configure-test-env` script will check for `uv` and if installed, it will called `uv sync` to make sure the project virtual environment is up to date with the lockfile.
69
+
70
+
Note that `./run-test.ps1` and `.run-tests.sh` :
71
+
72
+
- run `configure-test-env` script by default, unless `QUARTO_TESTS_NO_CONFIG` environment variable is set to a non-empty value.
73
+
- Activate the local virtualenv espected in `.venv`. Set `QUARTO_TESTS_FORCE_NO_VENV` to a non-empty value to prevent this behavior. (It replaces `QUARTO_TESTS_FORCE_NO_PIPENV` which still is considered for backward compatibility but deprecated)
0 commit comments