ci: Test under Python 3.12 #388
Workflow file for this run
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
name: httpstan | |
on: [push, pull_request] | |
jobs: | |
tests: | |
name: httpstan tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
python-version: ["3.9", "3.10"] | |
include: | |
- os: ubuntu-22.04 | |
python-version: "3.11" | |
- os: ubuntu-22.04 | |
python-version: "3.12" | |
- os: macos-11.0 | |
python-version: "3.10" | |
- os: macos-11.0 | |
python-version: "3.11" | |
- os: macos-11.0 | |
python-version: "3.12" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
run: pip install "poetry~=1.7.1" | |
- name: Build libraries used by Stan | |
run: make -j2 | |
# export test dependencies from pyproject.toml, install them | |
- name: Install dependencies | |
run: | | |
poetry export -f requirements.txt --without-hashes --with dev -o requirements.txt \ | |
&& pip install -r requirements.txt | |
# disable building docs (included in checks) under Python 3.12, sphinx dependencies do not work | |
- name: Check code | |
run: scripts/check | |
if: ${{ matrix.python-version != 3.12 }} | |
- name: Build and Install wheel | |
run: | | |
poetry build -v | |
python -m pip install dist/*.whl | |
- name: Run tests | |
run: python -m pytest -s -v tests | |
- name: Test PyStan compatibility | |
run: | | |
pip install --pre pystan | |
python -c'import stan;assert stan.build("parameters {real y;} model {y ~ normal(0,1);}").sample()["y"] is not None' |