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
21 changes: 20 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,23 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
name: test (${{ matrix.os }}, ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
# NOTE: macOS (arm64, which installs the Metal backend) and Windows run only the
# newest Python; version-specific failures already show up on Linux.
include:
- os: macos-latest
python-version: "3.14"
- os: windows-latest
python-version: "3.14"
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v7
Expand All @@ -33,6 +46,12 @@ jobs:
run: uv sync --python ${{ matrix.python-version }} --dev
- name: Show test interpreter
run: uv run --python ${{ matrix.python-version }} python --version
- name: Report Metal availability
if: runner.os == 'macOS'
run: >-
uv run --python ${{ matrix.python-version }} python -c
"from tsim.statevector.metal import runtime;
print('Metal:', runtime.unavailable() or 'available')"
- name: Run tests
# For example, using `pytest`
run: uv run --python ${{ matrix.python-version }} just coverage
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ dev = [
"ruff>=0.7.3",
"rust-just>=1.36.0",
"sinter~=1.16.dev",
"tesseract-decoder>=0.1.1.dev20251113222502",
# NOTE: tesseract-decoder has no Windows wheels.
"tesseract-decoder>=0.1.1.dev20251113222502; sys_platform != 'win32'",
"tqdm>=4.67.1",
"vulture>=2.16",
"radon>=6.0.1",
Expand Down
5 changes: 5 additions & 0 deletions test/unit/test_dev_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

import pytest
import yaml

# NOTE: the development CLI is POSIX-only (it locks files with fcntl and caps memory).
if sys.platform == "win32":
pytest.skip("tsim-dev runs only on POSIX systems", allow_module_level=True)

from tsim_dev import bench, checks, cli, common, corpus, jobs, width

ROOT = Path(__file__).resolve().parents[2]
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _ids(path: Path) -> str:


def _frontmatter(path: Path) -> tuple[dict, str]:
text = path.read_text()
text = path.read_text(encoding="utf-8")
assert text.startswith("---\n"), "SKILL.md must start with YAML frontmatter"
head, body = text[4:].split("\n---\n", 1)
front = yaml.safe_load(head)
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_frontmatter_follows_the_spec(skill_dir: Path):

@pytest.mark.parametrize("path", MARKDOWN_FILES, ids=_ids)
def test_relative_links_resolve(path: Path):
for target in LINK.findall(path.read_text()):
for target in LINK.findall(path.read_text(encoding="utf-8")):
if re.match(r"^[a-z]+:", target) or target.startswith("#"):
continue
assert (path.parent / target.split("#")[0]).exists(), f"broken link {target}"
Expand All @@ -94,7 +94,7 @@ def test_relative_links_resolve(path: Path):
@pytest.mark.parametrize("path", MARKDOWN_FILES, ids=_ids)
def test_code_blocks_run(path: Path, tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
monkeypatch.chdir(tmp_path) # blocks write figures and logs
blocks = CODE_BLOCK.findall(path.read_text())
blocks = CODE_BLOCK.findall(path.read_text(encoding="utf-8"))
# NOTE: blocks must check their results, not only run, so that a change in behavior fails.
assert not blocks or any(
"assert " in code for code in blocks
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading