Skip to content

Remove numpy<2.4 pin now that pytensor fix is released (#781) #2242

Remove numpy<2.4 pin now that pytensor fix is released (#781)

Remove numpy<2.4 pin now that pytensor fix is released (#781) #2242

Workflow file for this run

name: ci
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions: {}
jobs:
prek:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Security: do not set to true — prevents credential leakage (GitHub Advanced Security).
persist-credentials: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Run prek on changed files in PRs
if: github.event_name == 'pull_request'
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
with:
extra-args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
- name: Run prek on all files on pushes
if: github.event_name != 'pull_request'
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
with:
extra-args: --all-files
check-environment-yml:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Security: do not set to true — prevents credential leakage (GitHub Advanced Security).
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Install pyproject2conda
run: pip install pyproject2conda
- name: Regenerate environment.yml (same args as local prek hook config)
run: |
pyproject2conda yaml -e dev -o /tmp/environment.generated.yml -n CausalPy \
-w force --no-header \
--python-include "python>=3.12" \
-d make -d pip -d pymc-bart -r "marimo[mcp]"
- name: Check environment.yml is in sync with pyproject.toml
run: |
# Compare YAML body only (skip 9-line autogenerated header in environment.yml)
tail -n +10 environment.yml > /tmp/environment.current.yml
diff -u /tmp/environment.current.yml /tmp/environment.generated.yml && echo "environment.yml is in sync with pyproject.toml"
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: ["3.11", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Security: do not set to true — prevents credential leakage (GitHub Advanced Security).
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Update pip and setuptools
run: pip install --upgrade pip setuptools
- name: Setup environment
run: pip install -e .[test]
- name: Run doctests
run: pytest --doctest-modules --ignore=causalpy/tests/ causalpy/ --config-file=causalpy/tests/conftest.py --no-cov
- name: Run extra tests
run: pytest docs/source/.codespell/test_notebook_to_markdown.py --no-cov
- name: Run tests
run: pytest --cov-report=xml --no-cov-on-fail
- name: Check codespell for notebooks
run: |
python ./docs/source/.codespell/notebook_to_markdown.py --tempdir tmp_markdown
codespell
- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads
name: ${{ matrix.python-version }}
fail_ci_if_error: false