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
Thank you for creating this amazing tool! We are in the process of switching from pip-tools to uv and have encountered a situation we’re unsure how to resolve.
Use Case
We have a Python project with the following setup:
We install dependencies (excluding dev dependencies) in Docker.
We use Docker Compose to mount the site-packages directory to the host machine.
On the host machine, we create a virtual environment (venv).
Dev dependencies are installed only in this virtual environment.
We link the production dependencies (mounted via Docker) to the venv using the following script:
This setup works well with pip and pip-compile, allowing us to maintain a development environment close to production, with full IDE compatibility.
Challenge with uv
We’d like to transition to pyproject.toml + uv.lock for dependency management.
Steps 1-3 remain the same when using uv. However, we encounter difficulties with step 4, where we need to install only dev dependencies into the virtual environment.
The issue is that:
uv sync installs both production and dev dependencies.
uv pip install doesn't respect the pinned dependencies from the lock file.
We’ve considered using the following workaround:
uv export --format requirements-txt followed by uv pip install <exported-requirements>, but there doesn’t seem to be an option to export only dev dependencies as well (this could be resolved somehow by combination of uv export ... - uv export --no-dev ... outputs, but that is very far from a neat solution.
Conclusion
There may be a better way to handle this setup with uv where project dependencies are mounted over Docker (feel free to suggest them), but at the moment we are missing a way to install only dev dependencies without affecting the linked site-packages.
The obvious solution is to add an option something like uv sync --only-dev + also uv export --only-dev ....
Any guidance or suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
Hi,
Thank you for creating this amazing tool! We are in the process of switching from
pip-tools
touv
and have encountered a situation we’re unsure how to resolve.Use Case
We have a Python project with the following setup:
We install dependencies (excluding dev dependencies) in Docker.
We use Docker Compose to mount the
site-packages
directory to the host machine.On the host machine, we create a virtual environment (
venv
).Dev dependencies are installed only in this virtual environment.
We link the production dependencies (mounted via Docker) to the
venv
using the following script:This setup works well with
pip
andpip-compile
, allowing us to maintain a development environment close to production, with full IDE compatibility.Challenge with uv
We’d like to transition to
pyproject.toml
+uv.lock
for dependency management.Steps 1-3 remain the same when using
uv
. However, we encounter difficulties with step 4, where we need to install only dev dependencies into the virtual environment.The issue is that:
uv sync
installs both production and dev dependencies.uv pip install
doesn't respect the pinned dependencies from the lock file.We’ve considered using the following workaround:
uv export --format requirements-txt
followed byuv pip install <exported-requirements>
, but there doesn’t seem to be an option to export only dev dependencies as well (this could be resolved somehow by combination ofuv export ...
-uv export --no-dev ...
outputs, but that is very far from a neat solution.Conclusion
There may be a better way to handle this setup with
uv
where project dependencies are mounted over Docker (feel free to suggest them), but at the moment we are missing a way to install only dev dependencies without affecting the linked site-packages.The obvious solution is to add an option something like
uv sync --only-dev
+ alsouv export --only-dev ...
.Any guidance or suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered: