Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post gen hook with detailed instructions #131

Merged
merged 3 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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