Skip to content

Commit b0fd161

Browse files
authored
Support PEP 621 (#266)
* Replace setup.cfg/.py with pyproject.toml * Support linting with flake8 or ruff and fix some linting issues * Fix test issues * Update workflows * Use uv in workflow for faster install * Change default postgres username in workflow * Delete STYLE.rst * Update changelog
1 parent 62c9609 commit b0fd161

24 files changed

+461
-1348
lines changed

.github/workflows/lint.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.12'
21+
22+
- name: Lint with ruff
23+
run: |
24+
pip install ruff
25+
ruff check python/

.github/workflows/pythonapp.yml

-40
This file was deleted.

.github/workflows/test.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.12'
21+
22+
- name: Set up uv
23+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
24+
25+
- name: Restore uv cache
26+
uses: actions/cache@v4
27+
with:
28+
path: /tmp/.uv-cache
29+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
30+
restore-keys: |
31+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
32+
uv-${{ runner.os }}
33+
34+
- name: Install Postgresql
35+
uses: ikalnytskyi/action-setup-postgres@v6
36+
with:
37+
username: postgres
38+
id: postgres
39+
40+
- name: Install dependencies
41+
run: |
42+
uv pip install --system -e .[dev]
43+
44+
- name: Test with pytest
45+
run: |
46+
pytest -s
47+
env:
48+
PGSERVICE: ${{ steps.postgres.outputs.service-name }}
49+
50+
- name: Minimize uv cache
51+
run: uv cache prune --ci

0 commit comments

Comments
 (0)