-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate dev dependencies and add pre-commit support (#304)
* Adding support for dev dependencies * Adding new dependencies with pre-commit * Adding debug * Dockerfile test * Fixing run installation and other bugs * Adding common uv for pre-commit * Adding target to the action * Changing lock file back --------- Signed-off-by: Mario Cariñana <[email protected]>
- Loading branch information
Showing
8 changed files
with
161 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
FROM python:3.11-slim-bookworm | ||
FROM python:3.11-slim-bookworm AS base | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv | ||
|
||
# Copy the project into the image | ||
ADD . /mzai | ||
|
||
|
||
WORKDIR /mzai/lumigator/python/mzai/backend | ||
|
||
# Sync the project into a new environment, using the frozen lockfile | ||
FROM base AS main_image | ||
|
||
# Sync the project into a new environment, using the frozen lockfile and no dev dependencies | ||
RUN uv sync --no-dev --frozen | ||
|
||
CMD ["uv", "run", "--no-dev", "uvicorn", "--host", "0.0.0.0", "--port", "8000", "backend.main:app"] | ||
|
||
FROM base AS dev_image | ||
|
||
# Sync the project into a new environment, using the frozen lockfile and no dev dependencies | ||
RUN uv sync --frozen | ||
|
||
CMD ["uv", "run", "uvicorn", "--host", "0.0.0.0", "--port", "8000", "backend.main:app"] | ||
CMD ["uv", "run", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[project] | ||
name = "common" | ||
version = "0.1.0" | ||
description = "Common deps to develop" | ||
requires-python = ">=3.11" | ||
dependencies = [ | ||
"pre-commit>=4.0.1", | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.