Skip to content

Commit 005e03e

Browse files
committed
refactor: Convert from poetry to uv.
1 parent 1514f3b commit 005e03e

File tree

13 files changed

+2501
-3102
lines changed

13 files changed

+2501
-3102
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v1
13+
uses: actions/checkout@v4
1414
- name: Release
1515
uses: softprops/action-gh-release@v1
1616
with:
@@ -19,18 +19,10 @@ jobs:
1919
publish-pypi:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
23-
- uses: actions/setup-python@v4
24-
with:
25-
python-version: "3.9"
26-
- name: Run image
27-
uses: abatilo/[email protected]
28-
with:
29-
poetry-version: 1.2.0
30-
31-
- name: Publish
32-
env:
33-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
34-
run: |
35-
poetry config pypi-token.pypi $PYPI_TOKEN
36-
poetry publish --build
22+
- uses: actions/checkout@v4
23+
- name: Set up uv
24+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
25+
- name: Build dist
26+
run: uvx --from build pyproject-build --installer uv
27+
- name: Publish package distributions to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,31 @@ jobs:
4141
python-version: ${{ matrix.python-version }}
4242
architecture: x64
4343

44-
- name: Install poetry
45-
uses: abatilo/[email protected]
44+
- name: Set up uv
45+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
46+
- name: Restore uv cache
47+
uses: actions/cache@v4
4648
with:
47-
poetry-version: 1.2.2
48-
49-
- name: Set up cache
50-
uses: actions/cache@v3
51-
with:
52-
path: ~/.cache/pypoetry/virtualenvs
53-
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
49+
path: /tmp/.uv-cache
50+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
5451
restore-keys: |
55-
${{ runner.os }}-poetry-
52+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
53+
uv-${{ runner.os }}
5654
5755
- name: Install dependencies
58-
run: poetry install -E parse
59-
60-
- name: Install snowflake
61-
if: ${{ matrix.sqlalchemy-version == '1.4.0' && matrix.python-version != '3.8.0' }}
62-
run: |
63-
poetry run pip install 'snowflake-sqlalchemy'
56+
run: make install
6457

6558
- name: Install specific sqlalchemy version
6659
run: |
67-
poetry run pip install 'sqlalchemy~=${{ matrix.sqlalchemy-version }}'
60+
uv pip install 'sqlalchemy~=${{ matrix.sqlalchemy-version }}'
6861
6962
- if: ${{ matrix.sqlalchemy-version == '1.4.0' }}
70-
run: poetry run make lint
63+
run: make lint
7164

7265
- env:
7366
PMR_POSTGRES_DRIVERNAME: ${{ matrix.postgres-drivername }}
7467
SQLALCHEMY_WARN_20: 1
75-
run: poetry run make test
68+
run: make test
7669

7770
- name: Store test result artifacts
7871
uses: actions/upload-artifact@v3

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-20.04
55
tools:
6-
python: "3.9"
6+
python: "3.10"
77

88
python:
99
install:

Makefile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
.PHONY: install build test lint format
1+
.PHONY: install test lint format
22
.DEFAULT_GOAL := help
33

44
WORKER_COUNT ?= 4
55

66
install:
7-
poetry install -E parse -E alembic
8-
9-
build:
10-
poetry build
7+
uv sync --all-extras
118

129
test:
1310
SQLALCHEMY_WARN_20=1 \
1411
COVERAGE_PROCESS_START="$(PWD)/pyproject.toml" \
12+
uv run \
1513
coverage run -m pytest -n $(WORKER_COUNT) -vv src tests
16-
coverage combine
17-
coverage report -i
18-
coverage xml
14+
uv run coverage combine
15+
uv run coverage report -i
16+
uv run coverage xml
1917

2018
lint:
21-
ruff check --fix src tests || exit 1
22-
ruff format -q src tests || exit 1
23-
mypy src tests || exit 1
24-
ruff format --check src tests
19+
uv run ruff check --fix src tests || exit 1
20+
uv run ruff format -q src tests || exit 1
21+
uv run mypy src tests || exit 1
22+
uv run ruff format --check src tests
2523

2624
format:
27-
ruff check src tests --fix
28-
ruff format src tests
25+
uv run ruff check src tests --fix
26+
uv run ruff format src tests

docs/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ BUILDDIR = build
1010

1111
# Put it first so that "make" without argument is like "make help".
1212
help:
13-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
@uv run $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414

15-
.PHONY: help Makefile
15+
.PHONY: help Makefile autobuild
1616

1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
@uv run $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2121

2222
autobuild:
23-
sphinx-autobuild source build/html
23+
uv run --with sphinx-autobuild sphinx-autobuild source build/html

0 commit comments

Comments
 (0)