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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .codespell-ignore-words
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
MOR
theses
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[run]
branch = true
source = pysatl_criterion
omit =
tests/*

[report]
show_missing = true
precision = 2
# The measured combined statement/branch baseline is 82.08%.
fail_under = 80
46 changes: 30 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pip install poetry==2.1.1
run: pip install poetry==2.4.1

- name: Install dynamic versioning plugin
run: poetry self add poetry-dynamic-versioning[plugin]
- name: Validate locked dependencies
run: poetry check --lock

- name: Install dependencies with Poetry
run: poetry sync --only main,lint,test

- name: Build distribution
run: poetry build
Expand All @@ -43,9 +46,6 @@ jobs:
- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies with Poetry
run: poetry install --with dev

- name: Run Ruff lint
run: poetry run ruff check --output-format=github

Expand All @@ -57,12 +57,22 @@ jobs:
poetry run mypy src/pysatl_criterion tests

- name: Run tests
run: poetry run pytest --random-order
if: matrix.python-version != '3.12'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?

run: poetry run pytest --random-order --junitxml=${{ runner.temp }}/pytest-results.xml

- name: Tests with Coveralls
if: (runner.os == 'Linux' && matrix.python-version == '3.12')
run: |
poetry run pytest --random-order --cov=pysatl_criterion --cov-config=.coveragerc
poetry run pytest --random-order --cov=pysatl_criterion --cov-config=.coveragerc --cov-report=term-missing --cov-report=xml --junitxml=${{ runner.temp }}/pytest-results.xml

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v7
with:
name: test-reports-python-${{ matrix.python-version }}
path: |
${{ runner.temp }}/pytest-results.xml
coverage.xml
Comment on lines +69 to +75

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?


- name: Coveralls
if: (runner.os == 'Linux' && matrix.python-version == '3.12')
Expand All @@ -72,9 +82,6 @@ jobs:
# Allow failure for coveralls
poetry run coveralls || true

- name: Remove poetry.lock before checking for changes
run: rm -f poetry.lock

- name: Check for repository changes
run: |
if [ -n "$(git status --porcelain)" ]; then
Expand All @@ -98,7 +105,14 @@ jobs:
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- uses: pre-commit/action@v3.0.1
- name: Install Poetry
run: pip install poetry==2.4.1
- name: Validate locked dependencies
run: poetry check --lock
- name: Install dependencies
run: poetry sync --only main,lint,test
- name: Run pre-commit
run: poetry run pre-commit run --all-files --show-diff-on-failure


build:
Expand All @@ -118,11 +132,11 @@ jobs:
with:
python-version: "3.12"

- name: Build distribution
run: pip install poetry==2.1.1
- name: Install Poetry
run: pip install poetry==2.4.1

- name: Install dynamic versioning plugin
run: poetry self add poetry-dynamic-versioning[plugin]
- name: Validate locked dependencies
run: poetry check --lock

- name: Build distribution
run: poetry build
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

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

- name: Install dependencies
- name: Install Poetry
run: pip install poetry==2.4.1

- name: Install documentation dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements-docs.txt
poetry check --lock
poetry sync --only docs --no-root

- name: Fetch gh-pages branch
run: |
Expand All @@ -43,13 +48,13 @@ jobs:
- name: Build and push Mike
if: ${{ github.event_name == 'push' }}
run: |
mike deploy ${{ github.ref_name }} latest --push --update-aliases
poetry run mike deploy ${{ github.ref_name }} latest --push --update-aliases

- name: Build and push Mike - Release
if: ${{ github.event_name == 'release' }}
run: |
mike deploy ${{ github.ref_name }} stable --push --update-aliases
poetry run mike deploy ${{ github.ref_name }} stable --push --update-aliases

- name: Show mike versions
run: |
mike list
poetry run mike list
85 changes: 85 additions & 0 deletions .github/workflows/extended-validation.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Statistical and database validation

on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 1"

permissions:
contents: read

jobs:
statistical:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- run: pip install poetry==2.4.1
- run: poetry sync --only main,test
- name: Validate level and power with independent simulation samples
env:
PYSATL_STATISTICAL: "1"
PYSATL_MULTIPLE_TESTING_MONTE_CARLO: "1"
run: >-
poetry run pytest -m statistical --random-order
--junitxml=${{ runner.temp }}/statistical.xml
- uses: actions/upload-artifact@v7
if: always()
with:
name: statistical-results
path: ${{ runner.temp }}/statistical.xml

databases:
runs-on: ubuntu-latest
timeout-minutes: 15
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: criterion
POSTGRES_PASSWORD: criterion
POSTGRES_DB: criterion
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U criterion"
--health-interval 10s --health-timeout 5s --health-retries 10
mysql:
image: mysql:8.4
env:
MYSQL_ROOT_PASSWORD: criterion
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: criterion
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h localhost -pcriterion"
--health-interval 10s --health-timeout 5s --health-retries 20
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- run: pip install poetry==2.4.1
- run: poetry sync --only main,test
- name: Install optional MySQL integration driver
run: poetry run python -m pip install 'PyMySQL[rsa]==1.1.2'
- name: Check real database transactions and concurrent writers
env:
CRITERION_TEST_POSTGRES_URL: postgresql+psycopg2://criterion:criterion@127.0.0.1:5432/criterion
CRITERION_TEST_MYSQL_URL: mysql+pymysql://root:criterion@127.0.0.1:3306/criterion
run: >-
poetry run pytest tests/persistence tests/loader --random-order
--junitxml=${{ runner.temp }}/databases.xml
- uses: actions/upload-artifact@v7
if: always()
with:
name: database-results
path: ${{ runner.temp }}/databases.xml
45 changes: 15 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,25 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pycqa/flake8
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
# stages: [push]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.13.0"
# Use the locked project environment so hooks and CI run identical tools.
- repo: local
hooks:
- id: mypy
exclude: build_helpers
additional_dependencies:
- types-cachetools==5.5.0.20240820
- types-filelock==3.2.7
- types-requests==2.32.0.20241016
- types-tabulate==0.9.0.20240106
- types-python-dateutil==2.9.0.20241003
- SQLAlchemy==2.0.36
# stages: [push]

- repo: https://github.com/pycqa/isort
rev: "5.13.2"
hooks:
- id: isort
name: isort (python)
# stages: [push]

- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.15.5'
hooks:
name: mypy
entry: poetry run mypy src/pysatl_criterion tests
language: system
types_or: [python, pyi]
pass_filenames: false
- id: ruff
name: Ruff lint
entry: poetry run ruff check
language: system
types_or: [python, pyi]
- id: ruff-format
name: Ruff format
entry: poetry run ruff format
language: system
types_or: [python, pyi]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down
11 changes: 7 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ build:
os: "ubuntu-22.04"
tools:
python: "3.12"

python:
install:
- requirements: docs/requirements-docs.txt
jobs:
post_create_environment:
- pip install poetry==2.4.1
post_install:
- poetry check --lock
# Keep Read the Docs' own build tools in its shared environment.
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --only docs --no-root

mkdocs:
configuration: mkdocs.yml
Loading
Loading