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
24 changes: 24 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format

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

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install uv
uv sync --group dev
- name: Format with ruff
run: |
uv run ruff format --check .
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

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

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install uv
uv sync --group dev
- name: Lint with ruff
run: |
uv run ruff check .
92 changes: 92 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Test

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

jobs:
test-core:
name: Core Tests (No Optional Deps)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install core dependencies only
run: |
pip install uv
uv sync --group dev
- name: Run core tests
run: |
uv run pytest -m core -v

test-all:
name: All Tests (With Optional Deps)
needs: test-core
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install all dependencies
run: |
pip install uv
uv sync --group dev --group typing --group examples
- name: Run all tests
run: |
uv run pytest -v

coverage:
name: Coverage Report
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Install dependencies
run: |
pip install uv
uv sync --all-extras --all-groups

- name: Run tests with coverage
run: |
uv run coverage run -m pytest
uv run coverage xml
uv run coverage html
uv run coverage report

- name: Coverage comment
if: github.event_name == 'pull_request'
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MINIMUM_GREEN: 85
MINIMUM_ORANGE: 70

- name: Store coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
38 changes: 38 additions & 0 deletions .github/workflows/ty-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Type Check

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

jobs:
ty-check:
name: Run ty type checker
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: python -m pip install uv

- name: Install dependencies with typing group
run: uv sync --group typing

- name: Install ty type checker
run: uv pip install "ty>=0.0.1a20"

- name: Run ty checks
run: |
echo "Running ty check on maseval and tests (excluding examples)"
uv run ty check maseval tests
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Custom
.idea/
.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
Expand Down Expand Up @@ -182,11 +186,11 @@ cython_debug/
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/
.vscode/

# Ruff stuff:
.ruff_cache/
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
Loading
Loading