Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
760ea01
Convert to PEP 735 dependency-groups; keep inference/debug as user-fa…
jeromekelleher Mar 3, 2026
212d0ea
Add prek.toml
jeromekelleher Mar 3, 2026
4478a02
Add uv.lock
jeromekelleher Mar 3, 2026
80be3a2
Use standard __PKG_VERSION__ placeholder; simplify Makefile
jeromekelleher Mar 3, 2026
779c856
Update docs workflow to use current shared workflow
jeromekelleher Mar 3, 2026
a4a2dda
Replace ci.yml with shared tests workflow, integration.yml for e2e/ba…
jeromekelleher Mar 3, 2026
f42f6da
Add packaging workflow
jeromekelleher Mar 3, 2026
0244918
Add release workflow using Trusted Publisher
jeromekelleher Mar 3, 2026
bfa1082
Add codecov.yml
jeromekelleher Mar 3, 2026
f6021d6
Standard prek.toml, remove codecov
jeromekelleher Mar 3, 2026
ed5f531
Initial ruff linting
jeromekelleher Mar 3, 2026
e761bf4
Standard build
jeromekelleher Mar 3, 2026
f49a555
Fixup linting, finalise prek
jeromekelleher Mar 4, 2026
a7d6468
Bump actions versions
jeromekelleher Mar 4, 2026
905c206
Exclude cli from packaging test
jeromekelleher Mar 4, 2026
51ac2a3
Restrict to linux for tests
jeromekelleher Mar 4, 2026
ab3a08a
fixup bare API tests
jeromekelleher Mar 4, 2026
bab7399
Drop sgkit, use direct xarray load
jeromekelleher Mar 4, 2026
84aab34
Just run tests on 311
jeromekelleher Mar 4, 2026
e0d76f7
Add per-worker cache
jeromekelleher Mar 4, 2026
62fd1a8
Got back to all test oss
jeromekelleher Mar 4, 2026
58062a7
Final linting
jeromekelleher Mar 4, 2026
43dfaf1
Standardise on workflow layout
jeromekelleher Mar 4, 2026
6527ad4
Switch docs to jupyterbook<2
jeromekelleher Mar 4, 2026
967e8a9
Pin on tsinfer < 1
jeromekelleher Mar 4, 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
125 changes: 0 additions & 125 deletions .github/workflows/ci.yml

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Docs
name: Build docs

on:
pull_request:
push:
branches: [main]
tags:
- '*'
merge_group:

jobs:
Docs:
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@v1
docs:
uses: tskit-dev/.github/.github/workflows/docs.yml@v14
59 changes: 59 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Integration tests

on:
pull_request:
push:
branches: [main, test]
merge_group:

jobs:
end-to-end:
name: End to end tests
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.2.2
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
version: "0.8.15"
- name: Install dependencies
run: uv sync --locked --group test

- name: Create basedir
run: |
mkdir -p testrun
gunzip -k tests/data/alignments.fasta.gz

- name: Import alignments
run: uv run sc2ts import-alignments -i testrun/dataset.zarr tests/data/alignments.fasta

- name: Import metadata
run: uv run sc2ts import-metadata testrun/dataset.zarr tests/data/metadata.tsv

- name: Info dataset
run: uv run sc2ts info-dataset testrun/dataset.zarr

- name: Run inference
run: |
# doing ~10 days here as this is taking a while
uv run sc2ts infer tests/data/testrun-conf.toml --stop 2020-02-03

- name: Validate
run: uv run sc2ts validate -v --date-field=date testrun/dataset.zarr testrun/results/test/test_2020-02-02.ts

- name: MatchDB
run: uv run sc2ts info-matches testrun/test.matches.db

bare-api:
name: Bare API tests
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.2.2
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
version: "0.8.15"
- name: Run tests
run: |
# Minimal deps only; avoid picking up conftest and fixtures
uv run pytest -v -c /dev/null -p no:sc2ts_fixtures tests/test_api.py
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Lint

on:
pull_request:
merge_group:

jobs:
lint:
uses: tskit-dev/.github/.github/workflows/lint.yml@v14
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests

on:
pull_request:
push:
branches: [main, test]
merge_group:

jobs:
packaging:
name: Python packaging
uses: tskit-dev/.github/.github/workflows/python-packaging.yml@v14

test:
name: Python
uses: tskit-dev/.github/.github/workflows/python-tests.yml@v14
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python }}
coverage-directory: sc2ts
secrets: inherit
strategy:
matrix:
python: [3.11, 3.13]
os: [macos-latest, ubuntu-24.04]
47 changes: 47 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Python release

on:
push:
branches: [test-publish]
release:
types: [published]

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
version: "0.8.15"
- run: uv build
- uses: actions/upload-artifact@v4.6.1
with:
name: dist
path: dist/

publish:
runs-on: ubuntu-24.04
environment: release
needs: [build]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4.2.0
with:
name: dist
path: dist

- name: Publish to Test PyPI
if: github.event_name == 'push' && github.ref_name == 'test-publish'
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
repository-url: https://test.pypi.org/legacy/
verbose: true

- name: Publish to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@v1.13.0
14 changes: 2 additions & 12 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# Need to set PYTHONPATH so that we pick up the local sc2ts
PYPATH=${PWD}/..
SC2TS_VERSION:=$(shell PYTHONPATH=${PYPATH} \
python3 -c 'import sc2ts; print(sc2ts.__version__.split("+")[0])')

dev:
PYTHONPATH=${PYPATH} ./build.sh

dist:
@echo Building distribution for sc2ts version ${SC2TS_VERSION}
sed -i s/__SC2TS_VERSION__/${SC2TS_VERSION}/g _config.yml
PYTHONPATH=${PYPATH} ./build.sh
all:
./build.sh

clean:
rm -fR _build

2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sphinx:
navigation_with_keys: false
pygments_dark_style: monokai
logo:
text: "Version __SC2TS_VERSION__"
text: "Version __PKG_VERSION__"

myst_enable_extensions:
- colon_fence
Expand Down
3 changes: 1 addition & 2 deletions docs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

REPORTDIR=_build/html/reports

jupyter-book build -W .
uv run --project=../python --group docs jupyter-book build . -vnW --keep-going
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
if [ -e $REPORTDIR ]; then
Expand All @@ -18,4 +18,3 @@ else
rm -f $REPORTDIR/*
fi
exit $RETVAL

2 changes: 1 addition & 1 deletion docs/make_sc2ts_arg_subset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tszip
import numpy as np
import tszip

ts = tszip.load("sc2ts_viridian_v1.2.trees.tsz")

Expand Down
1 change: 0 additions & 1 deletion docs/make_viridian_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
path = f"viridian_mafft_subset_{k}_v1.vcz"
ds.copy(path, sample_id=samples)
sc2ts.Dataset.create_zip(path, path + ".zip")

40 changes: 40 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# The prek configuration defining linting requirements. This
# setup is optimised for long-term stability and determinism,
# and therefore only uses either "builtin" rules or "local"
# rules implementing lint workflows. We do not use any remote
# workflow repos.

[[repos]]
repo = "builtin"
hooks = [
{ id = "check-added-large-files" },
{ id = "check-merge-conflict" },
{ id = "mixed-line-ending" },
{ id = "check-case-conflict" },
{ id = "check-yaml" },
{ id = "check-toml" },
]

[[repos]]
repo = "local"
hooks = [
{
id = "ruff-check",
name = "ruff check",
language = "system",
entry = "uv run --only-group lint ruff check --fix --force-exclude",
types = ["python"],
},
]

[[repos]]
repo = "local"
hooks = [
{
id = "ruff-format",
name = "ruff format",
language = "system",
entry = "uv run --only-group lint ruff format --force-exclude",
types = ["python"],
},
]
Loading