Skip to content
Open
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
5 changes: 3 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
"commit": "1da1d71043735a63d87f13e16caf5d9b90b3ba56",
"commit": "cbafcbbeff2bbca28611c051521a34f6e0dd17b3",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -13,6 +13,7 @@
"github_repo": "cookiecutter-scverse-instance",
"license": "BSD 3-Clause License",
"ide_integration": true,
"issue_categorization": "labels",
"_copy_without_render": [
".github/workflows/build.yaml",
".github/workflows/test.yaml",
Expand All @@ -36,7 +37,7 @@
"trim_blocks": true
},
"_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
"_commit": "1da1d71043735a63d87f13e16caf5d9b90b3ba56"
"_commit": "cbafcbbeff2bbca28611c051521a34f6e0dd17b3"
}
},
"directory": null
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Report something that is broken or incorrect
type: Bug
labels: bug
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature request
description: Propose a new feature for cookiecutter-scverse-instance
type: Enhancement
labels: enhancement
body:
- type: textarea
id: description
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
needs: get-environments
permissions:
id-token: write # for codecov OIDC
contents: read

strategy:
fail-fast: false
Expand Down Expand Up @@ -80,12 +81,12 @@ jobs:
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
# See https://coverage.readthedocs.io/page/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@v5
uses: codecov/codecov-action@v6
with:
fail_ci_if_error: true
use_oidc: true
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/biomejs/pre-commit
rev: v2.4.6
rev: v2.5.0
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.16.2
rev: v2.24.1
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
rev: v0.15.17
hooks:
- id: ruff-check
types_or: [python, pyi, jupyter]
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://docs.readthedocs.io/en/stable/config-file/v2.html
# https://docs.readthedocs.io/page/config-file/v2.html
version: 2
build:
os: ubuntu-24.04
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog][],
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
[keep a changelog]: https://keepachangelog.com/
[semantic versioning]: https://semver.org/

## [Unreleased]

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Documentation][badge-docs]][documentation]

[badge-tests]: https://img.shields.io/github/actions/workflow/status/scverse/cookiecutter-scverse-instance/test.yaml?branch=main
[badge-docs]: https://img.shields.io/readthedocs/cookiecutter-scverse-instance
[badge-docs]: https://app.readthedocs.org/projects/cookiecutter-scverse-instance/badge/

An example repo generated from the `cookiecutter-scverse` template.

Expand Down Expand Up @@ -52,6 +52,6 @@ If you found a bug, please use the [issue tracker][].
[issue tracker]: https://github.com/scverse/cookiecutter-scverse-instance/issues
[tests]: https://github.com/scverse/cookiecutter-scverse-instance/actions/workflows/test.yaml
[documentation]: https://cookiecutter-scverse-instance.readthedocs.io
[changelog]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/changelog.html
[api documentation]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/api.html
[changelog]: https://cookiecutter-scverse-instance.readthedocs.io/page/changelog.html
[api documentation]: https://cookiecutter-scverse-instance.readthedocs.io/page/api.html
[pypi]: https://pypi.org/project/cookiecutter-scverse-instance
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# https://www.sphinx-doc.org/page/usage/configuration.html

# -- Path setup --------------------------------------------------------------
import shutil
Expand Down Expand Up @@ -97,8 +97,8 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
"anndata": ("https://anndata.scverse.org/en/stable/", None),
"scanpy": ("https://scanpy.scverse.org/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
}

Expand Down
12 changes: 6 additions & 6 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the [scientific Python tutorials][], or the [scanpy developer guide][].

[pyopensci tutorials]: https://www.pyopensci.org/learn.html
[scientific Python tutorials]: https://learn.scientific-python.org/development/tutorials/
[scanpy developer guide]: https://scanpy.readthedocs.io/en/latest/dev/index.html
[scanpy developer guide]: https://scanpy.scverse.org/page/dev/

:::{tip} The *hatch* project manager

Expand Down Expand Up @@ -275,11 +275,11 @@ This project uses [sphinx][] with the following features:

See scanpy’s {doc}`scanpy:dev/documentation` for more information on how to write your own.

[sphinx]: https://www.sphinx-doc.org/en/master/
[myst]: https://myst-parser.readthedocs.io/en/latest/intro.html
[myst-nb]: https://myst-nb.readthedocs.io/en/latest/
[numpydoc-napoleon]: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
[numpydoc]: https://numpydoc.readthedocs.io/en/latest/format.html
[sphinx]: https://www.sphinx-doc.org/
[myst]: https://myst-parser.readthedocs.io/page/intro.html
[myst-nb]: https://myst-nb.readthedocs.io/
[numpydoc-napoleon]: https://www.sphinx-doc.org/page/usage/extensions/napoleon.html
[numpydoc]: https://numpydoc.readthedocs.io/page/format.html
[sphinx-autodoc-typehints]: https://github.com/tox-dev/sphinx-autodoc-typehints

### Tutorials with myst-nb and jupyter notebooks
Expand Down
5 changes: 4 additions & 1 deletion docs/notebooks/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
"\n",
"Again, check the raw markdown of this cell to see how each of these links are specified.\n",
"\n",
"You can read more about this in the [intersphinx page](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) and the [myst page](https://myst-parser.readthedocs.io/en/v0.15.1/syntax/syntax.html#roles-an-in-line-extension-point)."
"You can read more about this in the [intersphinx page] and the [myst page].\n",
"\n",
"[intersphinx page]: https://www.sphinx-doc.org/page/usage/extensions/intersphinx.html\n",
"[myst page]: https://myst-parser.readthedocs.io/page/syntax/roles-and-directives.html#roles-an-in-line-extension-point"
]
},
{
Expand Down
17 changes: 11 additions & 6 deletions docs/template_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ While the repository at this point can be directly used, there are few remaining

Modern Python package management uses a `pyproject.toml` that was first introduced in [PEP 518](https://peps.python.org/pep-0518/).
This file contains build system requirements and information, which are used by pip to build the package, and tool configurations.
For more details please have a look at [pip's description of the pyproject.toml file](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/).
For more details please have a look at [pip's description of the pyproject.toml file](https://pip.pypa.io/page/reference/build-system/).
It also serves as a single point of truth to define test environments and how docs are built by leveraging
the [hatch][] project manager, but more about that in the [contributing guide](contributing.md).

Expand Down Expand Up @@ -113,10 +113,10 @@ On the RTD dashboard choose "Import a Project" and follow the instructions to ad
For more information, please refer to the [official RTD documentation][rtd-prs].

If your project is private, there are ways to enable docs rendering on [readthedocs.org][] but it is more cumbersome and requires a different RTD subscription.
See a guide [here](https://docs.readthedocs.io/en/stable/guides/importing-private-repositories.html).
See a guide [here](https://docs.readthedocs.io/page/guides/importing-private-repositories.html).

[readthedocs.org]: https://readthedocs.org/
[rtd-prs]: https://docs.readthedocs.io/en/stable/pull-requests.html
[rtd-prs]: https://docs.readthedocs.io/page/pull-requests.html

(github-actions)=

Expand Down Expand Up @@ -147,7 +147,8 @@ There you can see the execution history, logs, and (re-)trigger workflows manual

## Automating the PyPI release using GitHub actions

Tags adhering to `"*.*.*"` that are pushed to the `main` branch will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][].
Releases created via the [Github releases UI][github-releases]
will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][].

For this to work, you'll need to setup GitHub as a [trusted publisher][] on PyPI.
To set this up, login to [PyPI][], and proceed depending on whether you already have your project on there or not:
Expand All @@ -159,6 +160,10 @@ The "Workflow name" needs to bet set to `release.yaml`.
Set "Environment name" to “pypi” to match `environment: pypi` in `.github/workflows/release.yaml`.
For more details, please refer to the official [PyPI guide for setting up trusted publishing][trusted publisher].

If you added a new pending publisher to set up your project,
the project will be published only once you release your package for the first time (see above).

[github-releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
[pypi-trusted-publishing-guide]: https://docs.pypi.org/trusted-publishers/adding-a-publisher/

[PyPI]: https://pypi.org/
Expand Down Expand Up @@ -295,7 +300,7 @@ add it to Ruff’s [`external = [...]`][ruff-external] setting to prevent `RUF10
[biome]: https://biomejs.dev/
[pre-commit]: https://pre-commit.com/
[pre-commit.ci]: https://pre-commit.ci/
[pyproject-fmt]: https://pyproject-fmt.readthedocs.io/en/latest/index.html
[pyproject-fmt]: https://pyproject-fmt.readthedocs.io/
[ruff]: https://docs.astral.sh/ruff/
[ruff-config]: https://docs.astral.sh/ruff/configuration/
[ruff-error-suppression]: https://docs.astral.sh/ruff/linter/#error-suppression
Expand All @@ -317,7 +322,7 @@ there may also be good reasons to choose a different approach, e.g. using an obj

[anndata]: https://github.com/scverse/anndata
[mudata]: https://github.com/scverse/mudata
[scanpy-api]: https://scanpy.readthedocs.io/en/stable/usage-principles.html
[scanpy-api]: https://scanpy.scverse.org/page/usage-principles.html
[spatialdata]: https://github.com/scverse/spatialdata

(vcs-based-versioning)=
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ doc = [
[tool.hatch]
envs.default.installer = "uv"
envs.default.dependency-groups = [ "dev" ]
envs.docs.dependency-groups = [ "doc" ]
envs.docs.scripts.build = "sphinx-build -M html docs docs/_build -W {args}"
envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
envs.docs.scripts.clean = "git clean -fdX -- {args:docs}"
envs.hatch-test.dependency-groups = [ "dev", "test" ]
envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
envs.docs.dependency-groups = [ "doc" ]
envs.hatch-test.matrix = [
# Test the lowest and highest supported Python versions with normal deps
{ deps = [ "stable" ], python = [ "3.11", "3.14" ] },
Expand All @@ -74,8 +73,9 @@ envs.hatch-test.matrix = [
# If the matrix variable `deps` is set to "pre",
# set the environment variable `UV_PRERELEASE` to "allow".
envs.hatch-test.overrides.matrix.deps.env-vars = [
{ key = "UV_PRERELEASE", value = "allow", if = [ "pre" ] },
{ value = "allow", key = "UV_PRERELEASE", if = [ "pre" ] },
]
envs.hatch-test.dependency-groups = [ "dev", "test" ]

[tool.ruff]
line-length = 120
Expand Down Expand Up @@ -116,11 +116,11 @@ lint.per-file-ignores."tests/*" = [ "D" ]
lint.pydocstyle.convention = "numpy"

[tool.pytest]
strict = true
testpaths = [ "tests" ]
addopts = [
"--import-mode=importlib", # allow using test files with same name
]
strict = true
testpaths = [ "tests" ]

[tool.coverage]
run.omit = [
Expand Down
4 changes: 0 additions & 4 deletions src/cookiecutter_scverse_instance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from importlib.metadata import version

from . import pl, pp, tl

__all__ = ["pl", "pp", "tl"]

__version__ = version("cookiecutter-scverse-instance")
4 changes: 0 additions & 4 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import cookiecutter_scverse_instance


def test_package_has_version():
assert cookiecutter_scverse_instance.__version__ is not None


@pytest.mark.skip(reason="This decorator should be removed when test passes.")
def test_example():
assert 1 == 0 # This test is designed to fail.
Expand Down