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
58 changes: 45 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,37 @@ jobs:
# pre-commit hook, which the `format` job runs in CI. It is deliberately not a
# dedicated job -- that would just double-run the hook.

# Smoke test
#
# Every package (unxt itself and each packages/* member) carries a
# `tests/smoke/` folder of fast, broad checks -- package imports and
# public-API re-exports -- alongside a `tests/unit/` folder for everything
# else. This job runs only the former, gating the full multi-OS/multi-Python
# matrix below. Catches "the whole workspace is broken" in well under a
# minute, instead of waiting on the full matrix to find that out.
smoke:
name: Smoke test
runs-on: ubuntu-latest
needs: [setup, format]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ needs.setup.outputs.newest-python }}

- name: Install
run: uv sync --no-default-groups --all-packages --group test --locked

- name: Smoke test
run: |
# `packages/*/tests/smoke` picks up every workspace member
# automatically -- a new package just needs to add the folder, no
# workflow edit required.
uv run --frozen pytest -x --benchmark-disable \
tests/smoke packages/*/tests/smoke

# Documentation build
#
# Nothing previously gated Sphinx output: there was no docs job here, and the
Expand Down Expand Up @@ -130,7 +161,7 @@ jobs:
tests-unxt:
name: unxt Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -189,7 +220,7 @@ jobs:
tests-unxt-api:
name: unxt-api Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -229,7 +260,7 @@ jobs:
unxt-hypothesis Python ${{ matrix.python-version }} on ${{ matrix.runs-on
}}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -267,7 +298,7 @@ jobs:
tests-unxts-api:
name: unxts-api Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -308,7 +339,7 @@ jobs:
unxts-hypothesis Python ${{ matrix.python-version }} on ${{ matrix.runs-on
}}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -354,7 +385,7 @@ jobs:
unxts-interop-gala Python ${{ matrix.python-version }} on ${{
matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -397,7 +428,7 @@ jobs:
unxts-interop-matplotlib Python ${{ matrix.python-version }} on ${{
matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -437,7 +468,7 @@ jobs:
unxts-interop-xarray Python ${{ matrix.python-version }} on ${{
matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -491,7 +522,7 @@ jobs:
unxts-parametric Python ${{ matrix.python-version }} on ${{ matrix.runs-on
}}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -534,7 +565,7 @@ jobs:
name:
unxts-linalg Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
if: |
github.event_name == 'push' ||
github.event_name == 'schedule' ||
Expand Down Expand Up @@ -579,7 +610,7 @@ jobs:
test-oldest:
name: Check Oldest Dependencies
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -610,7 +641,7 @@ jobs:
test-newest:
name: Newest supported deps
runs-on: ubuntu-latest
needs: [setup, format]
needs: [setup, format, smoke]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

Expand All @@ -629,7 +660,7 @@ jobs:
test-interoperability:
name: Check Interoperability
runs-on: ${{ matrix.runs-on }}
needs: [setup, format]
needs: [setup, format, smoke]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -683,6 +714,7 @@ jobs:
[
setup,
format,
smoke,
docs,
tests-unxt,
tests-unxt-api,
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,3 @@ def test_dispatch_functions_are_callable():

def test_version_is_a_string():
assert isinstance(unxts.api.__version__, str)


def test_wrap_to_keyword_form_redirects_to_positional():
"""``wrap_to(x, min=..., max=...)`` forwards to the positional method."""

@unxts.api.wrap_to.dispatch
def _(x: int, min: int, max: int, /) -> tuple:
return (x, min, max)

assert unxts.api.wrap_to(1, min=2, max=3) == (1, 2, 3)
13 changes: 13 additions & 0 deletions packages/unxts.api/tests/unit/test_wrap_to.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Tests for unxts.api.wrap_to dispatch behavior."""

import unxts.api


def test_wrap_to_keyword_form_redirects_to_positional():
"""``wrap_to(x, min=..., max=...)`` forwards to the positional method."""

@unxts.api.wrap_to.dispatch
def _(x: int, min: int, max: int, /) -> tuple:
return (x, min, max)

assert unxts.api.wrap_to(1, min=2, max=3) == (1, 2, 3)
12 changes: 12 additions & 0 deletions packages/unxts.hypothesis/tests/smoke/test_public_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Smoke tests for the unxts.hypothesis public API."""

import unxts.hypothesis


def test_all_symbols_present():
for name in unxts.hypothesis.__all__:
assert hasattr(unxts.hypothesis, name), f"unxts.hypothesis missing: {name}"


def test_version_is_a_string():
assert isinstance(unxts.hypothesis.__version__, str)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Smoke tests for the unxts.hypothesis public API."""
"""Tests for the unxts.hypothesis strategies."""

import pytest
import unxts.hypothesis
Expand All @@ -7,15 +7,6 @@
import unxt as u


def test_all_symbols_present():
for name in unxts.hypothesis.__all__:
assert hasattr(unxts.hypothesis, name), f"unxts.hypothesis missing: {name}"


def test_version_is_a_string():
assert isinstance(unxts.hypothesis.__version__, str)


@given(q=unxts.hypothesis.quantities(unit="km/s"))
def test_a_strategy_produces_a_quantity(q):
assert q.unit == u.unit("km/s")
Expand Down
14 changes: 14 additions & 0 deletions packages/unxts.interop.gala/tests/smoke/test_public_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Smoke tests for the unxts.interop.gala public API."""

from importlib.metadata import version

import unxts.interop.gala as uig


def test_all_symbols_present():
for name in uig.__all__:
assert hasattr(uig, name), f"unxts.interop.gala missing: {name}"


def test_version_exposed():
assert uig.__version__ == version("unxts.interop.gala")
14 changes: 14 additions & 0 deletions packages/unxts.interop.matplotlib/tests/smoke/test_public_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Smoke tests for the unxts.interop.matplotlib public API."""

from importlib.metadata import version

import unxts.interop.matplotlib as uim


def test_all_symbols_present():
for name in uim.__all__:
assert hasattr(uim, name), f"unxts.interop.matplotlib missing: {name}"


def test_version_exposed():
assert uim.__version__ == version("unxts.interop.matplotlib")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ ignore = [
"**tests/**" = ["ANN", "D401", "E731", "INP001", "S101", "SLF001", "T20"]
# `Qcls` is a class-valued fixture parametrized over the quantity classes; the
# capitalized name (and using it as a constructor) is intentional.
"**packages/unxts.parametric/tests/test_interchangeability.py" = [
"**packages/unxts.parametric/tests/unit/test_interchangeability.py" = [
"N802",
"N803",
"N806",
Expand Down
1 change: 1 addition & 0 deletions tests/smoke/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Smoke Tests."""
14 changes: 14 additions & 0 deletions tests/smoke/test_public_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Smoke tests for the unxt public API."""

from importlib.metadata import version

import unxt as u


def test_all_symbols_present():
for name in u.__all__:
assert hasattr(u, name), f"unxt missing: {name}"


def test_version_exposed():
assert u.__version__ == version("unxt")
Loading