Skip to content

Commit 95d0138

Browse files
Merge pull request #66 from theislab/template-update-v0.7.0
Template update v0.7.0
2 parents 8694f8e + b057a90 commit 95d0138

19 files changed

Lines changed: 702 additions & 388 deletions

.cruft.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"template": "https://github.com/scverse/cookiecutter-scverse",
3-
"commit": "586b1652162ff7994b0070a034023d64289ae416",
4-
"checkout": "v0.3.1",
3+
"commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95",
4+
"checkout": "v0.7.0",
55
"context": {
66
"cookiecutter": {
77
"project_name": "geome",
@@ -10,19 +10,33 @@
1010
"author_full_name": "Marcella Toth",
1111
"author_email": "toth.marcella@gmail.com",
1212
"github_user": "tothmarcella",
13-
"project_repo": "https://github.com/theislab/geome",
13+
"github_repo": "geome",
1414
"license": "MIT License",
15+
"ide_integration": true,
1516
"_copy_without_render": [
1617
".github/workflows/build.yaml",
1718
".github/workflows/test.yaml",
1819
"docs/_templates/autosummary/**.rst"
1920
],
21+
"_exclude_on_template_update": [
22+
"CHANGELOG.md",
23+
"LICENSE",
24+
"README.md",
25+
"docs/api.md",
26+
"docs/index.md",
27+
"docs/notebooks/example.ipynb",
28+
"docs/references.bib",
29+
"docs/references.md",
30+
"src/**",
31+
"tests/**"
32+
],
2033
"_render_devdocs": false,
2134
"_jinja2_env_vars": {
2235
"lstrip_blocks": true,
2336
"trim_blocks": true
2437
},
25-
"_template": "https://github.com/scverse/cookiecutter-scverse"
38+
"_template": "https://github.com/scverse/cookiecutter-scverse",
39+
"_commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95"
2640
}
2741
},
2842
"directory": null

.editorconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11-
[*.{yml,yaml}]
12-
indent_size = 2
13-
14-
[.cruft.json]
11+
[{*.{yml,yaml,toml},.cruft.json}]
1512
indent_size = 2
1613

1714
[Makefile]
Lines changed: 66 additions & 62 deletions
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:
@@ -9,8 +9,7 @@ body:
99
detailing how to provide the necessary information for us to reproduce your bug. In brief:
1010
* Please provide exact steps how to reproduce the bug in a clean Python environment.
1111
* In case it's not clear what's causing this bug, please provide the data or the data generation procedure.
12-
* Sometimes it is not possible to share the data, but usually it is possible to replicate problems on publicly
13-
available datasets or to share a subset of your data.
12+
* Replicate problems on public datasets or share data subsets when full sharing isn't possible.
1413
1514
- type: textarea
1615
id: report
@@ -23,67 +22,72 @@ body:
2322
- type: textarea
2423
id: versions
2524
attributes:
26-
label: Version information
25+
label: Versions
2726
description: |
28-
Please paste below the output of
27+
Which version of packages.
28+
29+
Please install `session-info2`, run the following command in a notebook,
30+
click the “Copy as Markdown” button, then paste the results into the text box below.
31+
32+
```python
33+
In[1]: import session_info2; session_info2.session_info(dependencies=True)
34+
```
35+
36+
Alternatively, run this in a console:
2937
3038
```python
31-
import session_info
32-
session_info.show(html=False, dependencies=True)
39+
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
3340
```
41+
render: python
3442
placeholder: |
35-
-----
36-
anndata 0.8.0rc2.dev27+ge524389
37-
session_info 1.0.0
38-
-----
39-
asttokens NA
40-
awkward 1.8.0
41-
backcall 0.2.0
42-
cython_runtime NA
43-
dateutil 2.8.2
44-
debugpy 1.6.0
45-
decorator 5.1.1
46-
entrypoints 0.4
47-
executing 0.8.3
48-
h5py 3.7.0
49-
ipykernel 6.15.0
50-
jedi 0.18.1
51-
mpl_toolkits NA
52-
natsort 8.1.0
53-
numpy 1.22.4
54-
packaging 21.3
55-
pandas 1.4.2
56-
parso 0.8.3
57-
pexpect 4.8.0
58-
pickleshare 0.7.5
59-
pkg_resources NA
60-
prompt_toolkit 3.0.29
61-
psutil 5.9.1
62-
ptyprocess 0.7.0
63-
pure_eval 0.2.2
64-
pydev_ipython NA
65-
pydevconsole NA
66-
pydevd 2.8.0
67-
pydevd_file_utils NA
68-
pydevd_plugins NA
69-
pydevd_tracing NA
70-
pygments 2.12.0
71-
pytz 2022.1
72-
scipy 1.8.1
73-
setuptools 62.5.0
74-
setuptools_scm NA
75-
six 1.16.0
76-
stack_data 0.3.0
77-
tornado 6.1
78-
traitlets 5.3.0
79-
wcwidth 0.2.5
80-
zmq 23.1.0
81-
-----
82-
IPython 8.4.0
83-
jupyter_client 7.3.4
84-
jupyter_core 4.10.0
85-
-----
86-
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) [GCC 10.3.0]
87-
Linux-5.18.6-arch1-1-x86_64-with-glibc2.35
88-
-----
89-
Session information updated at 2022-07-07 17:55
43+
anndata 0.11.3
44+
---- ----
45+
charset-normalizer 3.4.1
46+
coverage 7.7.0
47+
psutil 7.0.0
48+
dask 2024.7.1
49+
jaraco.context 5.3.0
50+
numcodecs 0.15.1
51+
jaraco.functools 4.0.1
52+
Jinja2 3.1.6
53+
sphinxcontrib-jsmath 1.0.1
54+
sphinxcontrib-htmlhelp 2.1.0
55+
toolz 1.0.0
56+
session-info2 0.1.2
57+
PyYAML 6.0.2
58+
llvmlite 0.44.0
59+
scipy 1.15.2
60+
pandas 2.2.3
61+
sphinxcontrib-devhelp 2.0.0
62+
h5py 3.13.0
63+
tblib 3.0.0
64+
setuptools-scm 8.2.0
65+
more-itertools 10.3.0
66+
msgpack 1.1.0
67+
sparse 0.15.5
68+
wrapt 1.17.2
69+
jaraco.collections 5.1.0
70+
numba 0.61.0
71+
pyarrow 19.0.1
72+
pytz 2025.1
73+
MarkupSafe 3.0.2
74+
crc32c 2.7.1
75+
sphinxcontrib-qthelp 2.0.0
76+
sphinxcontrib-serializinghtml 2.0.0
77+
zarr 2.18.4
78+
asciitree 0.3.3
79+
six 1.17.0
80+
sphinxcontrib-applehelp 2.0.0
81+
numpy 2.1.3
82+
cloudpickle 3.1.1
83+
sphinxcontrib-bibtex 2.6.3
84+
natsort 8.4.0
85+
jaraco.text 3.12.1
86+
setuptools 76.1.0
87+
Deprecated 1.2.18
88+
packaging 24.2
89+
python-dateutil 2.9.0.post0
90+
---- ----
91+
Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0]
92+
OS Linux-6.11.0-109019-tuxedo-x86_64-with-glibc2.39
93+
Updated 2025-03-18 15:47

.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 geome
3-
labels: enhancement
3+
type: Enhancement
44
body:
55
- type: textarea
66
id: description

.github/workflows/build.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@ jobs:
1414
package:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Set up Python 3.10
19-
uses: actions/setup-python@v4
17+
- uses: actions/checkout@v5
2018
with:
21-
python-version: "3.10"
22-
cache: "pip"
23-
cache-dependency-path: "**/pyproject.toml"
24-
- name: Install build dependencies
25-
run: python -m pip install --upgrade pip wheel twine build
19+
filter: blob:none
20+
fetch-depth: 0
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
2623
- name: Build package
27-
run: python -m build
24+
run: uv build
2825
- name: Check package
29-
run: twine check --strict dist/*.whl
26+
run: uvx twine check --strict dist/*.whl

.github/workflows/release.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ jobs:
1515
permissions:
1616
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919
with:
2020
filter: blob:none
2121
fetch-depth: 0
22-
- uses: actions/setup-python@v4
23-
with:
24-
python-version: "3.x"
25-
cache: "pip"
26-
- run: pip install build
27-
- run: python -m build
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v7
24+
- name: Build package
25+
run: uv build
2826
- name: Publish package distributions to PyPI
2927
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yaml

Lines changed: 73 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,91 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16+
# Get the test environment from hatch as defined in pyproject.toml.
17+
# This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
18+
# run locally and on continuous integration.
19+
# Check [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml and https://hatch.pypa.io/latest/environment/ for
20+
# more details.
21+
get-environments:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
envs: ${{ steps.get-envs.outputs.envs }}
25+
steps:
26+
- uses: actions/checkout@v5
27+
with:
28+
filter: blob:none
29+
fetch-depth: 0
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v7
32+
- name: Get test environments
33+
id: get-envs
34+
run: |
35+
ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
36+
| map(
37+
select(.key | startswith("hatch-test"))
38+
| {
39+
name: .key,
40+
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
41+
python: .value.python
42+
}
43+
)')
44+
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
45+
46+
# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
1647
test:
17-
runs-on: ${{ matrix.os }}
18-
defaults:
19-
run:
20-
shell: bash -e {0} # -e to fail on error
48+
needs: get-environments
49+
permissions:
50+
id-token: write # for codecov OIDC
2151

2252
strategy:
2353
fail-fast: false
2454
matrix:
25-
include:
26-
- os: ubuntu-latest
27-
python: "3.9"
28-
- os: ubuntu-latest
29-
python: "3.11"
30-
- os: ubuntu-latest
31-
python: "3.11"
32-
pip-flags: "--pre"
33-
name: PRE-RELEASE DEPENDENCIES
34-
35-
name: ${{ matrix.name }} Python ${{ matrix.python }}
55+
os: [ubuntu-latest]
56+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
3657

37-
env:
38-
OS: ${{ matrix.os }}
39-
PYTHON: ${{ matrix.python }}
58+
name: ${{ matrix.env.label }}
59+
runs-on: ${{ matrix.os }}
60+
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
4061

4162
steps:
42-
- uses: actions/checkout@v3
43-
- name: Set up Python ${{ matrix.python }}
44-
uses: actions/setup-python@v4
63+
- uses: actions/checkout@v5
4564
with:
46-
python-version: ${{ matrix.python }}
47-
cache: "pip"
48-
cache-dependency-path: "**/pyproject.toml"
49-
50-
- name: Install test dependencies
51-
run: |
52-
python -m pip install --upgrade pip wheel
53-
pip install torch==2.1.0
54-
pip install torch-scatter torch-sparse torch-cluster
55-
- name: Install dependencies
56-
run: |
57-
pip install ${{ matrix.pip-flags }} ".[dev,test]"
58-
- name: Test
65+
filter: blob:none
66+
fetch-depth: 0
67+
- name: Install uv
68+
uses: astral-sh/setup-uv@v7
69+
with:
70+
python-version: ${{ matrix.env.python }}
71+
- name: create hatch environment
72+
run: uvx hatch env create ${{ matrix.env.name }}
73+
- name: run tests using hatch
5974
env:
6075
MPLBACKEND: agg
6176
PLATFORM: ${{ matrix.os }}
6277
DISPLAY: :42
78+
run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
79+
- name: generate coverage report
6380
run: |
64-
coverage run -m pytest -v --color=yes
65-
- name: Report coverage
66-
run: |
67-
coverage report
81+
# See https://coverage.readthedocs.io/en/latest/config.html#run-patch
82+
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
83+
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
84+
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
6885
- name: Upload coverage
69-
uses: codecov/codecov-action@v3
86+
uses: codecov/codecov-action@v5
87+
with:
88+
fail_ci_if_error: true
89+
use_oidc: true
90+
91+
# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
92+
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
93+
check:
94+
name: Tests pass in all hatch environments
95+
if: always()
96+
needs:
97+
- get-environments
98+
- test
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: re-actors/alls-green@release/v1
102+
with:
103+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)