Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0867604
CI(gh-2126): transition to uv for dependency management and testing
Qazalbash Jan 27, 2026
5453f40
fix: install packages in system
Qazalbash Jan 27, 2026
551d801
fix: update path
Qazalbash Jan 27, 2026
2fdb2b7
fix: specify uv python version in enviornment variable
Qazalbash Jan 27, 2026
c3ce49f
chore: `setup.py` -> `pyproject.toml`
Qazalbash Feb 11, 2026
fde3b41
Revert "chore: `setup.py` -> `pyproject.toml`"
Qazalbash Feb 15, 2026
13c48d7
Merge branch 'master' into issue-2126
Qazalbash Feb 16, 2026
5f0d34a
chore: remove `UV_PYTHON` from env variable
Qazalbash Feb 16, 2026
d8c3c89
chore: explicit python installation
Qazalbash Feb 16, 2026
8c1b1b0
fix: remove `--system` flag
Qazalbash Feb 16, 2026
3d0ab04
fix: avoid installing pyro-api
Qazalbash Feb 25, 2026
9425ab6
fix: sync enviorment
Qazalbash Mar 11, 2026
791696c
Merge branch 'master' into issue-2126
Qazalbash Mar 16, 2026
f4c27cc
Merge branch 'master' into issue-2126
Qazalbash Mar 18, 2026
2087df3
chore: update logic for code coverage
Qazalbash Mar 18, 2026
06a1c87
fix: remove run from coverage
Qazalbash Mar 18, 2026
e82a535
fix: remove run from coverage
Qazalbash Mar 18, 2026
2d88de8
ci: fix coveralls integration and coverage reporting
Qazalbash Mar 18, 2026
56dc7fd
fix: using uv to create env for readthedocs
Qazalbash Mar 19, 2026
7202cc4
fix: pinning jax version until #2154 is resolved
Qazalbash Mar 19, 2026
9fd360f
chore: use env variable for pytest flags
Qazalbash Mar 20, 2026
1a0c848
Revert "fix: pinning jax version until #2154 is resolved"
Qazalbash Mar 20, 2026
0850a10
Merge branch 'master' into issue-2126
Qazalbash Mar 20, 2026
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
162 changes: 83 additions & 79 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,203 +9,207 @@ on:
branches: [master]

env:
PYTEST_ADDOPTS: "--cov=numpyro --cov-append"
PYTEST_ADDOPTS: "--cov=numpyro --cov-append --cov-report=lcov"

jobs:
prek:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: prek check
uses: j178/prek-action@v1
with:
extra-args: --all-files --skip ruff --skip ruff-format --skip ty --skip mypy


lint:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.13"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install -y pandoc gsfonts
python -m pip install --upgrade pip
pip install jaxlib
pip install jax
pip install '.[doc,test]'
pip install https://github.com/pyro-ppl/funsor/archive/master.zip
pip install -r docs/requirements.txt
pip freeze
uv sync \
--upgrade \
--extra cpu \
--group ci \
--group docs \
--group test
uv pip freeze
- name: Lint with mypy and ruff
run: |
make lint
uv run make lint
- name: Build documentation
run: |
make docs
uv run make docs
- name: Test documentation
run: |
make doctest
python -m doctest -v README.md

uv run make doctest
uv run python -m doctest -v README.md

test-modeling:

runs-on: ubuntu-latest
needs: [lint, prek]
strategy:
matrix:
python-version: ["3.11", "3.13"]
env:
UV_PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install -y graphviz
python -m pip install --upgrade pip
# Keep track of pyro-api master branch
pip install https://github.com/pyro-ppl/pyro-api/archive/master.zip
pip install jaxlib
pip install jax
pip install https://github.com/pyro-ppl/funsor/archive/master.zip
pip install -e '.[dev,test]'
pip freeze
uv sync \
--upgrade \
--extra cpu \
--group ci \
--group dev \
--group test
uv pip freeze
- name: Test with pytest
run: |
CI=1 pytest -vs -k "not test_example" --durations=100 --ignore=test/infer/ --ignore=test/contrib/
CI=1 uv run pytest -vs -k "not test_example" --durations=100 --ignore=test/infer/ --ignore=test/contrib/
- name: Test x64
run: |
JAX_ENABLE_X64=1 pytest -vs test/test_distributions.py -k "powerLaw or Dagum"
JAX_ENABLE_X64=1 uv run pytest -vs test/test_distributions.py -k "powerLaw or Dagum"
- name: Test tracer leak
if: matrix.python-version == '3.13'
env:
JAX_CHECK_TRACER_LEAKS: 1
run: |
pytest -vs test/infer/test_mcmc.py::test_chain_inside_jit
pytest -vs test/infer/test_mcmc.py::test_chain_jit_args_smoke
pytest -vs test/infer/test_mcmc.py::test_reuse_mcmc_run
pytest -vs test/infer/test_mcmc.py::test_model_with_multiple_exec_paths
pytest -vs test/test_distributions.py::test_mean_var -k Gompertz

uv run pytest -vs \
test/infer/test_mcmc.py::test_chain_inside_jit \
test/infer/test_mcmc.py::test_chain_jit_args_smoke \
test/infer/test_mcmc.py::test_model_with_multiple_exec_paths \
test/infer/test_mcmc.py::test_reuse_mcmc_run
uv run pytest -vs test/test_distributions.py::test_mean_var -k Gompertz
- name: Coveralls
if: github.repository == 'pyro-ppl/numpyro' && matrix.python-version == '3.13'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: test-modeling

file: coverage.lcov

test-inference:

runs-on: ubuntu-latest
needs: [lint, prek]
strategy:
matrix:
python-version: ["3.11", "3.13"]
env:
UV_PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Keep track of pyro-api master branch
pip install https://github.com/pyro-ppl/pyro-api/archive/master.zip
pip install jaxlib
pip install jax
pip install https://github.com/pyro-ppl/funsor/archive/master.zip
pip install -e '.[dev,test]'
pip freeze
uv sync \
--upgrade \
--extra cpu \
--group ci \
--group dev \
--group test
uv pip freeze
- name: Test with pytest
run: |
pytest -vs --durations=20 test/infer/test_mcmc.py
pytest -vs --durations=20 test/infer --ignore=test/infer/test_mcmc.py --ignore=test/contrib/test_nested_sampling.py
pytest -vs --durations=20 test/contrib --ignore=test/contrib/stochastic_support/test_dcc.py
uv run pytest -vs --durations=20 test/contrib --ignore=test/contrib/stochastic_support/test_dcc.py
uv run pytest -vs --durations=20 test/infer --ignore=test/infer/test_mcmc.py --ignore=test/contrib/test_nested_sampling.py
uv run pytest -vs --durations=20 test/infer/test_mcmc.py
- name: Test x64
run: |
JAX_ENABLE_X64=1 pytest -vs test/infer/test_mcmc.py -k x64
JAX_ENABLE_X64=1 uv run pytest -vs test/infer/test_mcmc.py -k x64
- name: Test chains
run: |
XLA_FLAGS="--xla_force_host_platform_device_count=2" pytest -vs test/infer/test_mcmc.py -k "chain or pmap or vmap"
XLA_FLAGS="--xla_force_host_platform_device_count=2" pytest -vs test/contrib/test_tfp.py -k "chain"
XLA_FLAGS="--xla_force_host_platform_device_count=2" pytest -vs test/contrib/stochastic_support/test_dcc.py
XLA_FLAGS="--xla_force_host_platform_device_count=2" pytest -vs test/infer/test_hmc_gibbs.py -k "chain"
XLA_FLAGS="--xla_force_host_platform_device_count=2" uv run pytest -vs test/contrib/stochastic_support/test_dcc.py
XLA_FLAGS="--xla_force_host_platform_device_count=2" uv run pytest -vs test/contrib/test_tfp.py -k "chain"
XLA_FLAGS="--xla_force_host_platform_device_count=2" uv run pytest -vs test/infer/test_hmc_gibbs.py -k "chain"
XLA_FLAGS="--xla_force_host_platform_device_count=2" uv run pytest -vs test/infer/test_mcmc.py -k "chain or pmap or vmap"
- name: Test custom prng
run: |
JAX_ENABLE_CUSTOM_PRNG=1 pytest -vs test/infer/test_mcmc.py
JAX_ENABLE_CUSTOM_PRNG=1 uv run pytest -vs test/infer/test_mcmc.py
- name: Test nested sampling
run: |
JAX_ENABLE_X64=1 pytest -vs test/contrib/test_nested_sampling.py
JAX_ENABLE_X64=1 uv run pytest -vs test/contrib/test_nested_sampling.py
- name: Coveralls
if: github.repository == 'pyro-ppl/numpyro' && matrix.python-version == '3.13'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: test-inference

file: coverage.lcov

examples:

runs-on: ubuntu-latest
needs: [lint, prek]
strategy:
matrix:
python-version: ["3.13"]
env:
UV_PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
update-path: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jaxlib
pip install jax
pip install https://github.com/pyro-ppl/funsor/archive/master.zip
pip install -e '.[dev,examples,test]'
pip freeze
uv sync \
--upgrade \
--extra cpu \
--group ci \
--group dev \
--group examples \
--group test
uv pip freeze
- name: Test with pytest
run: |
CI=1 XLA_FLAGS="--xla_force_host_platform_device_count=2" pytest -vs -k test_example
CI=1 XLA_FLAGS="--xla_force_host_platform_device_count=2" uv run pytest -vs -k test_example
- name: Coveralls
if: github.repository == 'pyro-ppl/numpyro' && matrix.python-version == '3.13'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: examples

file: coverage.lcov

finish:

needs: [test-modeling, test-inference, examples]
runs-on: ubuntu-latest
if: github.repository == 'pyro-ppl/numpyro'
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
carryforward: "test-modeling,test-inference,examples"

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
uv.lock
numpyro.egg-info
__pycache__/
.ipynb_checkpoints/
Expand Down
13 changes: 9 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ build:
os: ubuntu-24.04
tools:
python: "3.13"
jobs: # https://docs.readthedocs.com/platform/stable/build-customization.html#install-dependencies-with-uv
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --extra cpu --group dev --group docs --group test

sphinx:
configuration: docs/source/conf.py

formats:
- pdf

python:
install:
- requirements: docs/requirements.txt
21 changes: 0 additions & 21 deletions docs/requirements.txt

This file was deleted.

Loading
Loading