Skip to content

Commit

Permalink
migrate to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Jan 10, 2025
1 parent 97d280e commit b356e4e
Show file tree
Hide file tree
Showing 5 changed files with 1,112 additions and 33 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,16 @@ FROM python:3.10-slim
ENV USER=ci_relay
RUN adduser --gecos "" --disabled-password $USER

RUN pip install --no-cache-dir poetry uvicorn
RUN pip install --no-cache-dir uv

RUN mkdir /app
WORKDIR /app

COPY pyproject.toml /app
COPY poetry.lock /app
COPY . /app

ENV PATH=/home/$USER/.local/bin:$PATH

RUN poetry export -o requirements.txt

RUN pip install --no-cache-dir -r requirements.txt

COPY src src
COPY CHECKS .
COPY Procfile .

RUN pip install .
RUN uv sync --frozen

USER $USER
CMD uvicorn ci_relay.web:create_app --factory --port 5000 --host 0.0.0.0
CMD uv run uvicorn ci_relay.web:create_app --factory --port 5000 --host 0.0.0.0
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: uvicorn ci_relay.web:create_app --factory --port $PORT --host 0.0.0.0
web: uv run uvicorn ci_relay.web:create_app --factory --port $PORT --host 0.0.0.0
43 changes: 24 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
[tool.poetry]
[project]
name = "ci-relay"
version = "0.1.0"
description = ""
authors = ["Paul Gessinger <[email protected]>"]
packages = [
{ include = "ci_relay", from = "src" },
authors = [{name="Paul Gessinger", email="[email protected]"}]

requires-python = ">=3.10"
dependencies = [
"aiohttp>=3.11.11",
"cachetools>=5.5.0",
"gidgethub>=5.3.0",
"gidgetlab>=2.0.1",
"pysmee>=0.1.1",
"python-dateutil>=2.9.0.post0",
"python-dotenv>=1.0.1",
"sanic>=24.12.0",
"uvicorn>=0.34.0",
]

[tool.poetry.dependencies]
python = "^3.9"
gidgethub = "^5.1.0"
aiohttp = "^3.8.1"
python-dotenv = "^0.19.2"
pysmee = "^0.1.1"
sanic = "^21.12.1"
cachetools = "^5.0.0"
python-dateutil = "^2.8.2"
gidgetlab = "^1.0.0"
[tool.pyright]
exclude = [ ".venv" ]
venvPath = "."
venv = ".venv"

[tool.poetry.dev-dependencies]
black = "^22.1.0"
isort = "^5.10.1"
[tool.uv]
dev-dependencies = [
"ruff>=0.7.3",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
Loading

0 comments on commit b356e4e

Please sign in to comment.