From 4753534fb8aaaf5ae7fcab4b273f4326cf214cd4 Mon Sep 17 00:00:00 2001
From: scverse-bot <108668866+scverse-bot@users.noreply.github.com>
Date: Wed, 2 Apr 2025 18:26:02 +0000
Subject: [PATCH 1/3] Automated template update to v0.5.0
---
.cruft.json | 19 +++-
.github/ISSUE_TEMPLATE/bug_report.yml | 123 ++++++++++++++------------
.github/workflows/build.yaml | 22 +++--
.github/workflows/release.yaml | 15 ++--
.github/workflows/test.yaml | 36 +++-----
.pre-commit-config.yaml | 11 +--
.prettierrc.yaml | 7 --
.vscode/extensions.json | 2 +-
.vscode/settings.json | 6 +-
biome.jsonc | 16 ++++
docs/contributing.md | 23 +++--
docs/extensions/typed_returns.py | 2 +-
pyproject.toml | 4 +-
13 files changed, 157 insertions(+), 129 deletions(-)
delete mode 100644 .prettierrc.yaml
create mode 100644 biome.jsonc
diff --git a/.cruft.json b/.cruft.json
index 70e04c5..58fab17 100644
--- a/.cruft.json
+++ b/.cruft.json
@@ -1,7 +1,7 @@
{
"template": "https://github.com/scverse/cookiecutter-scverse",
- "commit": "5d44c58df427f884585ae9772cae81f1b6638f80",
- "checkout": null,
+ "commit": "94ef9fb6f9ad8cfe65a3d9575679c03c80c49cd1",
+ "checkout": "v0.5.0",
"context": {
"cookiecutter": {
"project_name": "cell-annotator",
@@ -18,12 +18,25 @@
".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"
+ "_template": "https://github.com/scverse/cookiecutter-scverse",
+ "_commit": "94ef9fb6f9ad8cfe65a3d9575679c03c80c49cd1"
}
},
"directory": null
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index a5a20e6..3ca1ccb 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -23,67 +23,72 @@ body:
- type: textarea
id: versions
attributes:
- label: Version information
+ label: Versions
description: |
- Please paste below the output of
+ Which version of packages.
+
+ Please install `session-info2`, run the following command in a notebook,
+ click the “Copy as Markdown” button, then paste the results into the text box below.
+
+ ```python
+ In[1]: import session_info2; session_info2.session_info(dependencies=True)
+ ```
+
+ Alternatively, run this in a console:
```python
- import session_info
- session_info.show(html=False, dependencies=True)
+ >>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
```
+ render: python
placeholder: |
- -----
- anndata 0.8.0rc2.dev27+ge524389
- session_info 1.0.0
- -----
- asttokens NA
- awkward 1.8.0
- backcall 0.2.0
- cython_runtime NA
- dateutil 2.8.2
- debugpy 1.6.0
- decorator 5.1.1
- entrypoints 0.4
- executing 0.8.3
- h5py 3.7.0
- ipykernel 6.15.0
- jedi 0.18.1
- mpl_toolkits NA
- natsort 8.1.0
- numpy 1.22.4
- packaging 21.3
- pandas 1.4.2
- parso 0.8.3
- pexpect 4.8.0
- pickleshare 0.7.5
- pkg_resources NA
- prompt_toolkit 3.0.29
- psutil 5.9.1
- ptyprocess 0.7.0
- pure_eval 0.2.2
- pydev_ipython NA
- pydevconsole NA
- pydevd 2.8.0
- pydevd_file_utils NA
- pydevd_plugins NA
- pydevd_tracing NA
- pygments 2.12.0
- pytz 2022.1
- scipy 1.8.1
- setuptools 62.5.0
- setuptools_scm NA
- six 1.16.0
- stack_data 0.3.0
- tornado 6.1
- traitlets 5.3.0
- wcwidth 0.2.5
- zmq 23.1.0
- -----
- IPython 8.4.0
- jupyter_client 7.3.4
- jupyter_core 4.10.0
- -----
- Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) [GCC 10.3.0]
- Linux-5.18.6-arch1-1-x86_64-with-glibc2.35
- -----
- Session information updated at 2022-07-07 17:55
+ anndata 0.11.3
+ ---- ----
+ charset-normalizer 3.4.1
+ coverage 7.7.0
+ psutil 7.0.0
+ dask 2024.7.1
+ jaraco.context 5.3.0
+ numcodecs 0.15.1
+ jaraco.functools 4.0.1
+ Jinja2 3.1.6
+ sphinxcontrib-jsmath 1.0.1
+ sphinxcontrib-htmlhelp 2.1.0
+ toolz 1.0.0
+ session-info2 0.1.2
+ PyYAML 6.0.2
+ llvmlite 0.44.0
+ scipy 1.15.2
+ pandas 2.2.3
+ sphinxcontrib-devhelp 2.0.0
+ h5py 3.13.0
+ tblib 3.0.0
+ setuptools-scm 8.2.0
+ more-itertools 10.3.0
+ msgpack 1.1.0
+ sparse 0.15.5
+ wrapt 1.17.2
+ jaraco.collections 5.1.0
+ numba 0.61.0
+ pyarrow 19.0.1
+ pytz 2025.1
+ MarkupSafe 3.0.2
+ crc32c 2.7.1
+ sphinxcontrib-qthelp 2.0.0
+ sphinxcontrib-serializinghtml 2.0.0
+ zarr 2.18.4
+ asciitree 0.3.3
+ six 1.17.0
+ sphinxcontrib-applehelp 2.0.0
+ numpy 2.1.3
+ cloudpickle 3.1.1
+ sphinxcontrib-bibtex 2.6.3
+ natsort 8.4.0
+ jaraco.text 3.12.1
+ setuptools 76.1.0
+ Deprecated 1.2.18
+ packaging 24.2
+ python-dateutil 2.9.0.post0
+ ---- ----
+ Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0]
+ OS Linux-6.11.0-109019-tuxedo-x86_64-with-glibc2.39
+ Updated 2025-03-18 15:47
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index bfa2cf0..83e01a1 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -10,20 +10,24 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+defaults:
+ run:
+ # to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
+ shell: bash -euo pipefail {0}
+
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - name: Set up Python 3.12
- uses: actions/setup-python@v5
with:
- python-version: "3.12"
- cache: "pip"
- cache-dependency-path: "**/pyproject.toml"
- - name: Install build dependencies
- run: python -m pip install --upgrade pip wheel twine build
+ filter: blob:none
+ fetch-depth: 0
+ - name: Install uv
+ uses: astral-sh/setup-uv@v5
+ with:
+ cache-dependency-glob: pyproject.toml
- name: Build package
- run: python -m build
+ run: uv build
- name: Check package
- run: twine check --strict dist/*.whl
+ run: uvx twine check --strict dist/*.whl
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 5e92ca7..1b93b0d 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -4,6 +4,11 @@ on:
release:
types: [published]
+defaults:
+ run:
+ # to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
+ shell: bash -euo pipefail {0}
+
# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
jobs:
release:
@@ -19,11 +24,11 @@ jobs:
with:
filter: blob:none
fetch-depth: 0
- - uses: actions/setup-python@v5
+ - name: Install uv
+ uses: astral-sh/setup-uv@v5
with:
- python-version: "3.x"
- cache: "pip"
- - run: pip install build
- - run: python -m build
+ cache-dependency-glob: pyproject.toml
+ - name: Build package
+ run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 841bd7c..d5cfb2a 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -12,12 +12,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+defaults:
+ run:
+ # to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
+ shell: bash -euo pipefail {0}
+
jobs:
test:
runs-on: ${{ matrix.os }}
- defaults:
- run:
- shell: bash -e {0} # -e to fail on error
strategy:
fail-fast: false
@@ -40,28 +42,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Set up Python ${{ matrix.python }}
- uses: actions/setup-python@v5
with:
- python-version: ${{ matrix.python }}
- cache: "pip"
- cache-dependency-path: "**/pyproject.toml"
-
- - name: Install test dependencies
- run: |
- python -m pip install --upgrade pip wheel
- - name: Install dependencies
- run: |
- pip install ${{ matrix.pip-flags }} ".[dev,test]"
- - name: Test
+ filter: blob:none
+ fetch-depth: 0
+ - name: Install uv
+ uses: astral-sh/setup-uv@v5
+ with:
+ cache-dependency-glob: pyproject.toml
+ - name: run tests using hatch
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
- run: |
- coverage run -m pytest -v --color=yes
- - name: Report coverage
- run: |
- coverage report
+ run: uvx hatch test --cover --python ${{ matrix.python }}
- name: Upload coverage
- uses: codecov/codecov-action@v3
+ uses: codecov/codecov-action@v4
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7f762b1..0fcce11 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -6,16 +6,17 @@ default_stages:
- pre-push
minimum_pre_commit_version: 2.16.0
repos:
- - repo: https://github.com/pre-commit/mirrors-prettier
- rev: v4.0.0-alpha.8
+ - repo: https://github.com/biomejs/pre-commit
+ rev: v1.9.4
hooks:
- - id: prettier
+ - 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.5.0
+ rev: v2.5.1
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.8.2
+ rev: v0.11.2
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
diff --git a/.prettierrc.yaml b/.prettierrc.yaml
deleted file mode 100644
index 9aaffcb..0000000
--- a/.prettierrc.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-overrides:
- # JSON with comments and trailing commas
- - files: .vscode/*.json
- options:
- parser: json5
- quoteProps: preserve
- singleQuote: false
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index a6fa580..caaeb4f 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -13,6 +13,6 @@
// Linting and formatting
"editorconfig.editorconfig",
"charliermarsh.ruff",
- "esbenp.prettier-vscode",
+ "biomejs.biome",
],
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index b6715d6..e034b91 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,5 @@
{
- "[python][jsonc][yaml]": {
+ "[python][json][jsonc]": {
"editor.formatOnSave": true,
},
"[python]": {
@@ -9,8 +9,8 @@
"source.organizeImports": "always",
},
},
- "[jsonc][yaml]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode",
+ "[json][jsonc]": {
+ "editor.defaultFormatter": "biomejs.biome",
},
"python.analysis.typeCheckingMode": "basic",
"python.testing.pytestEnabled": true,
diff --git a/biome.jsonc b/biome.jsonc
new file mode 100644
index 0000000..2175c16
--- /dev/null
+++ b/biome.jsonc
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
+ "formatter": { "useEditorconfig": true },
+ "overrides": [
+ {
+ "include": ["./.vscode/*.json", "**/*.jsonc"],
+ "json": {
+ "formatter": { "trailingCommas": "all" },
+ "parser": {
+ "allowComments": true,
+ "allowTrailingCommas": true,
+ },
+ },
+ },
+ ],
+}
diff --git a/docs/contributing.md b/docs/contributing.md
index c5c976d..3036b1b 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -67,13 +67,12 @@ to integrate the changes into yours.
While the [pre-commit.ci][] is useful, we strongly encourage installing and running pre-commit locally first to understand its usage.
Finally, most editors have an _autoformat on save_ feature.
-Consider enabling this option for [ruff][ruff-editors] and [prettier][prettier-editors].
+Consider enabling this option for [ruff][ruff-editors] and [biome][biome-editors].
[pre-commit]: https://pre-commit.com/
[pre-commit.ci]: https://pre-commit.ci/
[ruff-editors]: https://docs.astral.sh/ruff/integrations/
-
-[prettier-editors]: https://prettier.io/docs/en/editors.html
+[biome-editors]: https://biomejs.dev/guides/integrate-in-editor/
(writing-tests)=
@@ -155,11 +154,11 @@ This will automatically create a git tag and trigger a Github workflow that crea
Please write documentation for new or changed features and use-cases.
This project uses [sphinx][] with the following features:
-- The [myst][] extension allows to write documentation in markdown/Markedly Structured Text
-- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
-- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
-- [sphinx-autodoc-typehints][], to automatically reference annotated input and output types
-- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
+- The [myst][] extension allows to write documentation in markdown/Markedly Structured Text
+- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
+- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
+- [sphinx-autodoc-typehints][], to automatically reference annotated input and output types
+- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
See scanpy’s {doc}`scanpy:dev/documentation` for more information on how to write your own.
@@ -183,10 +182,10 @@ please check out [this feature request][issue-render-notebooks] in the `cookiecu
#### Hints
-- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`.
- Only if you do so can sphinx automatically create a link to the external documentation.
-- If building the documentation fails because of a missing link that is outside your control,
- you can add an entry to the `nitpick_ignore` list in `docs/conf.py`
+- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`.
+ Only if you do so can sphinx automatically create a link to the external documentation.
+- If building the documentation fails because of a missing link that is outside your control,
+ you can add an entry to the `nitpick_ignore` list in `docs/conf.py`
(docs-building)=
diff --git a/docs/extensions/typed_returns.py b/docs/extensions/typed_returns.py
index 1135204..0fbffef 100644
--- a/docs/extensions/typed_returns.py
+++ b/docs/extensions/typed_returns.py
@@ -12,7 +12,7 @@
def _process_return(lines: Iterable[str]) -> Generator[str, None, None]:
for line in lines:
if m := re.fullmatch(r"(?P\w+)\s+:\s+(?P[\w.]+)", line):
- yield f'-{m["param"]} (:class:`~{m["type"]}`)'
+ yield f"-{m['param']} (:class:`~{m['type']}`)"
else:
yield line
diff --git a/pyproject.toml b/pyproject.toml
index 8b74f3a..abb0935 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -25,7 +25,7 @@ classifiers = [
dependencies = [
"anndata",
# for debug logging (referenced from the issue template)
- "session-info",
+ "session-info2",
]
optional-dependencies.dev = [
"pre-commit",
@@ -37,7 +37,7 @@ optional-dependencies.doc = [
"ipython",
"myst-nb>=1.1",
"pandas",
- # Until pybtex >0.23.0 releases: https://bitbucket.org/pybtex-devs/pybtex/issues/169/
+ # Until pybtex >0.24.0 releases: https://bitbucket.org/pybtex-devs/pybtex/issues/169/
"setuptools",
"sphinx>=4",
"sphinx-autodoc-typehints",
From 04d6aa24315ed9373fedeab11de107d1faebd508 Mon Sep 17 00:00:00 2001
From: Marius Lange
Date: Thu, 10 Apr 2025 11:11:16 +0200
Subject: [PATCH 2/3] Revert changes to the test workflow
---
.github/workflows/test.yaml | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 8228e82..fd08ef5 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -12,14 +12,12 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
-defaults:
- run:
- # to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
- shell: bash -euo pipefail {0}
-
jobs:
test:
runs-on: ${{ matrix.os }}
+ defaults:
+ run:
+ shell: bash -e {0} # -e to fail on error
strategy:
fail-fast: false
@@ -43,23 +41,29 @@ jobs:
steps:
- uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python }}
+ uses: actions/setup-python@v5
with:
- filter: blob:none
- fetch-depth: 0
- - name: Install uv
- uses: astral-sh/setup-uv@v5
- with:
- cache-dependency-glob: pyproject.toml
- - name: run tests using hatch
+ python-version: ${{ matrix.python }}
+ cache: "pip"
+ cache-dependency-path: "**/pyproject.toml"
+
+ - name: Install test dependencies
+ run: |
+ python -m pip install --upgrade pip wheel
+ - name: Install dependencies
+ run: |
+ pip install ${{ matrix.pip-flags }} ".[dev,test]"
+ - name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
if [ "${{ matrix.python }}" == "3.12" ] && [ -z "${{ matrix.pip-flags }}" ]; then
- uvx hatch test --cover --python ${{ matrix.python }}
+ coverage run -m pytest -v --color=yes
else
- uvx hatch test --cover --python ${{ matrix.python }} -m "not openai"
+ coverage run -m pytest -v --color=yes -m "not openai"
fi
- name: Report coverage
run: |
From 87d6ccd9909f19c8115ea911233595158d380722 Mon Sep 17 00:00:00 2001
From: Marius Lange
Date: Thu, 17 Apr 2025 10:41:48 +0200
Subject: [PATCH 3/3] Adapt the test workflow
---
.github/workflows/test.yaml | 35 ++++++++++++++---------------------
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index fd08ef5..b679568 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -12,12 +12,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+defaults:
+ run:
+ # to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
+ shell: bash -euo pipefail {0}
+
jobs:
test:
runs-on: ${{ matrix.os }}
- defaults:
- run:
- shell: bash -e {0} # -e to fail on error
strategy:
fail-fast: false
@@ -41,33 +43,24 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Set up Python ${{ matrix.python }}
- uses: actions/setup-python@v5
with:
- python-version: ${{ matrix.python }}
- cache: "pip"
- cache-dependency-path: "**/pyproject.toml"
-
- - name: Install test dependencies
- run: |
- python -m pip install --upgrade pip wheel
- - name: Install dependencies
- run: |
- pip install ${{ matrix.pip-flags }} ".[dev,test]"
- - name: Test
+ filter: blob:none
+ fetch-depth: 0
+ - name: Install uv
+ uses: astral-sh/setup-uv@v5
+ with:
+ cache-dependency-glob: pyproject.toml
+ - name: run tests using hatch
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
if [ "${{ matrix.python }}" == "3.12" ] && [ -z "${{ matrix.pip-flags }}" ]; then
- coverage run -m pytest -v --color=yes
+ uvx hatch test --cover --python ${{ matrix.python }}
else
- coverage run -m pytest -v --color=yes -m "not openai"
+ uvx hatch test --cover --python ${{ matrix.python }} -m "not openai"
fi
- - name: Report coverage
- run: |
- coverage report
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with: