Skip to content

Adopt cookiecutter-scverse v0.8.0 CI/security hardening - #1257

Merged
timtreis merged 5 commits into
mainfrom
template-v0.8.0-hardening
Aug 12, 2026
Merged

timtreis merged 5 commits into
mainfrom
template-v0.8.0-hardening

Conversation

@timtreis

@timtreis timtreis commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Cherry-picks the low-risk, high-value parts of the v0.8.0 template sync (#1242), leaving squidpy's customized theme, dependencies, and squidpy-specific CI jobs intact.

CI / security hardening

  • pre-commit: add zizmor hook; bump biome/pyproject-fmt/ruff.
  • dependabot: new, weekly grouped github-actions updates (pairs with SHA pinning).
  • build/release/test workflows: pin actions to immutable SHAs, add least-privilege permissions: blocks, persist-credentials: false.
  • test workflow: codecov upload via OIDC (use_oidc: true, drops CODECOV_TOKEN). Kept: ensure-data-is-cached, data cache, system deps + Xvfb, macOS matrix, figure artifacts.
  • readthedocs: build on Python 3.14 + nodejs; kept the docs/notebooks submodule + UV_CONSTRAINT.
  • cruft: record the v0.8.0 sync so the next auto-sync diffs from v0.8.0.

Docs

  • Adopt scverse_misc.sphinx_ext (v0.8.0 moved shared sphinx extensions into the scverse-misc package) and drop the local docs/extensions/typed_returns.py monkeypatch. Adds scverse-misc[sphinx] to the docs group. Theme, intersphinx, and the rest of conf.py stay squidpy's.
  • pyproject.toml also carries the pyproject-fmt normalization from the bumped hook (pre-commit.ci).

Deliberately NOT taken from #1242

Template's pyproject.toml (reverts deps/version/authorship to the seed skeleton), the full docs/conf.py rewrite (theme swap sphinx_rtd_theme -> sphinx_book_theme), docs/_static/css/custom.css (deletes 122 lines), .vscode/*, docs/changelog.md, and the stricter ruff D/TID/RUF100 rules (worth a separate PR).

Supersedes #1242, which should be closed.

Note: the scverse_misc.sphinx_ext swap is verified by the RTD preview build on this PR, not locally.

timtreis and others added 3 commits August 11, 2026 23:57
Cherry-picks the low-risk, high-value parts of the v0.8.0 template sync
(PR #1242) while keeping squidpy's customized pyproject.toml, docs/conf.py,
custom.css, gitignore, and the squidpy-specific CI jobs untouched.

- pre-commit: add zizmor hook; bump biome/pyproject-fmt/ruff hooks
- add dependabot for github-actions (weekly, grouped)
- build/release/test workflows: pin actions to immutable SHAs, add
  least-privilege permissions blocks, persist-credentials: false
- test workflow: switch codecov upload to OIDC (drop CODECOV_TOKEN),
  keeping the data-cache job, system deps + Xvfb, macOS matrix and
  figure artifacts
- readthedocs: build on Python 3.14 + nodejs, keep notebooks submodule
- cruft: record v0.8.0 sync
v0.8.0 moved shared sphinx extensions into the scverse-misc package.
Replace the local docs/extensions/typed_returns.py monkeypatch with
scverse_misc.sphinx_ext and add scverse-misc[sphinx] to the docs group.
Theme, intersphinx and the rest of conf.py stay as squidpy's.
@timtreis
timtreis force-pushed the template-v0.8.0-hardening branch from 2f7925c to 5c70dde Compare August 11, 2026 22:11
timtreis and others added 2 commits August 12, 2026 00:15
Pin actions to immutable SHAs, add a least-privilege permissions block,
and set persist-credentials: false. Same hardening the template applies
to the other workflows; zizmor (added in this PR) flagged this
squidpy-specific workflow.
@timtreis
timtreis marked this pull request as ready for review August 11, 2026 22:23
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.62%. Comparing base (959a73e) to head (2b89b07).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1257   +/-   ##
=======================================
  Coverage   78.62%   78.62%           
=======================================
  Files          63       63           
  Lines        9330     9330           
  Branches     1557     1557           
=======================================
  Hits         7336     7336           
  Misses       1422     1422           
  Partials      572      572           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timtreis
timtreis requested a review from selmanozleyen August 11, 2026 22:45
Comment thread pyproject.toml
"ipywidgets>=8",
"myst-nb>=0.17.1",
"nbsphinx>=0.8.1",
"scverse-misc[sphinx]>=0.1.2,<0.2",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reasons for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inclusion or the upper pin?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upper pin

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case some 0.2+ release changes anything, I'd rather introduce this with a controlled PR than having a sudden breakage 🤷

@selmanozleyen selmanozleyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this has been bugging me for a while as well

@timtreis
timtreis merged commit e276aa4 into main Aug 12, 2026
13 checks passed
@timtreis
timtreis deleted the template-v0.8.0-hardening branch August 12, 2026 12:22
timtreis added a commit to timtreis/squidpy that referenced this pull request Aug 12, 2026
The v0.8.0 template sync (scverse#1257) deleted docs/extensions/typed_returns.py,
which renders numpy-style Returns type annotations as clean cross-references.
Without it, public functions annotated '-> NDArray' emit an unresolvable
numpy._typing._array_like.NDArray reference, and the docs build (run with -W)
fails. This is why main's Read the Docs build is currently red.

Restore the extension and re-register it in conf.py. Verified green with a
full 'sphinx-build -M html docs docs/_build -W'.
timtreis added a commit that referenced this pull request Aug 12, 2026
The v0.8.0 template sync (#1257) deleted docs/extensions/typed_returns.py,
which renders numpy-style Returns type annotations as clean cross-references.
Without it, public functions annotated '-> NDArray' emit an unresolvable
numpy._typing._array_like.NDArray reference, and the docs build (run with -W)
fails. This is why main's Read the Docs build is currently red.

Restore the extension and re-register it in conf.py. Verified green with a
full 'sphinx-build -M html docs docs/_build -W'.
@selmanozleyen selmanozleyen added the release-ignore Exclude from generated release notes label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-ignore Exclude from generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants