From fcc88df8f74ee956d7fd713e8a9986521097d07e Mon Sep 17 00:00:00 2001 From: "Xuan (Sean) Hu" Date: Fri, 26 Jan 2024 09:25:44 +0800 Subject: [PATCH] chore: Unify the name for folders, makefile rules and dependency groups. (#284) --- .github/workflows/ci.yml | 2 +- .github/workflows/pr.yml | 2 +- .github/workflows/release.yml | 4 +- .gitlab/ci/ci.yml | 2 +- .gitlab/ci/mr.yml | 2 +- .gitlab/ci/release.yml | 10 +- .readthedocs.yaml | 6 +- Makefile | 16 +-- docs/dev/commit.md | 6 +- docs/dev/env.md | 8 +- pdm.lock | 130 +++++++++--------- pyproject.toml | 4 +- template/.readthedocs.yaml | 6 +- template/Makefile.jinja | 16 +-- .../workflows/ci.yml.jinja | 2 +- .../workflows/pr.yml | 2 +- .../workflows/release.yml.jinja | 4 +- .../ci/ci.yml.jinja | 2 +- .../ci/mr.yml | 2 +- .../ci/release.yml | 10 +- template/docs/dev/commit.md | 6 +- template/docs/dev/env.md | 8 +- template/pyproject.toml.jinja | 4 +- template/{test => tests}/__init__.py | 0 template/{test => tests}/cli_test.py.jinja | 0 template/{test => tests}/pkg_test.py.jinja | 0 .../{test => tests}/settings_test.py.jinja | 0 {test => tests}/__init__.py | 0 {test => tests}/cli_test.py | 0 {test => tests}/pkg_test.py | 0 {test => tests}/settings_test.py | 0 31 files changed, 127 insertions(+), 127 deletions(-) rename template/{test => tests}/__init__.py (100%) rename template/{test => tests}/cli_test.py.jinja (100%) rename template/{test => tests}/pkg_test.py.jinja (100%) rename template/{test => tests}/settings_test.py.jinja (100%) rename {test => tests}/__init__.py (100%) rename {test => tests}/cli_test.py (100%) rename {test => tests}/pkg_test.py (100%) rename {test => tests}/settings_test.py (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b376779d..b9136142 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: python-version: ${{ matrix.python-version }} - run: env | sort - run: make dev - - run: make lint test docs build + - run: make lint test doc build strategy: matrix: python-version: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 64ab322f..eef3cd01 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Check PR Title for Conventional Commit Format run: | - if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then + if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|doc|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then echo 'The title does not conform to the Conventional Commit.' echo 'Please refer to "https://www.conventionalcommits.org/"' exit 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23ebe96e..16b26428 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,8 +25,8 @@ jobs: cache: true python-version: '3.12' - run: env | sort - - run: make dev-docs - - run: make docs + - run: make dev-doc + - run: make doc - name: Upload changelog uses: actions/upload-artifact@v4 with: diff --git a/.gitlab/ci/ci.yml b/.gitlab/ci/ci.yml index c5e6205e..e39093ee 100644 --- a/.gitlab/ci/ci.yml +++ b/.gitlab/ci/ci.yml @@ -21,5 +21,5 @@ ci: script: - env | sort - make dev - - make lint test docs build + - make lint test doc build stage: ci diff --git a/.gitlab/ci/mr.yml b/.gitlab/ci/mr.yml index 45a926d3..2240fec6 100644 --- a/.gitlab/ci/mr.yml +++ b/.gitlab/ci/mr.yml @@ -4,7 +4,7 @@ lint_title: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' script: - | - if ! echo "$CI_MERGE_REQUEST_TITLE" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then + if ! echo "$CI_MERGE_REQUEST_TITLE" | grep -Pq '^(build|chore|ci|doc|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then echo "The title does not conform to the Conventional Commit." echo "Please refer to 'https://www.conventionalcommits.org/'" exit 1 diff --git a/.gitlab/ci/release.yml b/.gitlab/ci/release.yml index 32b2054f..d4d27c15 100644 --- a/.gitlab/ci/release.yml +++ b/.gitlab/ci/release.yml @@ -1,4 +1,4 @@ -docs: +doc: artifacts: paths: - public @@ -8,8 +8,8 @@ docs: - if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/ script: - env | sort - - make dev-docs - - make docs + - make dev-doc + - make doc - make release-notes > release-notes.md stage: release package: @@ -27,7 +27,7 @@ pages: - public needs: - release - - docs + - doc rules: - if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/ script: @@ -36,7 +36,7 @@ pages: release: image: registry.gitlab.com/gitlab-org/release-cli:latest needs: - - docs + - doc release: description: release-notes.md tag_name: $CI_COMMIT_TAG diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9d3c43fe..f4bd8926 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,13 +1,13 @@ build: jobs: post_build: - - make docs-mypy - - make docs-coverage + - make doc-mypy + - make doc-coverage post_checkout: - git fetch --unshallow || true post_install: - python -m pip install --upgrade --no-cache-dir pdm - - make dev-docs + - make dev-doc pre_build: - make changelog os: ubuntu-22.04 diff --git a/Makefile b/Makefile index e8ccd6a9..dee6a657 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish docs-autobuild changelog docs-gen docs-mypy docs-coverage docs +.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish doc-autobuild changelog doc-gen doc-mypy doc-coverage doc ######################################################################################## # Variables @@ -118,7 +118,7 @@ publish: ######################################################################################## # Generate documentation with auto build when changes happen. -docs-autobuild: +doc-autobuild: pdm run $(PDM_GLOBAL) python -m sphinx_autobuild docs $(PUBLIC_DIR) \ --watch README.md \ --watch src @@ -130,27 +130,27 @@ changelog: echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \ wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \ fi - pdm run $(PDM_GLOBAL) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test + pdm run $(PDM_GLOBAL) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,doc,feat,fix,perf,refactor,revert,style,test # Generate release notes from changelog. release-notes: pdm run $(PDM_GLOBAL) git-changelog --input $(CHANGELOG_PATH) --release-notes # Build documentation only from src. -docs-gen: +doc-gen: pdm run $(PDM_GLOBAL) python -m sphinx.cmd.build docs $(PUBLIC_DIR) # Generate mypy reports. -docs-mypy: docs-gen - pdm run $(PDM_GLOBAL) python -m mypy src test --html-report $(PUBLIC_DIR)/reports/mypy +doc-mypy: doc-gen + pdm run $(PDM_GLOBAL) python -m mypy src tests --html-report $(PUBLIC_DIR)/reports/mypy # Generate html coverage reports with badge. -docs-coverage: test-run docs-gen +doc-coverage: test-run doc-gen pdm run $(PDM_GLOBAL) python -m coverage html -d $(PUBLIC_DIR)/reports/coverage pdm run $(PDM_GLOBAL) bash scripts/generate-coverage-badge.sh $(PUBLIC_DIR)/_static/badges # Generate all documentation with reports. -docs: changelog docs-gen docs-mypy docs-coverage +doc: changelog doc-gen doc-mypy doc-coverage ######################################################################################## # End diff --git a/docs/dev/commit.md b/docs/dev/commit.md index af463c3f..3567b0cc 100644 --- a/docs/dev/commit.md +++ b/docs/dev/commit.md @@ -12,7 +12,7 @@ Examples: ```text build(dependencies): bump the prod group with 9 updates. -docs: Add docs for commit convention. +doc: Add doc for commit convention. chore: remove deprecated key in ruff config. ``` @@ -24,7 +24,7 @@ Type | `build` | Changes that affect the build system or dependencies. | | `chore` | Routine tasks or changes outside the src/runtime code. | | `ci` | Changes related to continuous integration. | -| `docs` | Documentation changes. | +| `doc` | Documentation changes. | | `feat` | New features. | | `fix` | Bug fixes. | | `perf` | Performance improvements. | @@ -55,6 +55,6 @@ In this way, individual commit within development branches does not need to stri A CI/CD pipeline checks the titles of pull/merge requests against the following regex pattern: ```text -^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.* +^(build|chore|ci|doc|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.* ``` ```` diff --git a/docs/dev/env.md b/docs/dev/env.md index 01381d2c..e3d40030 100644 --- a/docs/dev/env.md +++ b/docs/dev/env.md @@ -81,11 +81,11 @@ make install ### Documentation generation -Install the project in editable mode with `docs` related dependencies, +Install the project in editable mode with `doc` related dependencies, recommended for scenarios like documentation generation CI/CD process. ```bash -make dev-docs +make dev-doc ``` ### Lint check @@ -117,9 +117,9 @@ make dev-test ````{admonition} Install a combination of the optional dependencies :class: tip, dropdown -For example, to install dependencies for `docs` and `lint`, we can use the following command. +For example, to install dependencies for `doc` and `lint`, we can use the following command. ```bash -make dev-docs,lint +make dev-doc,lint ``` ```` diff --git a/pdm.lock b/pdm.lock index 46f868c3..e8b2bfe5 100644 --- a/pdm.lock +++ b/pdm.lock @@ -2,17 +2,17 @@ # It is not intended for manual editing. [metadata] -groups = ["default", "docs", "lint", "test"] +groups = ["default", "doc", "lint", "test"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.1" -content_hash = "sha256:9bc8d0735145014ed96e6d0bdd83145c57c6ed34ee4d3058e75b46112c2b7dd0" +content_hash = "sha256:29ac1197b0152b1b81bbfe0ca4972ac59cf03b81b98a260c3e866807b0a270aa" [[package]] name = "alabaster" version = "0.7.13" requires_python = ">=3.6" summary = "A configurable sidebar-enabled Sphinx theme" -groups = ["docs"] +groups = ["doc"] files = [ {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, @@ -23,7 +23,7 @@ name = "annotated-types" version = "0.6.0" requires_python = ">=3.8" summary = "Reusable constraint types to use with typing.Annotated" -groups = ["default", "docs"] +groups = ["default", "doc"] dependencies = [ "typing-extensions>=4.0.0; python_version < \"3.9\"", ] @@ -36,7 +36,7 @@ files = [ name = "appdirs" version = "1.4.4" summary = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -groups = ["docs"] +groups = ["doc"] files = [ {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, @@ -47,7 +47,7 @@ name = "autodoc-pydantic" version = "2.0.1" requires_python = ">=3.7.1,<4.0.0" summary = "Seamlessly integrate pydantic models in your Sphinx documentation." -groups = ["docs"] +groups = ["doc"] dependencies = [ "Sphinx>=4.0", "importlib-metadata>1; python_version <= \"3.8\"", @@ -64,7 +64,7 @@ name = "babel" version = "2.14.0" requires_python = ">=3.7" summary = "Internationalization utilities" -groups = ["docs"] +groups = ["doc"] dependencies = [ "pytz>=2015.7; python_version < \"3.9\"", ] @@ -78,7 +78,7 @@ name = "beautifulsoup4" version = "4.12.2" requires_python = ">=3.6.0" summary = "Screen-scraping library" -groups = ["docs"] +groups = ["doc"] dependencies = [ "soupsieve>1.2", ] @@ -92,7 +92,7 @@ name = "certifi" version = "2023.11.17" requires_python = ">=3.6" summary = "Python package for providing Mozilla's CA Bundle." -groups = ["docs"] +groups = ["doc"] files = [ {file = "certifi-2023.11.17-py3-none-any.whl", hash = "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474"}, {file = "certifi-2023.11.17.tar.gz", hash = "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1"}, @@ -103,7 +103,7 @@ name = "charset-normalizer" version = "3.3.2" requires_python = ">=3.7.0" summary = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -groups = ["docs"] +groups = ["doc"] files = [ {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, @@ -189,7 +189,7 @@ name = "click" version = "8.1.7" requires_python = ">=3.7" summary = "Composable command line interface toolkit" -groups = ["default", "docs"] +groups = ["default", "doc"] dependencies = [ "colorama; platform_system == \"Windows\"", ] @@ -203,7 +203,7 @@ name = "colorama" version = "0.4.6" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" summary = "Cross-platform colored terminal text." -groups = ["default", "docs", "test"] +groups = ["default", "doc", "test"] files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -214,7 +214,7 @@ name = "coverage" version = "7.3.3" requires_python = ">=3.8" summary = "Code coverage measurement for Python" -groups = ["docs", "test"] +groups = ["doc", "test"] files = [ {file = "coverage-7.3.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d874434e0cb7b90f7af2b6e3309b0733cde8ec1476eb47db148ed7deeb2a9494"}, {file = "coverage-7.3.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ee6621dccce8af666b8c4651f9f43467bfbf409607c604b840b78f4ff3619aeb"}, @@ -275,7 +275,7 @@ name = "docutils" version = "0.20.1" requires_python = ">=3.7" summary = "Docutils -- Python Documentation Utilities" -groups = ["docs"] +groups = ["doc"] files = [ {file = "docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"}, {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"}, @@ -286,7 +286,7 @@ name = "exceptiongroup" version = "1.2.0" requires_python = ">=3.7" summary = "Backport of PEP 654 (exception groups)" -groups = ["docs", "test"] +groups = ["doc", "test"] marker = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, @@ -298,7 +298,7 @@ name = "furo" version = "2023.9.10" requires_python = ">=3.8" summary = "A clean customisable Sphinx documentation theme." -groups = ["docs"] +groups = ["doc"] dependencies = [ "beautifulsoup4", "pygments>=2.7", @@ -315,7 +315,7 @@ name = "git-changelog" version = "2.4.0" requires_python = ">=3.8" summary = "Automatic Changelog generator using Jinja2 templates." -groups = ["docs"] +groups = ["doc"] dependencies = [ "Jinja2>=2.10", "appdirs>=1.4", @@ -332,7 +332,7 @@ name = "idna" version = "3.6" requires_python = ">=3.5" summary = "Internationalized Domain Names in Applications (IDNA)" -groups = ["docs"] +groups = ["doc"] files = [ {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, @@ -343,7 +343,7 @@ name = "imagesize" version = "1.4.1" requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" summary = "Getting image size from png/jpeg/jpeg2000/gif file" -groups = ["docs"] +groups = ["doc"] files = [ {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, @@ -354,7 +354,7 @@ name = "importlib-metadata" version = "7.0.0" requires_python = ">=3.8" summary = "Read metadata from Python packages" -groups = ["docs"] +groups = ["doc"] marker = "python_version < \"3.10\"" dependencies = [ "zipp>=0.5", @@ -369,7 +369,7 @@ name = "iniconfig" version = "2.0.0" requires_python = ">=3.7" summary = "brain-dead simple config-ini parsing" -groups = ["docs", "test"] +groups = ["doc", "test"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -380,7 +380,7 @@ name = "jinja2" version = "3.1.2" requires_python = ">=3.7" summary = "A very fast and expressive template engine." -groups = ["docs"] +groups = ["doc"] dependencies = [ "MarkupSafe>=2.0", ] @@ -393,7 +393,7 @@ files = [ name = "livereload" version = "2.6.3" summary = "Python LiveReload is an awesome tool for web developers" -groups = ["docs"] +groups = ["doc"] dependencies = [ "six", "tornado; python_version > \"2.7\"", @@ -408,7 +408,7 @@ name = "lxml" version = "4.9.3" requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*" summary = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." -groups = ["docs"] +groups = ["doc"] files = [ {file = "lxml-4.9.3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:b86164d2cff4d3aaa1f04a14685cbc072efd0b4f99ca5708b2ad1b9b5988a991"}, {file = "lxml-4.9.3-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:42871176e7896d5d45138f6d28751053c711ed4d48d8e30b498da155af39aebd"}, @@ -477,7 +477,7 @@ name = "markdown-it-py" version = "3.0.0" requires_python = ">=3.8" summary = "Python port of markdown-it. Markdown parsing, done right!" -groups = ["default", "docs"] +groups = ["default", "doc"] dependencies = [ "mdurl~=0.1", ] @@ -491,7 +491,7 @@ name = "markupsafe" version = "2.1.3" requires_python = ">=3.7" summary = "Safely add untrusted strings to HTML/XML markup." -groups = ["docs"] +groups = ["doc"] files = [ {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"}, {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"}, @@ -551,7 +551,7 @@ name = "mdit-py-plugins" version = "0.4.0" requires_python = ">=3.8" summary = "Collection of plugins for markdown-it-py" -groups = ["docs"] +groups = ["doc"] dependencies = [ "markdown-it-py<4.0.0,>=1.0.0", ] @@ -565,7 +565,7 @@ name = "mdurl" version = "0.1.2" requires_python = ">=3.7" summary = "Markdown URL utilities" -groups = ["default", "docs"] +groups = ["default", "doc"] files = [ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, @@ -576,7 +576,7 @@ name = "mypy" version = "1.7.1" requires_python = ">=3.8" summary = "Optional static typing for Python" -groups = ["docs", "lint"] +groups = ["doc", "lint"] dependencies = [ "mypy-extensions>=1.0.0", "tomli>=1.1.0; python_version < \"3.11\"", @@ -617,7 +617,7 @@ name = "mypy-extensions" version = "1.0.0" requires_python = ">=3.5" summary = "Type system extensions for programs checked with the mypy type checker." -groups = ["docs", "lint"] +groups = ["doc", "lint"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -629,7 +629,7 @@ version = "1.7.1" extras = ["reports"] requires_python = ">=3.8" summary = "Optional static typing for Python" -groups = ["docs"] +groups = ["doc"] dependencies = [ "lxml", "mypy==1.7.1", @@ -669,7 +669,7 @@ name = "myst-parser" version = "2.0.0" requires_python = ">=3.8" summary = "An extended [CommonMark](https://spec.commonmark.org/) compliant parser," -groups = ["docs"] +groups = ["doc"] dependencies = [ "docutils<0.21,>=0.16", "jinja2", @@ -688,7 +688,7 @@ name = "packaging" version = "23.2" requires_python = ">=3.7" summary = "Core utilities for Python packages" -groups = ["docs", "test"] +groups = ["doc", "test"] files = [ {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, @@ -699,7 +699,7 @@ name = "pluggy" version = "1.3.0" requires_python = ">=3.8" summary = "plugin and hook calling mechanisms for python" -groups = ["docs", "test"] +groups = ["doc", "test"] files = [ {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, @@ -710,7 +710,7 @@ name = "pydantic" version = "2.5.2" requires_python = ">=3.7" summary = "Data validation using Python type hints" -groups = ["default", "docs"] +groups = ["default", "doc"] dependencies = [ "annotated-types>=0.4.0", "pydantic-core==2.14.5", @@ -726,7 +726,7 @@ name = "pydantic-core" version = "2.14.5" requires_python = ">=3.7" summary = "" -groups = ["default", "docs"] +groups = ["default", "doc"] dependencies = [ "typing-extensions!=4.7.0,>=4.6.0", ] @@ -831,7 +831,7 @@ name = "pydantic-settings" version = "2.1.0" requires_python = ">=3.8" summary = "Settings management using Pydantic" -groups = ["default", "docs"] +groups = ["default", "doc"] dependencies = [ "pydantic>=2.3.0", "python-dotenv>=0.21.0", @@ -846,7 +846,7 @@ name = "pygments" version = "2.17.2" requires_python = ">=3.7" summary = "Pygments is a syntax highlighting package written in Python." -groups = ["default", "docs"] +groups = ["default", "doc"] files = [ {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, @@ -857,7 +857,7 @@ name = "pytest" version = "7.4.3" requires_python = ">=3.7" summary = "pytest: simple powerful testing with Python" -groups = ["docs", "test"] +groups = ["doc", "test"] dependencies = [ "colorama; sys_platform == \"win32\"", "exceptiongroup>=1.0.0rc8; python_version < \"3.11\"", @@ -876,7 +876,7 @@ name = "python-dotenv" version = "1.0.0" requires_python = ">=3.8" summary = "Read key-value pairs from a .env file and set them as environment variables" -groups = ["default", "docs"] +groups = ["default", "doc"] files = [ {file = "python-dotenv-1.0.0.tar.gz", hash = "sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba"}, {file = "python_dotenv-1.0.0-py3-none-any.whl", hash = "sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a"}, @@ -886,7 +886,7 @@ files = [ name = "pytz" version = "2023.3.post1" summary = "World timezone definitions, modern and historical" -groups = ["docs"] +groups = ["doc"] marker = "python_version < \"3.9\"" files = [ {file = "pytz-2023.3.post1-py2.py3-none-any.whl", hash = "sha256:ce42d816b81b68506614c11e8937d3aa9e41007ceb50bfdcb0749b921bf646c7"}, @@ -898,7 +898,7 @@ name = "pyyaml" version = "6.0.1" requires_python = ">=3.6" summary = "YAML parser and emitter for Python" -groups = ["docs"] +groups = ["doc"] files = [ {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, @@ -945,7 +945,7 @@ name = "requests" version = "2.31.0" requires_python = ">=3.7" summary = "Python HTTP for Humans." -groups = ["docs"] +groups = ["doc"] dependencies = [ "certifi>=2017.4.17", "charset-normalizer<4,>=2", @@ -1004,7 +1004,7 @@ name = "semver" version = "3.0.2" requires_python = ">=3.7" summary = "Python helper for Semantic Versioning (https://semver.org)" -groups = ["docs"] +groups = ["doc"] files = [ {file = "semver-3.0.2-py3-none-any.whl", hash = "sha256:b1ea4686fe70b981f85359eda33199d60c53964284e0cfb4977d243e37cf4bf4"}, {file = "semver-3.0.2.tar.gz", hash = "sha256:6253adb39c70f6e51afed2fa7152bcd414c411286088fb4b9effb133885ab4cc"}, @@ -1015,7 +1015,7 @@ name = "setuptools" version = "69.0.2" requires_python = ">=3.8" summary = "Easily download, build, install, upgrade, and uninstall Python packages" -groups = ["docs"] +groups = ["doc"] files = [ {file = "setuptools-69.0.2-py3-none-any.whl", hash = "sha256:1e8fdff6797d3865f37397be788a4e3cba233608e9b509382a2777d25ebde7f2"}, {file = "setuptools-69.0.2.tar.gz", hash = "sha256:735896e78a4742605974de002ac60562d286fa8051a7e2299445e8e8fbb01aa6"}, @@ -1037,7 +1037,7 @@ name = "six" version = "1.16.0" requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" summary = "Python 2 and 3 compatibility utilities" -groups = ["docs"] +groups = ["doc"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -1047,7 +1047,7 @@ files = [ name = "snowballstemmer" version = "2.2.0" summary = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -groups = ["docs"] +groups = ["doc"] files = [ {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, @@ -1058,7 +1058,7 @@ name = "soupsieve" version = "2.5" requires_python = ">=3.8" summary = "A modern CSS selector implementation for Beautiful Soup." -groups = ["docs"] +groups = ["doc"] files = [ {file = "soupsieve-2.5-py3-none-any.whl", hash = "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7"}, {file = "soupsieve-2.5.tar.gz", hash = "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"}, @@ -1069,7 +1069,7 @@ name = "sphinx" version = "7.1.2" requires_python = ">=3.8" summary = "Python documentation generator" -groups = ["docs"] +groups = ["doc"] dependencies = [ "Jinja2>=3.0", "Pygments>=2.13", @@ -1099,7 +1099,7 @@ name = "sphinx-autobuild" version = "2021.3.14" requires_python = ">=3.6" summary = "Rebuild Sphinx documentation on changes, with live-reload in the browser." -groups = ["docs"] +groups = ["doc"] dependencies = [ "colorama", "livereload", @@ -1115,7 +1115,7 @@ name = "sphinx-basic-ng" version = "1.0.0b2" requires_python = ">=3.7" summary = "A modern skeleton for Sphinx themes." -groups = ["docs"] +groups = ["doc"] dependencies = [ "sphinx>=4.0", ] @@ -1129,7 +1129,7 @@ name = "sphinx-click" version = "5.1.0" requires_python = ">=3.8" summary = "Sphinx extension that automatically documents click applications" -groups = ["docs"] +groups = ["doc"] dependencies = [ "click>=7.0", "docutils", @@ -1144,7 +1144,7 @@ files = [ name = "sphinx-togglebutton" version = "0.3.2" summary = "Toggle page content and collapse admonitions in Sphinx." -groups = ["docs"] +groups = ["doc"] dependencies = [ "docutils", "setuptools", @@ -1161,7 +1161,7 @@ name = "sphinxcontrib-applehelp" version = "1.0.4" requires_python = ">=3.8" summary = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" -groups = ["docs"] +groups = ["doc"] files = [ {file = "sphinxcontrib-applehelp-1.0.4.tar.gz", hash = "sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e"}, {file = "sphinxcontrib_applehelp-1.0.4-py3-none-any.whl", hash = "sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228"}, @@ -1172,7 +1172,7 @@ name = "sphinxcontrib-devhelp" version = "1.0.2" requires_python = ">=3.5" summary = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." -groups = ["docs"] +groups = ["doc"] files = [ {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, @@ -1183,7 +1183,7 @@ name = "sphinxcontrib-htmlhelp" version = "2.0.1" requires_python = ">=3.8" summary = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -groups = ["docs"] +groups = ["doc"] files = [ {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, @@ -1194,7 +1194,7 @@ name = "sphinxcontrib-jsmath" version = "1.0.1" requires_python = ">=3.5" summary = "A sphinx extension which renders display math in HTML via JavaScript" -groups = ["docs"] +groups = ["doc"] files = [ {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, @@ -1205,7 +1205,7 @@ name = "sphinxcontrib-qthelp" version = "1.0.3" requires_python = ">=3.5" summary = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." -groups = ["docs"] +groups = ["doc"] files = [ {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, @@ -1216,7 +1216,7 @@ name = "sphinxcontrib-serializinghtml" version = "1.1.5" requires_python = ">=3.5" summary = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." -groups = ["docs"] +groups = ["doc"] files = [ {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, @@ -1241,7 +1241,7 @@ name = "tomli" version = "2.0.1" requires_python = ">=3.7" summary = "A lil' TOML parser" -groups = ["docs", "lint", "test"] +groups = ["doc", "lint", "test"] marker = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, @@ -1264,7 +1264,7 @@ name = "tornado" version = "6.4" requires_python = ">= 3.8" summary = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." -groups = ["docs"] +groups = ["doc"] marker = "python_version > \"2.7\"" files = [ {file = "tornado-6.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:02ccefc7d8211e5a7f9e8bc3f9e5b0ad6262ba2fbb683a6443ecc804e5224ce0"}, @@ -1318,7 +1318,7 @@ name = "typing-extensions" version = "4.9.0" requires_python = ">=3.8" summary = "Backported and Experimental Type Hints for Python 3.8+" -groups = ["default", "docs", "lint"] +groups = ["default", "doc", "lint"] files = [ {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, @@ -1329,7 +1329,7 @@ name = "urllib3" version = "2.1.0" requires_python = ">=3.8" summary = "HTTP library with thread-safe connection pooling, file post, and more." -groups = ["docs"] +groups = ["doc"] files = [ {file = "urllib3-2.1.0-py3-none-any.whl", hash = "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3"}, {file = "urllib3-2.1.0.tar.gz", hash = "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54"}, @@ -1340,7 +1340,7 @@ name = "wheel" version = "0.42.0" requires_python = ">=3.7" summary = "A built-package format for Python" -groups = ["docs"] +groups = ["doc"] files = [ {file = "wheel-0.42.0-py3-none-any.whl", hash = "sha256:177f9c9b0d45c47873b619f5b650346d632cdc35fb5e4d25058e09c9e581433d"}, {file = "wheel-0.42.0.tar.gz", hash = "sha256:c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8"}, @@ -1351,7 +1351,7 @@ name = "zipp" version = "3.17.0" requires_python = ">=3.8" summary = "Backport of pathlib-compatible object wrapper for zip files" -groups = ["docs"] +groups = ["doc"] marker = "python_version < \"3.10\"" files = [ {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, diff --git a/pyproject.toml b/pyproject.toml index afebbc3a..e7e97776 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ warn_unused_ignores = true package-type = "library" [tool.pdm.dev-dependencies] -docs = [ +doc = [ "Sphinx", "autodoc-pydantic", "coverage", @@ -128,7 +128,7 @@ select = [ ] [tool.ruff.lint.per-file-ignores] -"test/*" = ["S101"] +"tests/*" = ["S101"] [tool.ruff.lint.pydocstyle] convention = "google" diff --git a/template/.readthedocs.yaml b/template/.readthedocs.yaml index 9d3c43fe..f4bd8926 100644 --- a/template/.readthedocs.yaml +++ b/template/.readthedocs.yaml @@ -1,13 +1,13 @@ build: jobs: post_build: - - make docs-mypy - - make docs-coverage + - make doc-mypy + - make doc-coverage post_checkout: - git fetch --unshallow || true post_install: - python -m pip install --upgrade --no-cache-dir pdm - - make dev-docs + - make dev-doc pre_build: - make changelog os: ubuntu-22.04 diff --git a/template/Makefile.jinja b/template/Makefile.jinja index f97bec60..c64c0637 100644 --- a/template/Makefile.jinja +++ b/template/Makefile.jinja @@ -1,5 +1,5 @@ [% from pathjoin("includes", "variable.jinja") import page_url with context -%] -.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish docs-autobuild changelog docs-gen docs-mypy docs-coverage docs +.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish doc-autobuild changelog doc-gen doc-mypy doc-coverage doc ######################################################################################## # Variables @@ -121,7 +121,7 @@ publish: ######################################################################################## # Generate documentation with auto build when changes happen. -docs-autobuild: +doc-autobuild: pdm run $(PDM_GLOBAL) python -m sphinx_autobuild docs $(PUBLIC_DIR) \ --watch README.md \ --watch src @@ -133,27 +133,27 @@ changelog: echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \ wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \ fi - pdm run $(PDM_GLOBAL) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test + pdm run $(PDM_GLOBAL) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,doc,feat,fix,perf,refactor,revert,style,test # Generate release notes from changelog. release-notes: pdm run $(PDM_GLOBAL) git-changelog --input $(CHANGELOG_PATH) --release-notes # Build documentation only from src. -docs-gen: +doc-gen: pdm run $(PDM_GLOBAL) python -m sphinx.cmd.build docs $(PUBLIC_DIR) # Generate mypy reports. -docs-mypy: docs-gen - pdm run $(PDM_GLOBAL) python -m mypy src test --html-report $(PUBLIC_DIR)/reports/mypy +doc-mypy: doc-gen + pdm run $(PDM_GLOBAL) python -m mypy src tests --html-report $(PUBLIC_DIR)/reports/mypy # Generate html coverage reports with badge. -docs-coverage: test-run docs-gen +doc-coverage: test-run doc-gen pdm run $(PDM_GLOBAL) python -m coverage html -d $(PUBLIC_DIR)/reports/coverage pdm run $(PDM_GLOBAL) bash scripts/generate-coverage-badge.sh $(PUBLIC_DIR)/_static/badges # Generate all documentation with reports. -docs: changelog docs-gen docs-mypy docs-coverage +doc: changelog doc-gen doc-mypy doc-coverage ######################################################################################## # End diff --git a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja index 8e5481cb..6a90754b 100644 --- a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja +++ b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja @@ -17,7 +17,7 @@ jobs: python-version: {{ '${{ matrix.python-version }}' }} - run: env | sort - run: make dev - - run: make lint test docs build + - run: make lint test doc build strategy: matrix: python-version: diff --git a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/pr.yml b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/pr.yml index 64ab322f..eef3cd01 100644 --- a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/pr.yml +++ b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/pr.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Check PR Title for Conventional Commit Format run: | - if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then + if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|doc|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then echo 'The title does not conform to the Conventional Commit.' echo 'Please refer to "https://www.conventionalcommits.org/"' exit 1 diff --git a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja index a5927d4c..9f02d2f4 100644 --- a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja +++ b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja @@ -25,8 +25,8 @@ jobs: cache: true python-version: '{{ default_py }}' - run: env | sort - - run: make dev-docs - - run: make docs + - run: make dev-doc + - run: make doc - name: Upload changelog uses: actions/upload-artifact@v4 with: diff --git a/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/ci.yml.jinja b/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/ci.yml.jinja index 6a1c94b3..0ee4188c 100644 --- a/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/ci.yml.jinja +++ b/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/ci.yml.jinja @@ -32,5 +32,5 @@ ci: script: - env | sort - make dev - - make lint test docs build + - make lint test doc build stage: ci diff --git a/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/mr.yml b/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/mr.yml index 45a926d3..2240fec6 100644 --- a/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/mr.yml +++ b/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/mr.yml @@ -4,7 +4,7 @@ lint_title: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' script: - | - if ! echo "$CI_MERGE_REQUEST_TITLE" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then + if ! echo "$CI_MERGE_REQUEST_TITLE" | grep -Pq '^(build|chore|ci|doc|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then echo "The title does not conform to the Conventional Commit." echo "Please refer to 'https://www.conventionalcommits.org/'" exit 1 diff --git a/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/release.yml b/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/release.yml index 32b2054f..d4d27c15 100644 --- a/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/release.yml +++ b/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab[% endif %]/ci/release.yml @@ -1,4 +1,4 @@ -docs: +doc: artifacts: paths: - public @@ -8,8 +8,8 @@ docs: - if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/ script: - env | sort - - make dev-docs - - make docs + - make dev-doc + - make doc - make release-notes > release-notes.md stage: release package: @@ -27,7 +27,7 @@ pages: - public needs: - release - - docs + - doc rules: - if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/ script: @@ -36,7 +36,7 @@ pages: release: image: registry.gitlab.com/gitlab-org/release-cli:latest needs: - - docs + - doc release: description: release-notes.md tag_name: $CI_COMMIT_TAG diff --git a/template/docs/dev/commit.md b/template/docs/dev/commit.md index af463c3f..3567b0cc 100644 --- a/template/docs/dev/commit.md +++ b/template/docs/dev/commit.md @@ -12,7 +12,7 @@ Examples: ```text build(dependencies): bump the prod group with 9 updates. -docs: Add docs for commit convention. +doc: Add doc for commit convention. chore: remove deprecated key in ruff config. ``` @@ -24,7 +24,7 @@ Type | `build` | Changes that affect the build system or dependencies. | | `chore` | Routine tasks or changes outside the src/runtime code. | | `ci` | Changes related to continuous integration. | -| `docs` | Documentation changes. | +| `doc` | Documentation changes. | | `feat` | New features. | | `fix` | Bug fixes. | | `perf` | Performance improvements. | @@ -55,6 +55,6 @@ In this way, individual commit within development branches does not need to stri A CI/CD pipeline checks the titles of pull/merge requests against the following regex pattern: ```text -^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.* +^(build|chore|ci|doc|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.* ``` ```` diff --git a/template/docs/dev/env.md b/template/docs/dev/env.md index 01381d2c..e3d40030 100644 --- a/template/docs/dev/env.md +++ b/template/docs/dev/env.md @@ -81,11 +81,11 @@ make install ### Documentation generation -Install the project in editable mode with `docs` related dependencies, +Install the project in editable mode with `doc` related dependencies, recommended for scenarios like documentation generation CI/CD process. ```bash -make dev-docs +make dev-doc ``` ### Lint check @@ -117,9 +117,9 @@ make dev-test ````{admonition} Install a combination of the optional dependencies :class: tip, dropdown -For example, to install dependencies for `docs` and `lint`, we can use the following command. +For example, to install dependencies for `doc` and `lint`, we can use the following command. ```bash -make dev-docs,lint +make dev-doc,lint ``` ```` diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 3037f580..d22dadb5 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -112,7 +112,7 @@ warn_unused_ignores = true package-type = "library" [tool.pdm.dev-dependencies] -docs = [ +doc = [ "Sphinx", "autodoc-pydantic", "coverage", @@ -170,7 +170,7 @@ select = [ ] [tool.ruff.lint.per-file-ignores] -"test/*" = ["S101"] +"tests/*" = ["S101"] [tool.ruff.lint.pydocstyle] convention = "google" diff --git a/template/test/__init__.py b/template/tests/__init__.py similarity index 100% rename from template/test/__init__.py rename to template/tests/__init__.py diff --git a/template/test/cli_test.py.jinja b/template/tests/cli_test.py.jinja similarity index 100% rename from template/test/cli_test.py.jinja rename to template/tests/cli_test.py.jinja diff --git a/template/test/pkg_test.py.jinja b/template/tests/pkg_test.py.jinja similarity index 100% rename from template/test/pkg_test.py.jinja rename to template/tests/pkg_test.py.jinja diff --git a/template/test/settings_test.py.jinja b/template/tests/settings_test.py.jinja similarity index 100% rename from template/test/settings_test.py.jinja rename to template/tests/settings_test.py.jinja diff --git a/test/__init__.py b/tests/__init__.py similarity index 100% rename from test/__init__.py rename to tests/__init__.py diff --git a/test/cli_test.py b/tests/cli_test.py similarity index 100% rename from test/cli_test.py rename to tests/cli_test.py diff --git a/test/pkg_test.py b/tests/pkg_test.py similarity index 100% rename from test/pkg_test.py rename to tests/pkg_test.py diff --git a/test/settings_test.py b/tests/settings_test.py similarity index 100% rename from test/settings_test.py rename to tests/settings_test.py