Skip to content

Commit 28d3bd0

Browse files
authored
Add post gen hook with detailed instructions (#131)
* Add post gen hook with detailed instructions * Add newlines
1 parent 0d42e42 commit 28d3bd0

3 files changed

Lines changed: 148 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-prettier
3-
rev: v2.7.1
3+
rev: v3.0.0-alpha.4
44
hooks:
55
- id: prettier

hooks/.make_rich_output.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# ---
2+
# jupyter:
3+
# jupytext:
4+
# formats: ipynb,py:percent
5+
# text_representation:
6+
# extension: .py
7+
# format_name: percent
8+
# format_version: '1.3'
9+
# jupytext_version: 1.14.0
10+
# kernelspec:
11+
# display_name: Python 3 (ipykernel)
12+
# language: python
13+
# name: python3
14+
# ---
15+
16+
# %%
17+
from rich.console import Console
18+
from rich.markdown import Markdown
19+
20+
# %% [markdown]
21+
# Set up online services
22+
#
23+
# Your repository is now ready. However, to use all features of the template you will need to set up the following online services. Clicking on the links will take you to the respective sections of the developer documentation. The developer documentation is also shipped as part of the template in docs/developer_docs.md.
24+
#
25+
# pre-commit.ci to check for inconsistencies and to enforce a code style
26+
# readthedocs.org to build and host documentation
27+
# codecov to generate test coverage reports
28+
#
29+
# All CI checks should pass, you are ready to start developing your new tool!
30+
# Customizations
31+
#
32+
# Further instructions on using this template can be found in the dev docs included in the project.
33+
# Committment
34+
#
35+
# We expect developers of scverse ecosystem packages to
36+
#
37+
# write unit tests
38+
# provide documentation, including tutorials where applicable
39+
# support users through github and the scverse discourse
40+
#
41+
42+
# %%
43+
with open("/home/sturm/Downloads/report.txt", "wt") as report_file:
44+
console = Console(file=report_file, width=72, force_terminal=True, color_system="standard", )
45+
console.print(
46+
Markdown(
47+
"""
48+
# Set-up online services
49+
50+
**Your repsoitory is now ready. However, to use all features of the template you will need to set up the following online services.**
51+
Clicking on the links will take you to the respective sections of the developer documentation.
52+
The developer documentation is also shipped as part of the template in docs/developer_docs.md.
53+
54+
1. [pre-commit.ci][setup-pre-commit] to check for inconsistencies and to enforce a code style
55+
2. [readthedocs.org][setup-rtd] to build and host documentation
56+
3. [codecov][setup-codecov] to generate test coverage reports
57+
58+
All CI checks should pass, you are ready to start developing your new tool!
59+
60+
# Install the package
61+
62+
To run tests or build the documentation locally, you need to install your package and its dependencies. You can do so with
63+
64+
```bash
65+
pip install ".[test,dev,doc]"
66+
```
67+
68+
# Customizations
69+
70+
Further instructions on using this template can be found in the [dev docs included in the project](https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html).
71+
72+
# Committment
73+
74+
We expect developers of scverse ecosystem packages to
75+
76+
- [write unit tests][write-tests]
77+
- [provide documentation][write-docs], including tutorials where applicable
78+
- support users through github and the [scverse discourse][]
79+
80+
[setup-pre-commit]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#pre-commit-checks
81+
[setup-rtd]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#documentation-on-readthedocs
82+
[setup-codecov]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#coverage-tests-with-codecov
83+
[write-tests]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-tests
84+
[write-docs]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-documentation
85+
[scverse discourse]: https://discourse.scverse.org/
86+
87+
"""
88+
)
89+
)
90+
91+
# %%
92+
93+
# %%

hooks/post_gen_project.sh

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,57 @@
44
pre-commit autoupdate -c .pre-commit-config.yaml
55
pre-commit install
66

7-
# Upload to github
8-
# gh repo create --push
7+
# The following output was generated using rich
8+
# The formatted output is included here directly, because I don't want
9+
# rich as another dependency for initalizing the repo.
10+
# See .make_rich_output.py for more details.
11+
12+
cat << EOF
13+
14+
15+
16+
17+
╔══════════════════════════════════════════════════════════════════════╗
18+
║ Set-up online services ║
19+
╚══════════════════════════════════════════════════════════════════════╝
20+
21+
Your repsoitory is now ready. However, to use all features of the 
22+
template you will need to set up the following online services. Clicking
23+
on the links will take you to the respective sections of the developer
24+
documentation. The developer documentation is also shipped as part of
25+
the template in docs/developer_docs.md.
26+
27+
 1 ]8;id=633754;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#pre-commit-checks\pre-commit.ci]8;;\ to check for inconsistencies and to enforce a code
28+
 style
29+
 2 ]8;id=858259;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#documentation-on-readthedocs\readthedocs.org]8;;\ to build and host documentation
30+
 3 ]8;id=497293;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#coverage-tests-with-codecov\codecov]8;;\ to generate test coverage reports
31+
32+
All CI checks should pass, you are ready to start developing your new
33+
tool!
34+
35+
╔══════════════════════════════════════════════════════════════════════╗
36+
║ Install the package ║
37+
╚══════════════════════════════════════════════════════════════════════╝
38+
39+
To run tests or build the documentation locally, you need to install
40+
your package and its dependencies. You can do so with
41+
42+
pip install ".[test,dev,doc]" 
43+
44+
╔══════════════════════════════════════════════════════════════════════╗
45+
║ Customizations ║
46+
╚══════════════════════════════════════════════════════════════════════╝
47+
48+
Further instructions on using this template can be found in the ]8;id=447180;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html\dev docs]8;;\
49+
]8;id=447180;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html\included in the project]8;;\.
50+
51+
╔══════════════════════════════════════════════════════════════════════╗
52+
║ Committment ║
53+
╚══════════════════════════════════════════════════════════════════════╝
54+
55+
We expect developers of scverse ecosystem packages to
56+
57+
 • ]8;id=169559;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-tests\write unit tests]8;;\
58+
 • ]8;id=20647;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-documentation\provide documentation]8;;\, including tutorials where applicable
59+
 • support users through github and the ]8;id=496112;https://discourse.scverse.org/\scverse discourse]8;;\
60+
EOF

0 commit comments

Comments
 (0)