Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PEP 621 #266

Merged
merged 8 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Comment on lines +1 to +4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to split out build and test into two separate workflows? Or if not, split build and test into two separate jobs in this workflow?

Do we want to add any tag and release workflows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this new version there are 3 workflows: test, lint, and release. release (which builds the source and wheel packages and uploads them to PyPI) has been there for some time and I have not changed it here. The lint workflow is what it used to be called pythonapp. The test workflow is new and replaces the Travis setup.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that makes sense.

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 }}
Comment on lines +34 to +48
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised the tests just worked with these additions. I can finally delete the outdated ghtests branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was also surprised that this was fairly simple. I also had to change the DatabaseJanitor a bit since it has changed in newer versions of pytest_postgresql but nothing too dramatic.


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