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
4 changes: 2 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": "19cf7596149bdeb1b8354aa3947c862f34d50b58",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"trim_blocks": true
},
"_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
"_commit": "1da1d71043735a63d87f13e16caf5d9b90b3ba56"
"_commit": "19cf7596149bdeb1b8354aa3947c862f34d50b58"
}
},
"directory": null
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.4.16
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.23.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
rev: v0.15.15
hooks:
- id: ruff-check
types_or: [python, pyi, jupyter]
Expand Down
7 changes: 6 additions & 1 deletion docs/template_usage.md
Original file line number Diff line number Diff line change
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
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