Skip to content

Commit

Permalink
Support PEP 621 (#266)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
albireox authored Sep 3, 2024
1 parent 62c9609 commit b0fd161
Show file tree
Hide file tree
Showing 24 changed files with 461 additions and 1,348 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Lint with ruff
run: |
pip install ruff
ruff check python/
40 changes: 0 additions & 40 deletions .github/workflows/pythonapp.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install Postgresql
uses: ikalnytskyi/action-setup-postgres@v6
with:
username: postgres
id: postgres

- name: Install dependencies
run: |
uv pip install --system -e .[dev]
- name: Test with pytest
run: |
pytest -s
env:
PGSERVICE: ${{ steps.postgres.outputs.service-name }}

- name: Minimize uv cache
run: uv cache prune --ci
Loading

0 comments on commit b0fd161

Please sign in to comment.