Skip to content
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
18 changes: 12 additions & 6 deletions .devcontainer/postCreateCommand.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#! /usr/bin/env bash
#!/usr/bin/env bash
set -euo pipefail

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.cargo/env

# Install Dependencies
uv sync
# Install binary to /usr/local/bin
if [ -x "$HOME/.local/bin/uv" ]; then
sudo install -m 0755 "$HOME/.local/bin/uv" /usr/local/bin/uv
elif [ -x "$HOME/.cargo/bin/uv" ]; then
sudo install -m 0755 "$HOME/.cargo/bin/uv" /usr/local/bin/uv
fi

# Install pre-commit hooks
uv run pre-commit install --install-hooks
uv --version

uv sync --dev
uv run pre-commit install --install-hooks --overwrite
2 changes: 1 addition & 1 deletion .github/actions/setup-python-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
uv-version:
description: "uv version to use"
required: true
default: "0.5.20"
default: "0.8.22"

runs:
using: "composite"
Expand Down
37 changes: 31 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

# Required for Codecov OIDC uploads and generally safe defaults
permissions:
contents: read
id-token: write

jobs:
quality:
Expand Down Expand Up @@ -43,25 +49,44 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Show tool versions (debug)
run: |
python --version
uv --version

- name: Run tests
run: uv run python -m pytest tests --cov --cov-config=pyproject.toml --cov-report=xml --junitxml=junit.xml

- name: Check typing
run: uv run mypy

- name: Upload coverage reports to Codecov (only for 3.11)
if: ${{ matrix.python-version == '3.11' }}
# --- Codecov upload (only Python 3.11) ---
# Upload coverage only when it's NOT a fork PR (tokenless/OIDC upload).
- name: Upload coverage to Codecov (3.11, non-fork)
if: ${{ matrix.python-version == '3.11' && (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
# Uses GitHub OIDC; no token required for non-fork runs.
use_oidc: true

- name: Upload test results to Codecov (only for 3.11)
if: ${{ matrix.python-version == '3.11' && !cancelled() }}
# Save coverage as artifact on fork PRs (no upload attempt to avoid permission issues).
- name: Save coverage artifact (3.11, fork PR)
if: ${{ matrix.python-version == '3.11' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml

# Optional test results upload to Codecov (skip on forks to avoid tokenless failure).
- name: Upload test results to Codecov (3.11, non-fork)
if: ${{ matrix.python-version == '3.11' && (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) && !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
# This action can work without a token on trusted runs; if you prefer token, you can add it here.
# token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

check-docs:
runs-on: ubuntu-latest
Expand Down
10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
Expand All @@ -16,12 +16,10 @@ repos:
args: [--exit-non-zero-on-fix]
- id: ruff-format

- repo: local
- repo: https://github.com/JoC0de/pre-commit-prettier
rev: v3.6.2
hooks:
- id: prettier
name: prettier
entry: npx --no-install prettier --write
language: system
pass_filenames: true
args: ["--write"]
types_or:
[javascript, jsx, ts, tsx, json, markdown, yaml, css, scss, html]
21 changes: 0 additions & 21 deletions Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions package-lock.json

This file was deleted.

28 changes: 0 additions & 28 deletions package.json

This file was deleted.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dev = [
"codecov>=2.1.13",
"setuptools>=79.0.0",
"cython>=3.0.12",
"tox>=4.30.3",
]

[project.scripts]
Expand Down
Loading
Loading