Skip to content

Commit b7b69ac

Browse files
committed
Add GitHub Actions CI and the maintainer-scripts README
1 parent 0a9f4a1 commit b7b69ac

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
# A push that obsoletes a previous run cancels it.
10+
concurrency:
11+
group: ci-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
name: ruff
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
cache: pip
24+
cache-dependency-path: pyproject.toml
25+
- run: pip install --upgrade pip
26+
- run: pip install ruff
27+
- run: ruff check .
28+
29+
test:
30+
name: pytest (py${{ matrix.python }})
31+
runs-on: ubuntu-latest
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
python: ["3.11", "3.12", "3.13"]
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.python }}
41+
cache: pip
42+
cache-dependency-path: pyproject.toml
43+
- run: pip install --upgrade pip
44+
# ``-e .[dev,plotting,excel]`` so every optional extra is exercised.
45+
# Gurobi is not installable on free runners; the relevant tests
46+
# skip themselves when ``optlang.gurobi_interface`` cannot import.
47+
- run: pip install -e ".[dev,plotting,excel]"
48+
- run: pytest -q --maxfail=5 --durations=20

scripts/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Maintainer scripts
2+
3+
Release-time tooling. Not part of the installed package — run them from a checkout
4+
with raven-python installed (`pip install -e .`). End users never need these.
5+
6+
## `build_kegg_artefacts.py`
7+
8+
Build the publishable KEGG artefact set from an arranged KEGG dump (see
9+
`download_kegg_dump`): the gzipped-YAML reference model, the gzipped-TSV tables,
10+
and (with `--hmms`) the per-domain pressed HMM libraries. Output is laid out ready
11+
to upload as release assets. See [docs/maintaining_kegg_data.md](../docs/maintaining_kegg_data.md).
12+
13+
```bash
14+
python scripts/build_kegg_artefacts.py --keggdb keggdb --out artefacts # tables + model
15+
python scripts/build_kegg_artefacts.py --keggdb keggdb --out artefacts --hmms --threads 8
16+
```
17+
18+
## `make_registry_snippet.py`
19+
20+
After uploading the files to a release, compute their SHA256 and print the entry
21+
to merge into the runtime registry — `raven_python.data._DATA_REGISTRY` (data) or
22+
`raven_python.binaries._REGISTRY` (binary ZIP bundles). The checksum helper is shared
23+
with the resolvers, so published checksums always match what `ensure_data` /
24+
`ensure_binary` verify.
25+
26+
```bash
27+
# Data artefacts:
28+
python scripts/make_registry_snippet.py data --dataset kegg --version kegg116 \
29+
--dir artefacts --base-url https://github.com/ORG/raven-python/releases/download/kegg-data-kegg116
30+
31+
# Binary bundle (ZIPs named <bundle>-<version>-<os>-<arch>.zip):
32+
python scripts/make_registry_snippet.py binary --bundle blast --version 2.16.0 \
33+
--provides blastp makeblastdb --dir zips \
34+
--base-url https://github.com/ORG/raven-python/releases/download/blast-2.16.0
35+
```

0 commit comments

Comments
 (0)