Skip to content
Closed
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
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@v13
61 changes: 61 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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: Install package only
run: uv pip install -e .
- 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@v13
12 changes: 12 additions & 0 deletions .github/workflows/python-packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Packaging

on:
pull_request:
merge_group:

jobs:
packaging:
uses: tskit-dev/.github/.github/workflows/python-packaging.yml@v13
with:
pyproject-directory: .
cli-test-cmd: sc2ts --help
22 changes: 22 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Tests

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

jobs:
test:
name: Python
uses: tskit-dev/.github/.github/workflows/python-tests.yml@v13
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python }}
pyproject-directory: .
coverage-directory: sc2ts
secrets: inherit
strategy:
matrix:
python: ["3.10", "3.13"]
os: [macos-latest, ubuntu-24.04, windows-latest]
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 = "ruff check --fix --force-exclude",
types = ["python"],
},
]

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