-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/better-docs
- Loading branch information
Showing
38 changed files
with
1,533 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Common Python + Poetry Setup | ||
|
||
inputs: | ||
dependency-groups: | ||
description: 'A comma-separated list of dependency groups to install' | ||
default: 'main' | ||
python-version: | ||
description: 'The Python version to use' | ||
default: '3.10' | ||
|
||
runs: | ||
using: 'composite' | ||
|
||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Install poetry | ||
shell: bash | ||
run: | | ||
python -m pip install poetry | ||
poetry config virtualenvs.in-project true | ||
- name: Get cache key | ||
id: cache-key | ||
shell: bash | ||
run: | | ||
key=$(echo "${{ inputs.dependency-groups }}" | sed 's/,/+/') | ||
echo "key=$key" >> "$GITHUB_OUTPUT" | ||
- name: Load cached venv | ||
id: cache-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-python-${{ inputs.python-version }}-groups-${{ steps.cache-key.outputs.key }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: poetry install --with ${{ inputs.dependency-groups }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,26 +3,17 @@ name: Pre-commit | |
on: | ||
workflow_dispatch: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install poetry | ||
poetry config virtualenvs.in-project true | ||
poetry install | ||
- uses: './.github/actions/setup-project' | ||
with: | ||
dependency-groups: 'dev,test' | ||
|
||
- uses: pre-commit/[email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Run unit tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
versions: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
py-versions: ${{ steps.supported-versions.outputs.py-versions }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: './.github/actions/setup-project' | ||
with: | ||
dependency-groups: 'dev' | ||
|
||
- id: supported-versions | ||
name: Get supported versions | ||
run: | | ||
set -e | ||
echo "py-versions=$(poetry run ./scripts/supported_py_versions.py)" >> "$GITHUB_OUTPUT" | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
needs: versions | ||
strategy: | ||
matrix: | ||
py-version: ${{ fromJson(needs.versions.outputs.py-versions) }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: './.github/actions/setup-project' | ||
with: | ||
python-version: ${{ matrix.py-version }} | ||
dependency-groups: 'test' | ||
|
||
- name: Run unit tests | ||
run: poetry run pytest | ||
|
||
results: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- run: | | ||
result="${{ needs.test.result }}" | ||
if [[ $result == "success" || $result == "skipped" ]]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,3 +163,4 @@ cython_debug/ | |
account.json | ||
airtag.plist | ||
DO_NOT_COMMIT* | ||
.direnv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.9 | ||
rev: v0.6.3 | ||
hooks: | ||
- id: ruff | ||
args: ["--fix"] | ||
- id: ruff-format | ||
- repo: https://github.com/RobertCraigie/pyright-python | ||
rev: v1.1.350 | ||
rev: v1.1.378 | ||
hooks: | ||
- id: pyright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# ruff: noqa: ASYNC230 | ||
|
||
import json | ||
from pathlib import Path | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.