From fed3045bb12ff420fd15667d703836dcb2378f62 Mon Sep 17 00:00:00 2001 From: "Xuan (Sean) Hu" Date: Fri, 27 Oct 2023 11:18:12 +0800 Subject: [PATCH] docs: Add development status as template option. (#219) --- .vscode/settings.json | 1 + README.md | 5 +++++ copier.yaml | 8 ++++++++ docs/conf.py | 7 +++++++ pyproject.toml | 2 +- template/.vscode/settings.json | 1 + template/README.md.jinja | 15 +++++++++++++++ template/docs/conf.py.jinja | 11 +++++++++++ template/pyproject.toml.jinja | 6 ++++++ 9 files changed, 55 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 500e2d5c..e719cf59 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -90,6 +90,7 @@ "_message_after_update", "project_name", "project_description", + "development_status", "copyright_license", "copyright_year", "author_name", diff --git a/README.md b/README.md index 2bb6f93f..2da29857 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/copier.yaml b/copier.yaml index e980fd16..41f77e83 100644 --- a/copier.yaml +++ b/copier.yaml @@ -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: diff --git a/docs/conf.py b/docs/conf.py index 2e883ea0..f1cad5da 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,6 +34,13 @@ } exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] templates_path = ["_templates"] +html_theme_options = { + "announcement": ( + "Serious Scaffold Python is in the Alpha 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 diff --git a/pyproject.toml b/pyproject.toml index ab6ed793..fe54ff77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ {email = "i@huxuan.org", 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", diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json index 500e2d5c..e719cf59 100644 --- a/template/.vscode/settings.json +++ b/template/.vscode/settings.json @@ -90,6 +90,7 @@ "_message_after_update", "project_name", "project_description", + "development_status", "copyright_license", "copyright_year", "author_name", diff --git a/template/README.md.jinja b/template/README.md.jinja index 25078bbf..f9e482e5 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -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. diff --git a/template/docs/conf.py.jinja b/template/docs/conf.py.jinja index c901a742..41e9ad22 100644 --- a/template/docs/conf.py.jinja +++ b/template/docs/conf.py.jinja @@ -34,6 +34,17 @@ source_suffix = { } exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] templates_path = ["_templates"] +html_theme_options = { + "announcement": ( + "{{ 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!" + ), +} # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 1dd4b552..49abde26 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -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) %]