Skip to content

Commit b7192f2

Browse files
committed
Update Dockerfile, Makefile and pipelines to use uv
1 parent cec70b1 commit b7192f2

6 files changed

Lines changed: 43 additions & 35 deletions

File tree

.github/workflows/pypi.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,14 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest]
13-
python: [3.9]
13+
python: [3.14]
1414
steps:
1515
- uses: actions/checkout@v2
16-
- name: Set up Python ${{ matrix.python }}
17-
uses: actions/setup-python@v1
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v7
1818
with:
19-
python-version: ${{ matrix.python }}
20-
- name: Install Poetry
21-
run: pip install poetry
22-
- name: Use in-project virtualenv
23-
run: poetry config virtualenvs.in-project true
24-
- uses: actions/cache@v2
25-
with:
26-
path: .venv/
27-
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
28-
- name: Install dependencies
29-
run: poetry install
30-
- name: Build and publish to pypi
31-
uses: JRubics/poetry-publish@v1.6
32-
with:
33-
pypi_token: ${{ secrets.PYPI_TOKEN }}
19+
python-version: ${{ matrix.python-version }}
20+
- name: Build
21+
run: uv build
22+
- name: Publish to PyPI
23+
run: uv publish

.github/workflows/tests.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,17 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-latest]
15-
python: [3.8, 3.9, "3.10", "3.11"]
15+
python: ["3.12", "3.13", "3.14"]
1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Set up Python ${{ matrix.python }}
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-uv@v4
2020
with:
2121
python-version: ${{ matrix.python }}
2222
- name: Install APT dependencies
2323
run: sudo apt install graphviz mosquitto
24-
- name: Install Poetry
25-
run: pip install poetry
26-
- name: Use in-project virtualenv
27-
run: poetry config virtualenvs.in-project true
28-
- uses: actions/cache@v2
29-
with:
30-
path: .venv/
31-
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
3224
- name: Install dependencies
33-
run: poetry install
25+
run: uv sync
3426
- name: Lint
3527
run: make lint
3628
- name: Static type checking

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
FROM python:3.9-slim as base
1+
FROM ghcr.io/astral-sh/uv:latest as base
22

33
WORKDIR /app
44

5-
RUN pip install --upgrade pip
6-
75
COPY docker/astoria.toml /etc/
86
COPY astoria/ /app/astoria
9-
COPY pyproject.toml README.md /app/
7+
COPY pyproject.toml uv.lock README.md /app/
108

11-
RUN pip install .
9+
RUN uv sync

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: all clean docs docs-serve lint lint-fix type test test-cov
22

3-
CMD:=poetry run
3+
CMD:=uv run
44
PYMODULE:=astoria
55
TESTS:=tests
66
EXTRACODE:=docs/_code

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies = [
2323
"mypy==1.19.1",
2424
"uvloop==0.22.1",
2525
"tomli-w>=1.2.0",
26+
"ty>=0.0.5",
2627
]
2728

2829
[project.urls]

uv.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)