Skip to content

Commit 531b43b

Browse files
committed
Unify syntax and fix links
1 parent 35d86f6 commit 531b43b

File tree

2 files changed

+173
-142
lines changed

2 files changed

+173
-142
lines changed

{{cookiecutter.project_name}}/docs/contributing.md

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Contributing guide
22

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

7-
We assume that you are already familiar with git and with making pull requests on GitHub. If not, please refer
8-
to the [scanpy developer guide][].
7+
We assume that you are already familiar with git and with making pull requests on GitHub.
8+
If not, please refer to the [scanpy developer guide][].
9+
10+
[scanpy developer guide]: https://scanpy.readthedocs.io/en/latest/dev/index.html
911

1012
## Installing dev dependencies
1113

@@ -27,6 +29,8 @@ source .venv/bin/activate
2729
pip install -e ".[dev,test,doc]"
2830
```
2931

32+
[hatch environments]: https://hatch.pypa.io/latest/tutorials/environment/basic-usage/
33+
3034
## Code-style
3135

3236
This package uses [pre-commit][] to enforce consistent code-styles.
@@ -41,10 +45,11 @@ To enable pre-commit locally, simply run
4145
pre-commit install
4246
```
4347

44-
in the root of the repository. Pre-commit will automatically download all dependencies when it is run for the first time.
48+
in the root of the repository.
49+
Pre-commit will automatically download all dependencies when it is run for the first time.
4550

46-
Alternatively, you can rely on the [pre-commit.ci][] service enabled on GitHub. If you didn't run `pre-commit` before
47-
pushing changes to GitHub it will automatically commit fixes to your pull request, or show an error message.
51+
Alternatively, you can rely on the [pre-commit.ci][] service enabled on GitHub.
52+
If you didn't run `pre-commit` before pushing changes to GitHub it will automatically commit fixes to your pull request, or show an error message.
4853

4954
If pre-commit.ci added a commit on a branch you still have been working on locally, simply use
5055

@@ -55,15 +60,21 @@ git pull --rebase
5560
to integrate the changes into yours.
5661
While the [pre-commit.ci][] is useful, we strongly encourage installing and running pre-commit locally first to understand its usage.
5762

58-
Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [ruff][ruff-editors]
59-
and [prettier][prettier-editors].
63+
Finally, most editors have an _autoformat on save_ feature.
64+
Consider enabling this option for [ruff][ruff-editors] and [prettier][prettier-editors].
65+
66+
[pre-commit]: https://pre-commit.com/
67+
[pre-commit.ci]: https://pre-commit.ci/
68+
[ruff-editors]: https://docs.astral.sh/ruff/integrations/
69+
70+
[prettier-editors]: https://prettier.io/docs/en/editors.html
6071

6172
(writing-tests)=
6273

6374
## Writing tests
6475

65-
This package uses the [pytest][] for automated testing. Please {doc}`scanpy:dev/testing` for every function added
66-
to the package.
76+
This package uses the [pytest][] for automated testing.
77+
Please {doc}`scanpy:dev/testing` for every function added to the package.
6778

6879
Most IDEs integrate with pytest and provide a GUI to run tests.
6980
Just point yours to one of the environments returned by
@@ -83,63 +94,78 @@ hatch test --all # test with all supported Python versions
8394

8495
in the root of the repository.
8596

97+
[pytest]: https://docs.pytest.org/
98+
8699
### Continuous integration
87100

88101
Continuous integration will automatically run the tests on all pull requests and test
89102
against the minimum and maximum supported Python version.
90103

91-
Additionally, there's a CI job that tests against pre-releases of all dependencies
92-
(if there are any). The purpose of this check is to detect incompatibilities
93-
of new package versions early on and gives you time to fix the issue or reach
94-
out to the developers of the dependency before the package is released to a wider audience.
104+
Additionally, there's a CI job that tests against pre-releases of all dependencies (if there are any).
105+
The purpose of this check is to detect incompatibilities of new package versions early on and
106+
gives you time to fix the issue or reach out to the developers of the dependency before the package is released to a wider audience.
95107

96108
## Publishing a release
97109

98110
### Updating the version number
99111

100-
Before making a release, you need to update the version number in the `pyproject.toml` file. Please adhere to [Semantic Versioning][semver], in brief
112+
Before making a release, you need to update the version number in the `pyproject.toml` file.
113+
Please adhere to [Semantic Versioning][semver], in brief
101114

102115
> Given a version number MAJOR.MINOR.PATCH, increment the:
103116
>
104-
> 1. MAJOR version when you make incompatible API changes,
105-
> 2. MINOR version when you add functionality in a backwards compatible manner, and
106-
> 3. PATCH version when you make backwards compatible bug fixes.
117+
> 1. MAJOR version when you make incompatible API changes,
118+
> 2. MINOR version when you add functionality in a backwards compatible manner, and
119+
> 3. PATCH version when you make backwards compatible bug fixes.
107120
>
108121
> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
109122
110123
Once you are done, commit and push your changes and navigate to the "Releases" page of this project on GitHub.
111-
Specify `vX.X.X` as a tag name and create a release. For more information, see [managing GitHub releases][].
124+
Specify `vX.X.X` as a tag name and create a release.
125+
For more information, see [managing GitHub releases][].
112126
This will automatically create a git tag and trigger a Github workflow that creates a release on [PyPI][].
113127

128+
[semver]: https://semver.org/
129+
[managing GitHub releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
130+
[pypi]: https://pypi.org/
131+
114132
## Writing documentation
115133

116-
Please write documentation for new or changed features and use-cases. This project uses [sphinx][] with the following features:
134+
Please write documentation for new or changed features and use-cases.
135+
This project uses [sphinx][] with the following features:
117136

118-
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
137+
- The [myst][] extension allows to write documentation in markdown/Markedly Structured Text
119138
- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
120139
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
121-
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
140+
- [sphinx-autodoc-typehints][], to automatically reference annotated input and output types
122141
- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
123142

124-
See the [scanpy developer docs](https://scanpy.readthedocs.io/en/latest/dev/documentation.html) for more information
125-
on how to write documentation.
143+
See the {doc}`scanpy:dev/documentation` for more information on how to write documentation.
144+
145+
[sphinx]: https://www.sphinx-doc.org/en/master/
146+
[myst]: https://myst-parser.readthedocs.io/en/latest/intro.html
147+
[myst-nb]: https://myst-nb.readthedocs.io/en/latest/
148+
[numpydoc-napoleon]: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
149+
[numpydoc]: https://numpydoc.readthedocs.io/en/latest/format.html
150+
[sphinx-autodoc-typehints]: https://github.com/tox-dev/sphinx-autodoc-typehints
126151

127152
### Tutorials with myst-nb and jupyter notebooks
128153

129154
The documentation is set-up to render jupyter notebooks stored in the `docs/notebooks` directory using [myst-nb][].
130155
Currently, only notebooks in `.ipynb` format are supported that will be included with both their input and output cells.
131156
It is your responsibility to update and re-run the notebook whenever necessary.
132157

133-
If you are interested in automatically running notebooks as part of the continuous integration, please check
134-
out [this feature request](https://github.com/scverse/cookiecutter-scverse/issues/40) in the `cookiecutter-scverse`
135-
repository.
158+
If you are interested in automatically running notebooks as part of the continuous integration,
159+
please check out [this feature request][issue-render-notebooks] in the `cookiecutter-scverse` repository.
160+
161+
[issue-render-notebooks]: https://github.com/scverse/cookiecutter-scverse/issues/40
136162

137163
#### Hints
138164

139-
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
140-
if you do so can sphinx automatically create a link to the external documentation.
141-
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
142-
the `nitpick_ignore` list in `docs/conf.py`
165+
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`.
166+
Only if you do so can sphinx automatically create a link to the external documentation.
167+
- If building the documentation fails because of a missing link that is outside your control,
168+
you can add an entry to the `nitpick_ignore` list in `docs/conf.py`
143169

144170
(docs-building)=
145171

@@ -149,27 +175,3 @@ repository.
149175
hatch docs:build
150176
hatch docs:open
151177
```
152-
153-
<!-- Links -->
154-
155-
[scanpy developer guide]: https://scanpy.readthedocs.io/en/latest/dev/index.html
156-
[hatch environments]: https://hatch.pypa.io/latest/tutorials/environment/basic-usage/
157-
[cookiecutter-scverse-instance]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/template_usage.html
158-
[github quickstart guide]: https://docs.github.com/en/get-started/quickstart/create-a-repo?tool=webui
159-
[codecov]: https://about.codecov.io/sign-up/
160-
[codecov app]: https://github.com/apps/codecov
161-
[pre-commit.ci]: https://pre-commit.ci/
162-
[pre-commit]: https://pre-commit.com/
163-
[ruff-editors]: https://docs.astral.sh/ruff/integrations/
164-
[prettier-editors]: https://prettier.io/docs/en/editors.html
165-
[pytest]: https://docs.pytest.org/
166-
[semver]: https://semver.org/
167-
[readthedocs.org]: https://readthedocs.org/
168-
[sphinx]: https://www.sphinx-doc.org/en/master/
169-
[myst]: https://myst-parser.readthedocs.io/en/latest/intro.html
170-
[myst-nb]: https://myst-nb.readthedocs.io/en/latest/
171-
[numpydoc-napoleon]: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
172-
[numpydoc]: https://numpydoc.readthedocs.io/en/latest/format.html
173-
[sphinx autodoc typehints]: https://github.com/tox-dev/sphinx-autodoc-typehints
174-
[pypi]: https://pypi.org/
175-
[managing GitHub releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository

0 commit comments

Comments
 (0)