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
82 changes: 41 additions & 41 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"template": "https://github.com/scverse/cookiecutter-scverse",
"commit": "94ef9fb6f9ad8cfe65a3d9575679c03c80c49cd1",
"checkout": "v0.5.0",
"context": {
"cookiecutter": {
"project_name": "scirpy",
"package_name": "scirpy",
"project_description": "A very interesting piece of code",
"author_full_name": "Gregor Sturm",
"author_email": "[email protected]",
"github_user": "grst",
"github_repo": "scirpy",
"license": "BSD 3-Clause License",
"ide_integration": true,
"_copy_without_render": [
".github/workflows/build.yaml",
".github/workflows/test.yaml",
"docs/_templates/autosummary/**.rst"
],
"_exclude_on_template_update": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"docs/api.md",
"docs/index.md",
"docs/notebooks/example.ipynb",
"docs/references.bib",
"docs/references.md",
"src/**",
"tests/**"
],
"_render_devdocs": false,
"_jinja2_env_vars": {
"lstrip_blocks": true,
"trim_blocks": true
},
"_template": "https://github.com/scverse/cookiecutter-scverse",
"_commit": "94ef9fb6f9ad8cfe65a3d9575679c03c80c49cd1"
}
},
"directory": null
"template": "https://github.com/scverse/cookiecutter-scverse",
"commit": "d383d94fadff9e4e6fdb59d77c68cb900d7cedec",
"checkout": "v0.6.0",
"context": {
"cookiecutter": {
"project_name": "scirpy",
"package_name": "scirpy",
"project_description": "A very interesting piece of code",
"author_full_name": "Gregor Sturm",
"author_email": "[email protected]",
"github_user": "grst",
"github_repo": "scirpy",
"license": "BSD 3-Clause License",
"ide_integration": true,
"_copy_without_render": [
".github/workflows/build.yaml",
".github/workflows/test.yaml",
"docs/_templates/autosummary/**.rst"
],
"_exclude_on_template_update": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"docs/api.md",
"docs/index.md",
"docs/notebooks/example.ipynb",
"docs/references.bib",
"docs/references.md",
"src/**",
"tests/**"
],
"_render_devdocs": false,
"_jinja2_env_vars": {
"lstrip_blocks": true,
"trim_blocks": true
},
"_template": "https://github.com/scverse/cookiecutter-scverse",
"_commit": "d383d94fadff9e4e6fdb59d77c68cb900d7cedec"
}
},
"directory": null
}
80 changes: 62 additions & 18 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,48 @@ defaults:
shell: bash -euo pipefail {0}

jobs:
# Get the test environment from hatch as defined in pyproject.toml.
# This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
# run locally and on continuous integration.
# Check [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml and https://hatch.pypa.io/latest/environment/ for
# more details.
get-environments:
runs-on: ubuntu-latest
outputs:
envs: ${{ steps.get-envs.outputs.envs }}
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Get test environments
id: get-envs
run: |
ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
| map(
select(.key | startswith("hatch-test"))
| {
name: .key,
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
python: .value.python
}
)')
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT

# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
test:
runs-on: ${{ matrix.os }}
needs: get-environments

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: "3.10"
- os: ubuntu-latest
python: "3.12"
- os: ubuntu-latest
python: "3.12"
pip-flags: "--pre"
name: PRE-RELEASE DEPENDENCIES

name: ${{ matrix.name }} Python ${{ matrix.python }}

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
os: [ubuntu-latest]
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}

name: ${{ matrix.env.label }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -48,12 +69,35 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.env.python }}
cache-dependency-glob: pyproject.toml
- name: create hatch environment
run: uvx hatch env create ${{ matrix.env.name }}
- name: run tests using hatch
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: uvx hatch test --cover --python ${{ matrix.python }}
run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
- name: generate coverage report
run: |
# See https://coverage.readthedocs.io/en/latest/config.html#run-patch
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
- name: Upload coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5

# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
check:
name: Tests pass in all hatch environments
if: always()
needs:
- get-environments
- test
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
17 changes: 4 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/biomejs/pre-commit
rev: v2.2.3
rev: v2.2.6
hooks:
- id: biome-format
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.6.0
rev: v2.11.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.12
rev: v0.14.1
hooks:
- id: ruff
- id: ruff-check
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
Expand All @@ -36,12 +36,3 @@ repos:
# Check that there are no merge conflicts (could be generated by template sync)
- id: check-merge-conflict
args: [--assume-in-merge]
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit rej files
entry: |
Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
Fix the merge conflicts manually and remove the .rej files.
language: fail
files: '.*\.rej$'
29 changes: 10 additions & 19 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
# https://docs.readthedocs.io/en/stable/config-file/v2.html
version: 2
build:
os: ubuntu-20.04
os: ubuntu-24.04
tools:
python: "3.10"
python: "3.12"
jobs:
# workaround to properly install the airr package with all dependencies
post_install:
- python -m pip install --no-cache-dir yamlordereddictloader
# additional debugging information
pre_build:
- python -c "import scirpy"
- pip freeze
sphinx:
configuration: docs/conf.py
# disable this for more lenient docs builds
fail_on_warning: true
python:
install:
- method: pip
path: .
extra_requirements:
- doc
create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
build:
html:
- uvx hatch run docs:build
- mv docs/_build $READTHEDOCS_OUTPUT
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning][].
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## Unreleased

### Chore

- Template update to v0.6.0

## v0.22.3

### Fixes
Expand Down
5 changes: 3 additions & 2 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": { "useEditorconfig": true },
"overrides": [
{
"includes": [".vscode/**/*.json", "**/*.jsonc"],
"includes": ["./.vscode/*.json", "**/*.jsonc"],
"json": {
"formatter": { "trailingCommas": "all" },
"parser": {
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"sphinx.ext.napoleon",
"sphinxcontrib.bibtex",
"sphinx_autodoc_typehints",
"sphinx_tabs.tabs",
"sphinx.ext.mathjax",
"IPython.sphinxext.ipython_console_highlighting",
"sphinxext.opengraph",
Expand Down Expand Up @@ -185,4 +186,5 @@
("py:meth", "mudata.MuData.update"),
("py:class", "awkward.highlevel.Array"),
("py:class", "logomaker.src.Logo.Logo"),
("py:data", "typing.Union"),
]
Loading
Loading