-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile with a workspace project #6867
Comments
Have you seen |
Actually I have, and I may be failing to understand what $ uv sync --frozen --no-install-workspace
Using Python 3.8.12
Creating virtualenv at: .venv
Audited in 0.00ms
$ ls -a .venv/lib/python3.8/site-packages
_virtualenv.pth _virtualenv.py However when I replace $ uv sync --locked --no-install-workspace
Resolved 16 packages in 2ms
Prepared 12 packages in 0.79ms
Installed 12 packages in 19ms
+ anyio==4.4.0
+ certifi==2024.8.30
+ charset-normalizer==3.3.2
+ exceptiongroup==1.2.2
+ h11==0.14.0
+ httpcore==1.0.5
+ httpx==0.27.2
+ idna==3.8
+ requests==2.32.3
+ sniffio==1.3.1
+ typing-extensions==4.12.2
+ urllib3==2.2.2
$ ls -a .venv/lib/python3.8/site-packages
_virtualenv.pth certifi-2024.8.30.dist-info h11 httpx-0.27.2.dist-info sniffio urllib3-2.2.2.dist-info
_virtualenv.py charset_normalizer h11-0.14.0.dist-info idna sniffio-1.3.1.dist-info
anyio charset_normalizer-3.3.2.dist-info httpcore idna-3.8.dist-info typing_extensions-4.12.2.dist-info
anyio-4.4.0.dist-info exceptiongroup httpcore-1.0.5.dist-info requests typing_extensions.py
certifi exceptiongroup-1.2.2.dist-info httpx requests-2.32.3.dist-info urllib3 From what I understand from --locked Assert that the `uv.lock` will remain unchanged
--frozen Sync without updating the `uv.lock` file On that note, why would Am I missing something here? (I'm sorry the discussion is drifting a bit, I guess I'm confused with the |
I can confirm that with uv 0.4.0, and the following layout, Structure.
├── Dockerfile
├── README.md
├── apps
│ ├── app1
│ │ ├── README.md
│ │ ├── pyproject.toml
│ │ └── src
│ │ └── app1
│ │ └── __init__.py
│ └── app2
│ ├── README.md
│ ├── pyproject.toml
│ └── src
│ └── app2
│ └── __init__.py
├── libs
│ ├── lib1
│ │ ├── README.md
│ │ ├── pyproject.toml
│ │ └── src
│ │ └── lib1
│ │ └── __init__.py
│ └── lib2
│ ├── README.md
│ ├── pyproject.toml
│ └── src
│ └── lib2
│ └── __init__.py
├── pyproject.toml
├── src
│ └── uv_monorepo_test
│ └── __init__.py
└── uv.lock With child
|
Closing in favor of #6935 |
The doc proposes the following Dockerfile to build a project into a Dockerfile while caching intermediate layers (uv version 0.4.0):
However, when the project is a worskpace,
uv sync --frozen --no-install-project
won't do anything unless the workspace members are there. As a result, if a workspace contains libs in alibs/
dir, one has to alsoADD
alllibs/*/pyproject.toml
files souv sync --frozen --no-install-project
actually installs 3rd party dependencies.We could easily
COPY
the wholelibs/
dir, but then the cache would be invalidated every time sources change.Is there a workaround? Or a workspace-specific strategy for building Docker images?
The text was updated successfully, but these errors were encountered: