From df01103782670cb093c8c012f4fd077d9e18246c Mon Sep 17 00:00:00 2001 From: Josh Thomas Date: Mon, 5 Aug 2024 10:38:44 -0400 Subject: [PATCH] switch back to `uv pip install` (#281) --- CHANGELOG.md | 1 + src/django_twc_project/.just/documentation.just | 2 +- src/django_twc_project/.just/python.just.jinja | 2 +- src/django_twc_project/pyproject.toml.jinja | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9137ed3..6b326fdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Add `--constraint requirements.txt` to the compiling of the two extra requirements files, to constrain the dependencies to the versions specified in the primary requirements file. +- Switch back from `uv pip sync` to `uv pip install` for dependency installation. `uv pip sync` itself is quite strict, only installing exactly what's specified in a given requirements file. This is fine, except if something like `pip` is installed in the virtual environment but not listed as a dependency, it will gladly uninstall it from the venv. I get why they do this, but it makes no sense for local installations to clobber any packages that may already be installed in the venv. In the future, we may consider using `uv pip sync` in environments where it makes sense to allow this behavior, e.g. in the `Dockerfile` or CI. ## [2024.43] diff --git a/src/django_twc_project/.just/documentation.just b/src/django_twc_project/.just/documentation.just index 7727ef77..4d399f2c 100644 --- a/src/django_twc_project/.just/documentation.just +++ b/src/django_twc_project/.just/documentation.just @@ -16,7 +16,7 @@ build LOCATION="docs/_build/html": cog # Install documentation dependencies [no-cd] install *ARGS: - $python -m uv pip sync {{ ARGS }} docs/requirements.txt + $python -m uv pip install {{ ARGS }} docs/requirements.txt # Generate documentation requirements [no-cd] diff --git a/src/django_twc_project/.just/python.just.jinja b/src/django_twc_project/.just/python.just.jinja index 54ea25ef..b181716b 100644 --- a/src/django_twc_project/.just/python.just.jinja +++ b/src/django_twc_project/.just/python.just.jinja @@ -31,7 +31,7 @@ coverage-report: test # Install dependencies [no-cd] install *ARGS: - $python -m uv pip sync {% raw %}{{ ARGS }}{% endraw %} requirements.txt requirements.dev.txt + $python -m uv pip install {% raw %}{{ ARGS }}{% endraw %} requirements.txt requirements.dev.txt # Generate requirements.txt file [no-cd] diff --git a/src/django_twc_project/pyproject.toml.jinja b/src/django_twc_project/pyproject.toml.jinja index d99de0e9..d18c88c4 100644 --- a/src/django_twc_project/pyproject.toml.jinja +++ b/src/django_twc_project/pyproject.toml.jinja @@ -68,7 +68,6 @@ dev = [ "ipython", "model_bakery", "mypy", - "pip", "playwright=={{ playwright_version }}", "pre-commit", "pytest",