Skip to content

Commit

Permalink
docs: Add development status as template option. (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored Oct 27, 2023
1 parent 4d243e9 commit fed3045
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"_message_after_update",
"project_name",
"project_description",
"development_status",
"copyright_license",
"copyright_year",
"author_name",
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ A development-focused Python project template with various integrations, configu
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/5697b1e4c4a9790ece607654e6c02a160620c7e1/docs/badge/v2.json)](https://pydantic.dev)
[![Serious Scaffold Python](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/_static/badges/logo.json)](https://serious-scaffold.github.io/serious-scaffold-python)

> [!WARNING]
> _Serious Scaffold Python_ is in the **Alpha** phase.
> Frequent changes and instability should be anticipated.
> Any feedback, comments, suggestions and contributions are welcome!
[![Serious Scaffold Python](https://serious-scaffold.github.io/serious-scaffold-python/_static/images/logo.svg)](https://github.com/serious-scaffold/serious-scaffold-python)

Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template.
Expand Down
8 changes: 8 additions & 0 deletions copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ project_description:
default: A development-focused Python project template with various integrations, configurations and modules.
help: 'Provide a brief description for the project:'
type: str
development_status:
default: Alpha
choices:
- Alpha
- Beta
- Production/Stable
help: 'Choose the development status:'
type: str
copyright_license:
default: MIT License
choices:
Expand Down
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
}
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
templates_path = ["_templates"]
html_theme_options = {
"announcement": (
"<em>Serious Scaffold Python</em> is in the <strong>Alpha</strong> phase. "
"Frequent changes and instability should be anticipated. "
"Any feedback, comments, suggestions and contributions are welcome!"
),
}

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
{email = "[email protected]", name = "huxuan"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
Expand Down
1 change: 1 addition & 0 deletions template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"_message_after_update",
"project_name",
"project_description",
"development_status",
"copyright_license",
"copyright_year",
"author_name",
Expand Down
15 changes: 15 additions & 0 deletions template/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/5697b1e4c4a9790ece607654e6c02a160620c7e1/docs/badge/v2.json)](https://pydantic.dev)
{{ logo_badge() }}

[% if development_status == "Alpha" -%]
> [!WARNING]
[% elif development_status == "Beta" -%]
> [!IMPORTANT]
[% elif development_status == "Stable" -%]
> [!NOTE]
[% endif -%]
> _{{ project_name }}_ is in the **{{ development_status }}** phase.
[%- if development_status == "Alpha" %]
> Frequent changes and instability should be anticipated.
[%- elif development_status == "Beta" %]
> Changes and potential instability should be anticipated.
[%- endif %]
> Any feedback, comments, suggestions and contributions are welcome!

[![{{ project_name }}](https://{{ page_url() }}/_static/images/logo.svg)](https://{{ repo_url() }})

Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template.
Expand Down
11 changes: 11 additions & 0 deletions template/docs/conf.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ source_suffix = {
}
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
templates_path = ["_templates"]
html_theme_options = {
"announcement": (
"<em>{{ project_name }}</em> is in the <strong>{{ development_status }}</strong> phase. "
[%- if development_status == "Alpha" %]
"Frequent changes and instability should be anticipated. "
[%- elif development_status == "Beta" %]
"Changes and potential instability should be anticipated. "
[%- endif %]
"Any feedback, comments, suggestions and contributions are welcome!"
),
}

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Expand Down
6 changes: 6 additions & 0 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ authors = [
{email = "{{ author_email }}", name = "{{ author_name }}"},
]
classifiers = [
[%- if development_status == "Alpha" %]
"Development Status :: 3 - Alpha",
[%- elif development_status == "Beta" %]
"Development Status :: 4 - Beta",
[%- elif development_status == "Stable" %]
"Development Status :: 5 - Production/Stable",
[%- endif %]
"License :: OSI Approved :: {{ copyright_license }}",
"Operating System :: OS Independent",
[%- if version_between("3.10", min_py, max_py) %]
Expand Down

0 comments on commit fed3045

Please sign in to comment.