Skip to content

Commit 0e22149

Browse files
Update instance repo from cookiecutter template
1 parent 6c26b5c commit 0e22149

File tree

3 files changed

+63
-49
lines changed

3 files changed

+63
-49
lines changed

.github/workflows/test.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ jobs:
2626
- os: ubuntu-latest
2727
python: "3.9"
2828
- os: ubuntu-latest
29-
python: "3.10"
29+
python: "3.11"
3030
- os: ubuntu-latest
31-
python: "3.10"
31+
python: "3.11"
3232
pip-flags: "--pre"
33+
name: PRE-RELEASE DEPENDENCIES
34+
35+
name: ${{ matrix.name }} Python ${{ matrix.python }}
3336

3437
env:
3538
OS: ${{ matrix.os }}

docs/contributing.md

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing guide
22

3-
Scanpy provides extensive [developer documentation][scanpy developer guide], most of which applies to this repo, too.
3+
Scanpy provides extensive [developer documentation][scanpy developer guide], most of which applies to this project, too.
44
This document will not reproduce the entire content from there. Instead, it aims at summarizing the most important
55
information to get you started on contributing.
66

@@ -19,7 +19,7 @@ pip install -e ".[dev,test,doc]"
1919

2020
## Code-style
2121

22-
This template uses [pre-commit][] to enforce consistent code-styles. On every commit, pre-commit checks will either
22+
This package uses [pre-commit][] to enforce consistent code-styles. On every commit, pre-commit checks will either
2323
automatically fix issues with the code, or raise an error message. See [pre-commit checks](template_usage.md#pre-commit-checks) for
2424
a full list of checks enabled for this repository.
2525

@@ -43,10 +43,10 @@ git pull --rebase
4343
to integrate the changes into yours.
4444
While the [pre-commit.ci][] is useful, we strongly encourage installing and running pre-commit locally first to understand its usage.
4545

46-
Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [black][black-editors]
46+
Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [ruff][ruff-editors]
4747
and [prettier][prettier-editors].
4848

49-
[black-editors]: https://black.readthedocs.io/en/stable/integrations/editors.html
49+
[ruff-editors]: https://docs.astral.sh/ruff/integrations/
5050
[prettier-editors]: https://prettier.io/docs/en/editors.html
5151

5252
## Writing tests
@@ -65,7 +65,17 @@ command line by executing
6565
pytest
6666
```
6767

68-
in the root of the repository. Continuous integration will automatically run the tests on all pull requests.
68+
in the root of the repository.
69+
70+
### Continuous integration
71+
72+
Continuous integration will automatically run the tests on all pull requests and test
73+
against the minimum and maximum supported Python version.
74+
75+
Additionally, there's a CI job that tests against pre-releases of all dependencies
76+
(if there are any). The purpose of this check is to detect incompatibilities
77+
of new package versions early on and gives you time to fix the issue or reach
78+
out to the developers of the dependency before the package is released to a wider audience.
6979

7080
[scanpy-test-docs]: https://scanpy.readthedocs.io/en/latest/dev/testing.html#writing-tests
7181

@@ -91,48 +101,6 @@ git push --tags
91101

92102
to publish the created tag on GitHub. Alternatively, it is possible to create a tag through the Github web interface. For more information, see [managing Github releases][]. This will automatically trigger a Github workflow that creates a release on PyPI.
93103

94-
### The release Github workflow
95-
96-
#### Behind the scenes
97-
98-
This section explains how releases can be created manually purely for educational purposes. Experienced developers may skip this section.
99-
Python packages are not distributed as source code, but as _distributions_. The most common distribution format is the so-called _wheel_. To build a _wheel_, run
100-
101-
```bash
102-
python -m build
103-
```
104-
105-
This command creates a _source archive_ and a _wheel_, which are required for publishing your package to [PyPI][]. These files are created directly in the root of the repository.
106-
107-
Before uploading them to [PyPI][] you can check that your _distribution_ is valid by running:
108-
109-
```bash
110-
twine check dist/*
111-
```
112-
113-
and finally publishing it with:
114-
115-
```bash
116-
twine upload dist/*
117-
```
118-
119-
Provide your username and password when requested and then go check out your package on [PyPI][]!
120-
121-
For more information, follow the [Python packaging tutorial][].
122-
123-
#### Configuring the Github workflow
124-
125-
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][].
126-
For this to work, the `PYPI_API_TOKEN` Github secret needs to be set to the value of the [PyPI][] token.
127-
See [Creating PyPI tokens][] for instructions on how to create a [PyPI][] token.
128-
Finally, set your `PYPI_API_TOKEN` Github secret equal to the value of the just created [PyPI][] token by following [creating Github secrets][].
129-
130-
[creating github secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets
131-
[creating pypi tokens]: https://pypi.org/help/#apitoken
132-
[managing github releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
133-
[python packaging tutorial]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives
134-
[pypi-feature-request]: https://github.com/scverse/cookiecutter-scverse/issues/88
135-
136104
## Writing documentation
137105

138106
Please write documentation for new or changed features and use-cases. This project uses [sphinx][] with the following features:

docs/template_usage.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,49 @@ On the RTD dashboard choose "Import a Project" and follow the instructions to ad
158158
159159
If your project is private, there are ways to enable docs rendering on [readthedocs.org][] but it is more cumbersome and requires a different subscription for read the docs. See a guide [here](https://docs.readthedocs.io/en/stable/guides/importing-private-repositories.html).
160160
161+
### The release Github workflow
162+
163+
#### Configuring the Github workflow
164+
165+
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][].
166+
For this to work, the `PYPI_API_TOKEN` Github secret needs to be set to the value of the [PyPI][] token.
167+
See [Creating PyPI tokens][] for instructions on how to create a [PyPI][] token.
168+
Finally, set your `PYPI_API_TOKEN` Github secret equal to the value of the just created [PyPI][] token by following [creating Github secrets][].
169+
170+
#### Behind the scenes
171+
172+
This section explains how releases can be created manually purely for educational purposes. Experienced developers may skip this section.
173+
Python packages are not distributed as source code, but as _distributions_. The most common distribution format is the so-called _wheel_. To build a _wheel_, run
174+
175+
```bash
176+
python -m build
177+
```
178+
179+
This command creates a _source archive_ and a _wheel_, which are required for publishing your package to [PyPI][]. These files are created directly in the root of the repository.
180+
181+
Before uploading them to [PyPI][] you can check that your _distribution_ is valid by running:
182+
183+
```bash
184+
twine check dist/*
185+
```
186+
187+
and finally publishing it with:
188+
189+
```bash
190+
twine upload dist/*
191+
```
192+
193+
Provide your username and password when requested and then go check out your package on [PyPI][]!
194+
195+
For more information, follow the [Python packaging tutorial][].
196+
197+
[creating github secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets
198+
[creating pypi tokens]: https://pypi.org/help/#apitoken
199+
[managing github releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
200+
[python packaging tutorial]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives
201+
202+
[pypi-feature-request]: https://github.com/scverse/cookiecutter-scverse/issues/88
203+
161204
(pre-commit)=
162205
163206
### Pre-commit checks

0 commit comments

Comments
 (0)