-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(project-setup): Switch from
poetry
to uv
, bump all dependency…
… versions to latest
- Loading branch information
Showing
13 changed files
with
1,562 additions
and
2,409 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ jobs: | |
enable-cache: true | ||
|
||
- name: Build package | ||
run: devbox run poetry build | ||
run: devbox run uv build | ||
|
||
- name: Publish package | ||
uses: pypa/[email protected] | ||
|
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
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,35 +1,20 @@ | ||
# Global ARG, available to all stages (if renewed) | ||
ARG WORKDIR="/app" | ||
|
||
FROM python:3.12 AS builder | ||
|
||
# Renew (https://stackoverflow.com/a/53682110): | ||
ARG WORKDIR | ||
|
||
# Don't buffer `stdout`: | ||
ENV PYTHONUNBUFFERED=1 | ||
# Don't create `.pyc` files: | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
RUN pip install poetry && poetry config virtualenvs.in-project true | ||
|
||
WORKDIR ${WORKDIR} | ||
COPY . . | ||
|
||
RUN poetry install --only main | ||
|
||
FROM python:3.12 | ||
|
||
ARG WORKDIR | ||
FROM python:3.12-slim | ||
|
||
ARG WORKDIR="/app" | ||
WORKDIR ${WORKDIR} | ||
|
||
COPY --from=builder ${WORKDIR} . | ||
|
||
RUN useradd -u 1000 -d ${WORKDIR} -M app | ||
RUN chown -R app:app ${WORKDIR} | ||
USER 1000 | ||
|
||
# App-specific settings: | ||
# https://docs.astral.sh/uv/guides/integration/docker/#installing-uv | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
||
# This just works... splitting this up for better caching is a pain with Python. | ||
COPY . . | ||
RUN uv sync --frozen | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT [ "./.venv/bin/python", "-m", "ancv" ] | ||
|
||
ENTRYPOINT [ "uv", "run", "ancv" ] | ||
CMD [ "serve", "api", "--port", "8080" ] |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{ | ||
"packages": [ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"graphviz@8", | ||
"pre-commit@3" | ||
], | ||
|
@@ -11,18 +13,18 @@ | |
"shell": { | ||
"init_hook": [ | ||
"echo 'Running command in devbox shell...'", | ||
"poetry install" | ||
"uv sync" | ||
], | ||
"scripts": { | ||
"build-image": "docker build --progress=plain --tag \"$LIBRARY\"/\"$LIBRARY\":$(poetry version --short) .", | ||
"format-check": "poetry run ruff format --check --diff", | ||
"build-image": "docker build --progress=plain --tag \"$LIBRARY\"/\"$LIBRARY\":dev .", | ||
"format-check": "ruff format --check --diff", | ||
"install-hooks": "pre-commit install --hook-type pre-push --hook-type pre-commit --hook-type commit-msg", | ||
"lint": "poetry run ruff --verbose .", | ||
"make-depgraph.svg": "poetry run pydeps --max-bacon=4 --cluster -T svg -o depgraph.svg \"$LIBRARY\"", | ||
"make-github.py": "poetry run datamodel-codegen --url \"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions-next/api.github.com/dereferenced/api.github.com.deref.json\" --encoding utf-8 --input-file-type openapi --openapi-scopes paths --output github.py", | ||
"make-resume.py": "poetry run datamodel-codegen --url \"https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json\" --encoding utf-8 --input-file-type jsonschema --output resume.py", | ||
"test": "poetry run pytest --cov=\"$LIBRARY\" --cov-report=html --cov-report=term --cov-report=xml", | ||
"typecheck": "poetry run mypy -p \"$LIBRARY\"" | ||
"lint": "ruff check --verbose .", | ||
"make-depgraph.svg": "pydeps --max-bacon=4 --cluster -T svg -o depgraph.svg \"$LIBRARY\"", | ||
"make-github.py": "uv run datamodel-codegen --url \"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions-next/api.github.com/dereferenced/api.github.com.deref.json\" --encoding utf-8 --input-file-type openapi --openapi-scopes paths --output github.py", | ||
"make-resume.py": "uv run datamodel-codegen --url \"https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json\" --encoding utf-8 --input-file-type jsonschema --output resume.py", | ||
"test": "uv run pytest -vv --cov=\"$LIBRARY\" --cov-report=html --cov-report=term --cov-report=xml", | ||
"typecheck": "uv run mypy -v -p \"$LIBRARY\"" | ||
} | ||
} | ||
} |
Oops, something went wrong.