Skip to content

Commit

Permalink
Add post gen hook with detailed instructions (#131)
Browse files Browse the repository at this point in the history
* Add post gen hook with detailed instructions

* Add newlines
  • Loading branch information
grst authored Dec 19, 2022
1 parent 0d42e42 commit 28d3bd0
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.0.0-alpha.4
hooks:
- id: prettier
93 changes: 93 additions & 0 deletions hooks/.make_rich_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.14.0
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---

# %%
from rich.console import Console
from rich.markdown import Markdown

# %% [markdown]
# Set up online services
#
# 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.
#
# pre-commit.ci to check for inconsistencies and to enforce a code style
# readthedocs.org to build and host documentation
# codecov to generate test coverage reports
#
# All CI checks should pass, you are ready to start developing your new tool!
# Customizations
#
# Further instructions on using this template can be found in the dev docs included in the project.
# Committment
#
# We expect developers of scverse ecosystem packages to
#
# write unit tests
# provide documentation, including tutorials where applicable
# support users through github and the scverse discourse
#

# %%
with open("/home/sturm/Downloads/report.txt", "wt") as report_file:
console = Console(file=report_file, width=72, force_terminal=True, color_system="standard", )
console.print(
Markdown(
"""
# Set-up online services
**Your repsoitory 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.
1. [pre-commit.ci][setup-pre-commit] to check for inconsistencies and to enforce a code style
2. [readthedocs.org][setup-rtd] to build and host documentation
3. [codecov][setup-codecov] to generate test coverage reports
All CI checks should pass, you are ready to start developing your new tool!
# Install the package
To run tests or build the documentation locally, you need to install your package and its dependencies. You can do so with
```bash
pip install ".[test,dev,doc]"
```
# Customizations
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).
# Committment
We expect developers of scverse ecosystem packages to
- [write unit tests][write-tests]
- [provide documentation][write-docs], including tutorials where applicable
- support users through github and the [scverse discourse][]
[setup-pre-commit]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#pre-commit-checks
[setup-rtd]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#documentation-on-readthedocs
[setup-codecov]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#coverage-tests-with-codecov
[write-tests]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-tests
[write-docs]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-documentation
[scverse discourse]: https://discourse.scverse.org/
"""
)
)

# %%

# %%
56 changes: 54 additions & 2 deletions hooks/post_gen_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,57 @@
pre-commit autoupdate -c .pre-commit-config.yaml
pre-commit install

# Upload to github
# gh repo create --push
# The following output was generated using rich
# The formatted output is included here directly, because I don't want
# rich as another dependency for initalizing the repo.
# See .make_rich_output.py for more details.

cat << EOF
╔══════════════════════════════════════════════════════════════════════╗
║ Set-up online services ║
╚══════════════════════════════════════════════════════════════════════╝
Your repsoitory 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.
 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
 style
 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
 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
All CI checks should pass, you are ready to start developing your new
tool!
╔══════════════════════════════════════════════════════════════════════╗
║ Install the package ║
╚══════════════════════════════════════════════════════════════════════╝
To run tests or build the documentation locally, you need to install
your package and its dependencies. You can do so with
pip install ".[test,dev,doc]" 
╔══════════════════════════════════════════════════════════════════════╗
║ Customizations ║
╚══════════════════════════════════════════════════════════════════════╝
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;;\
]8;id=447180;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html\included in the project]8;;\.
╔══════════════════════════════════════════════════════════════════════╗
║ Committment ║
╚══════════════════════════════════════════════════════════════════════╝
We expect developers of scverse ecosystem packages to
 • ]8;id=169559;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-tests\write unit tests]8;;\
 • ]8;id=20647;https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#writing-documentation\provide documentation]8;;\, including tutorials where applicable
 • support users through github and the ]8;id=496112;https://discourse.scverse.org/\scverse discourse]8;;\
EOF

0 comments on commit 28d3bd0

Please sign in to comment.