Skip to content

Commit 4e648c6

Browse files
committed
cruft update
1 parent 31901a6 commit 4e648c6

File tree

7 files changed

+61
-503
lines changed

7 files changed

+61
-503
lines changed

.cruft.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/scverse/cookiecutter-scverse",
3-
"commit": "3dcfe1fd2bdfc3c1cc9cc4c2108fba1e973b9dcb",
3+
"commit": "722725204d70783354e7a27a6d49220e6357176a",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -13,9 +13,15 @@
1313
"project_repo": "https://github.com/artuurC/FlowSOM",
1414
"license": "GNU General Public License Version 3",
1515
"_copy_without_render": [
16-
".github/workflows/**.yaml",
16+
".github/workflows/build.yaml",
17+
".github/workflows/test.yaml",
1718
"docs/_templates/autosummary/**.rst"
1819
],
20+
"_render_devdocs": false,
21+
"_jinja2_env_vars": {
22+
"lstrip_blocks": true,
23+
"trim_blocks": true
24+
},
1925
"_template": "https://github.com/scverse/cookiecutter-scverse"
2026
}
2127
},

.github/workflows/release.yaml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- "*.*.*"
4+
release:
5+
types: [published]
76

7+
# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
88
jobs:
99
release:
10-
name: Release
10+
name: Upload release to PyPI
1111
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/FlowSOM
15+
permissions:
16+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1217
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v3
15-
16-
- name: Set up Python 3.10
17-
uses: actions/setup-python@v4
18+
- uses: actions/checkout@v4
1819
with:
19-
python-version: "3.10"
20-
21-
- name: Install hatch
22-
run: pip install hatch
23-
24-
- name: Build project for distribution
25-
run: hatch build
26-
27-
- name: Publish a Python distribution to PyPI
28-
uses: pypa/gh-action-pypi-publish@release/v1
20+
filter: blob:none
21+
fetch-depth: 0
22+
- uses: actions/setup-python@v4
2923
with:
30-
password: ${{ secrets.PYPI_API_TOKEN }}
24+
python-version: "3.x"
25+
cache: "pip"
26+
- run: pip install build
27+
- run: python -m build
28+
- name: Publish package distributions to PyPI
29+
uses: pypa/gh-action-pypi-publish@release/v1

docs/_static/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Reduce the font size in data frames - See https://github.com/scverse/cookiecutter-scverse/issues/193 */
2+
div.cell_output table.dataframe {
3+
font-size: 0.8em;
4+
}

docs/conf.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
#
108108
html_theme = "sphinx_book_theme"
109109
html_static_path = ["_static"]
110+
html_css_files = ["css/custom.css"]
111+
110112
html_title = project_name
111113

112114
html_theme_options = {
@@ -123,18 +125,3 @@
123125
# you can add an exception to this list.
124126
# ("py:class", "igraph.Graph"),
125127
]
126-
127-
128-
def setup(app):
129-
"""App setup hook."""
130-
app.add_config_value(
131-
"recommonmark_config",
132-
{
133-
"auto_toc_tree_section": "Contents",
134-
"enable_auto_toc_tree": True,
135-
"enable_math": True,
136-
"enable_inline_math": False,
137-
"enable_eval_rst": True,
138-
},
139-
True,
140-
)

docs/contributing.md

Lines changed: 18 additions & 56 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,9 +19,8 @@ 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
23-
automatically fix issues with the code, or raise an error message. See [pre-commit checks](template_usage.md#pre-commit-checks) for
24-
a full list of checks enabled for this repository.
22+
This package uses [pre-commit][] to enforce consistent code-styles.
23+
On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message.
2524

2625
To enable pre-commit locally, simply run
2726

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

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

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

5251
## Writing tests
@@ -65,7 +64,17 @@ command line by executing
6564
pytest
6665
```
6766

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

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

@@ -83,55 +92,8 @@ Before making a release, you need to update the version number in the `pyproject
8392
>
8493
> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
8594
86-
Once you are done, run
87-
88-
```
89-
git push --tags
90-
```
91-
92-
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.
93-
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
95+
Once you are done, commit and push your changes and navigate to the "Releases" page of this project on GitHub.
96+
Specify `vX.X.X` as a tag name and create a release. For more information, see [managing Github releases][]. This will automatically create a git tag and trigger a Github workflow that creates a release on PyPI.
13597

13698
## Writing documentation
13799

0 commit comments

Comments
 (0)