Skip to content

Commit df101b4

Browse files
authored
Merge pull request #289 from scverse/template-v0.7.0
Update scverse template to v0.7.0
2 parents f9e9a3f + b6542bc commit df101b4

11 files changed

Lines changed: 74 additions & 77 deletions

File tree

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"template": "https://github.com/scverse/cookiecutter-scverse",
3-
"commit": "d383d94fadff9e4e6fdb59d77c68cb900d7cedec",
4-
"checkout": "v0.6.0",
3+
"commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95",
4+
"checkout": "v0.7.0",
55
"context": {
66
"cookiecutter": {
77
"project_name": "decoupler",

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug report
22
description: Report something that is broken or incorrect
3-
labels: bug
3+
type: Bug
44
body:
55
- type: markdown
66
attributes:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Feature request
22
description: Propose a new feature for decoupler
3-
labels: enhancement
3+
type: Enhancement
44
body:
55
- type: textarea
66
id: description

.github/workflows/build.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,16 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13-
defaults:
14-
run:
15-
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
16-
shell: bash -euo pipefail {0}
17-
1813
jobs:
1914
package:
2015
runs-on: ubuntu-latest
2116
steps:
22-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
2318
with:
2419
filter: blob:none
2520
fetch-depth: 0
2621
- name: Install uv
27-
uses: astral-sh/setup-uv@v5
28-
with:
29-
cache-dependency-glob: pyproject.toml
22+
uses: astral-sh/setup-uv@v7
3023
- name: Build package
3124
run: uv build
3225
- name: Check package

.github/workflows/notebooks.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
]
3838

3939
steps:
40-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v5
4141
with:
4242
filter: blob:none
4343
fetch-depth: 0
@@ -47,13 +47,11 @@ jobs:
4747
with:
4848
python-version: "3.13"
4949
- name: Install uv
50-
uses: astral-sh/setup-uv@v6
51-
with:
52-
enable-cache: true
53-
cache-dependency-glob: pyproject.toml
50+
uses: astral-sh/setup-uv@v7
5451
- name: Install dependencies
5552
run: |
56-
uv pip install --system ${{ matrix.pip-flags }} ".[dev,test]"
53+
uv pip install --system .
54+
uv pip install --system --group dev --group test
5755
uv pip install --system nbconvert ipykernel
5856
- name: Run ${{ matrix.notebook }} Notebook
5957
run: jupyter nbconvert --to notebook --execute ${{ env.NOTEBOOK_PATH }}/${{ matrix.notebook }}

.github/workflows/release.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ on:
44
release:
55
types: [published]
66

7-
defaults:
8-
run:
9-
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
10-
shell: bash -euo pipefail {0}
11-
127
# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
138
jobs:
149
release:
@@ -20,14 +15,12 @@ jobs:
2015
permissions:
2116
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
2217
steps:
23-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
2419
with:
2520
filter: blob:none
2621
fetch-depth: 0
2722
- name: Install uv
28-
uses: astral-sh/setup-uv@v5
29-
with:
30-
cache-dependency-glob: pyproject.toml
23+
uses: astral-sh/setup-uv@v7
3124
- name: Build package
3225
run: uv build
3326
- name: Publish package distributions to PyPI

.github/workflows/test.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
1414

15-
defaults:
16-
run:
17-
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
18-
shell: bash -euo pipefail {0}
15+
permissions:
16+
id-token: write
1917

2018
jobs:
2119
# Get the test environment from hatch as defined in pyproject.toml.
@@ -27,13 +25,14 @@ jobs:
2725
runs-on: ubuntu-latest
2826
outputs:
2927
envs: ${{ steps.get-envs.outputs.envs }}
28+
allowed-failures: ${{ steps.get-envs.outputs.allowed-failures }}
3029
steps:
31-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3231
with:
3332
filter: blob:none
3433
fetch-depth: 0
3534
- name: Install uv
36-
uses: astral-sh/setup-uv@v5
35+
uses: astral-sh/setup-uv@v7
3736
- name: Get test environments
3837
id: get-envs
3938
run: |
@@ -47,6 +46,8 @@ jobs:
4746
}
4847
)')
4948
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
49+
ALLOWED=$(echo "${ENVS_JSON}" | jq -c 'map(select(.name | contains("pre")) | .name)')
50+
echo "allowed-failures=${ALLOWED}" | tee -a $GITHUB_OUTPUT
5051
5152
# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
5253
test:
@@ -60,17 +61,17 @@ jobs:
6061

6162
name: ${{ matrix.env.label }}
6263
runs-on: ${{ matrix.os }}
64+
continue-on-error: ${{ contains(matrix.env.name, 'pre') }}
6365

6466
steps:
65-
- uses: actions/checkout@v4
67+
- uses: actions/checkout@v5
6668
with:
6769
filter: blob:none
6870
fetch-depth: 0
6971
- name: Install uv
70-
uses: astral-sh/setup-uv@v5
72+
uses: astral-sh/setup-uv@v7
7173
with:
7274
python-version: ${{ matrix.env.python }}
73-
cache-dependency-glob: pyproject.toml
7475
- name: create hatch environment
7576
run: uvx hatch env create ${{ matrix.env.name }}
7677
- name: run tests using hatch
@@ -87,6 +88,9 @@ jobs:
8788
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
8889
- name: Upload coverage
8990
uses: codecov/codecov-action@v5
91+
with:
92+
fail_ci_if_error: true
93+
use_oidc: true
9094

9195
# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
9296
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
@@ -100,4 +104,5 @@ jobs:
100104
steps:
101105
- uses: re-actors/alls-green@release/v1
102106
with:
107+
allowed-failures: ${{ needs.get-environments.outputs.allowed-failures }}
103108
jobs: ${{ toJSON(needs) }}

.readthedocs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ version: 2
33
build:
44
os: ubuntu-24.04
55
tools:
6-
python: "3.12"
6+
python: "3.13"
7+
nodejs: latest
78
jobs:
89
create_environment:
910
- asdf plugin add uv

docs/conf.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

77
# -- Path setup --------------------------------------------------------------
8+
import shutil
89
import sys
910
from datetime import datetime
1011
from importlib.metadata import metadata
1112
from pathlib import Path
1213

14+
from sphinxcontrib import katex
15+
1316
HERE = Path(__file__).parent
1417
sys.path.insert(0, str(HERE / "extensions"))
1518

@@ -19,7 +22,7 @@
1922
# NOTE: If you installed your project in editable mode, this might be stale.
2023
# If this is the case, reinstall it to refresh the metadata
2124
info = metadata("decoupler")
22-
project_name = info["Name"]
25+
project = info["Name"]
2326
author = info["Author"]
2427
copyright = f"{datetime.now():%Y}, scverse."
2528
version = info["Version"]
@@ -37,7 +40,7 @@
3740
html_context = {
3841
"display_github": True, # Integrate GitHub
3942
"github_user": "scverse",
40-
"github_repo": project_name,
43+
"github_repo": project,
4144
"github_version": "main",
4245
"conf_py_path": "/docs/",
4346
}
@@ -56,7 +59,7 @@
5659
"sphinxcontrib.bibtex",
5760
"sphinx_autodoc_typehints",
5861
"sphinx_tabs.tabs",
59-
"sphinx.ext.mathjax",
62+
"sphinxcontrib.katex",
6063
"IPython.sphinxext.ipython_console_highlighting",
6164
"sphinxext.opengraph",
6265
*[p.stem for p in (HERE / "extensions").glob("*.py")],
@@ -92,7 +95,8 @@
9295
}
9396

9497
intersphinx_mapping = {
95-
"python": ("https://docs.python.org/3", None),
98+
# TODO: replace `3.13` with `3` once ReadTheDocs supports building with Python 3.14
99+
"python": ("https://docs.python.org/3.13", None),
96100
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
97101
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
98102
"numpy": ("https://numpy.org/doc/stable/", None),
@@ -115,7 +119,7 @@
115119
html_static_path = ["_static"]
116120
html_css_files = ["css/custom.css"]
117121

118-
html_title = project_name
122+
html_title = project
119123
html_logo = "_static/images/logo.png"
120124
html_favicon = "_static/images/logo.png"
121125

@@ -127,9 +131,11 @@
127131
}
128132

129133
pygments_style = "default"
134+
katex_prerender = shutil.which(katex.NODEJS_BINARY) is not None
130135

131136
nitpick_ignore = [
132137
# If building the documentation fails because of a missing link that is outside your control,
133138
# you can add an exception to this list.
134139
# ("py:class", "igraph.Graph"),
140+
("py:class", "pandas.core.frame.DataFrame"),
135141
]

pyproject.toml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ maintainers = [
1414
authors = [
1515
{ name = "Pau Badia i Mompel" },
1616
]
17-
requires-python = ">=3.10"
17+
requires-python = ">=3.11"
1818
classifiers = [
1919
"Programming Language :: Python :: 3 :: Only",
20-
"Programming Language :: Python :: 3.10",
2120
"Programming Language :: Python :: 3.11",
2221
"Programming Language :: Python :: 3.12",
2322
"Programming Language :: Python :: 3.13",
@@ -35,75 +34,75 @@ dependencies = [
3534
"session-info2",
3635
"tqdm",
3736
]
38-
optional-dependencies.dev = [
37+
# https://docs.pypi.org/project_metadata/#project-urls
38+
urls.Documentation = "https://decoupler.readthedocs.io/"
39+
urls.Homepage = "https://github.com/scverse/decoupler"
40+
urls.Source = "https://github.com/scverse/decoupler"
41+
42+
[dependency-groups]
43+
dev = [
3944
"pre-commit",
4045
"twine>=4.0.2",
4146
]
42-
optional-dependencies.doc = [
43-
"docutils>=0.8,!=0.18.*,!=0.19.*",
47+
test = [
48+
"coverage>=7.10",
49+
"dcor",
50+
"gseapy",
51+
"igraph",
52+
"ipywidgets",
53+
"memory-profiler",
54+
"pydeseq2",
55+
"pytest",
56+
"pytest-cov", # For VS Code’s coverage functionality
57+
"scanpy",
58+
"statsmodels",
59+
"xgboost",
60+
]
61+
doc = [
4462
"ipykernel",
4563
"ipython",
4664
"myst-nb>=1.1",
4765
"pandas",
48-
# Until pybtex >0.24.0 releases: https://bitbucket.org/pybtex-devs/pybtex/issues/169/
49-
"setuptools",
5066
"sphinx>=8.1",
5167
"sphinx-autodoc-typehints",
5268
"sphinx-book-theme>=1",
5369
"sphinx-copybutton",
5470
"sphinx-tabs",
5571
"sphinxcontrib-bibtex>=1",
72+
"sphinxcontrib-katex",
5673
"sphinxext-opengraph",
5774
]
58-
optional-dependencies.full = [
75+
full = [
5976
"dcor",
6077
"igraph",
6178
"ipywidgets",
6279
"pydeseq2",
6380
"scanpy",
6481
"xgboost",
6582
]
66-
optional-dependencies.test = [
67-
"coverage>=7.10",
68-
"dcor",
69-
"gseapy",
70-
"igraph",
71-
"ipywidgets",
72-
"memory-profiler",
73-
"pydeseq2",
74-
"pytest",
75-
"pytest-cov", # For VS Code’s coverage functionality
76-
"scanpy",
77-
"statsmodels",
78-
"xgboost",
79-
]
80-
# https://docs.pypi.org/project_metadata/#project-urls
81-
urls.Documentation = "https://decoupler.readthedocs.io/"
82-
urls.Homepage = "https://github.com/scverse/decoupler"
83-
urls.Source = "https://github.com/scverse/decoupler"
8483

8584
[tool.hatch.envs.default]
8685
installer = "uv"
87-
features = [ "dev" ]
86+
dependency-groups = [ "dev" ]
8887

8988
[tool.hatch.envs.docs]
90-
features = [ "doc" ]
89+
dependency-groups = [ "doc" ]
9190
scripts.build = "sphinx-build -M html docs docs/_build -W {args}"
9291
scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
9392
scripts.clean = "git clean -fdX -- {args:docs}"
9493

9594
# Test the lowest and highest supported Python versions with normal deps
9695
[[tool.hatch.envs.hatch-test.matrix]]
9796
deps = [ "stable" ]
98-
python = [ "3.10", "3.13" ]
97+
python = [ "3.11", "3.14" ]
9998

10099
# Test the newest supported Python version also with pre-release deps
101100
[[tool.hatch.envs.hatch-test.matrix]]
102101
deps = [ "pre" ]
103-
python = [ "3.13" ]
102+
python = [ "3.14" ]
104103

105104
[tool.hatch.envs.hatch-test]
106-
features = [ "dev", "test" ]
105+
dependency-groups = [ "dev", "test" ]
107106

108107
[tool.hatch.envs.hatch-test.overrides]
109108
# If the matrix variable `deps` is set to "pre",
@@ -152,9 +151,9 @@ lint.per-file-ignores."docs/*" = [ "I" ]
152151
lint.per-file-ignores."tests/*" = [ "D" ]
153152
lint.pydocstyle.convention = "numpy"
154153

155-
[tool.pytest.ini_options]
154+
[tool.pytest]
155+
strict = true
156156
testpaths = [ "tests" ]
157-
xfail_strict = true
158157
addopts = [
159158
"--import-mode=importlib", # allow using test files with same name
160159
]

0 commit comments

Comments
 (0)