diff --git a/copier.yaml b/copier.yaml index c507272f..40cdacf1 100644 --- a/copier.yaml +++ b/copier.yaml @@ -1,6 +1,4 @@ _envops: - block_end_string: "%]" - block_start_string: "[%" lstrip_blocks: true trim_blocks: true _subdirectory: template @@ -79,31 +77,31 @@ repo_platform: type: str repo_host: default: |- - [% if repo_platform == 'github' %] + {% if repo_platform == 'github' %} github.com - [%- elif repo_platform == 'gitlab' %] + {%- elif repo_platform == 'gitlab' %} gitlab.com - [%- endif %] + {%- endif %} help: "Specify the host of the self-managed GitLab:" type: str when: '{{ repo_platform == "gitlab-self-managed" }}' page_host: default: |- - [% if repo_platform == 'github' %] + {% if repo_platform == 'github' %} github.io - [%- elif repo_platform == 'gitlab' %] + {%- elif repo_platform == 'gitlab' %} gitlab.io - [%- endif %] + {%- endif %} help: "Specify the host of the self-managed GitLab Pages:" type: str when: '{{ repo_platform == "gitlab-self-managed" }}' container_registry_host: default: |- - [% if repo_platform == 'github' %] + {% if repo_platform == 'github' %} ghcr.io - [%- elif repo_platform == 'gitlab' %] + {%- elif repo_platform == 'gitlab' %} registry.gitlab.com - [%- endif %] + {%- endif %} help: "Specify the host of the self-managed GitLab Container Registry:" type: str when: '{{ repo_platform == "gitlab-self-managed" }}' @@ -127,7 +125,7 @@ coverage_threshold: default: 100 help: "Set the threshold for test coverage, ranging from 0 to 100:" type: int - validator: "[% if not 0 <= coverage_threshold <= 100 %]Test Coverage threshold should be between 0 and 100[% endif %]" + validator: "{% if not 0 <= coverage_threshold <= 100 %}Test Coverage threshold should be between 0 and 100{% endif %}" platforms: default: ["macos", "ubuntu", "windows"] choices: @@ -151,16 +149,16 @@ max_py: default: "3.12" choices: "3.9": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %]{{ version_higher_than_validator("3.9", min_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %}{{ version_higher_than_validator("3.9", min_py) }}' value: "3.9" "3.10": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %]{{ version_higher_than_validator("3.10", min_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %}{{ version_higher_than_validator("3.10", min_py) }}' value: "3.10" "3.11": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %]{{ version_higher_than_validator("3.11", min_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %}{{ version_higher_than_validator("3.11", min_py) }}' value: "3.11" "3.12": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %]{{ version_higher_than_validator("3.12", min_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_higher_than_validator %}{{ version_higher_than_validator("3.12", min_py) }}' value: "3.12" "3.13": value: "3.13" @@ -170,29 +168,29 @@ default_py: default: "{{ max_py }}" choices: "3.9": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_between_validator %]{{ version_between_validator("3.9", min_py, max_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_between_validator %}{{ version_between_validator("3.9", min_py, max_py) }}' value: "3.9" "3.10": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_between_validator %]{{ version_between_validator("3.10", min_py, max_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_between_validator %}{{ version_between_validator("3.10", min_py, max_py) }}' value: "3.10" "3.11": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_between_validator %]{{ version_between_validator("3.11", min_py, max_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_between_validator %}{{ version_between_validator("3.11", min_py, max_py) }}' value: "3.11" "3.12": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_between_validator %]{{ version_between_validator("3.12", min_py, max_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_between_validator %}{{ version_between_validator("3.12", min_py, max_py) }}' value: "3.12" "3.13": - validator: '[% from pathjoin("includes", "version_compare.jinja") import version_between_validator %]{{ version_between_validator("3.13", min_py, max_py) }}' + validator: '{% from pathjoin("includes", "version_compare.jinja") import version_between_validator %}{{ version_between_validator("3.13", min_py, max_py) }}' value: "3.13" help: "Choose the default Python version for development, documentation generation, and package build:" type: str readme_content: default: |- - [% if project_name == 'Serious Scaffold Python' %] - [% from pathjoin("includes", "sample.jinja") import readme_content with context %]{{ readme_content() }} - [%- else %] + {% if project_name == 'Serious Scaffold Python' %} + {% from pathjoin("includes", "sample.jinja") import readme_content with context %}{{ readme_content() }} + {%- else %} ## A multiline README content here - [%- endif %] + {%- endif %} help: "Provide a multiline content to be used in the README and documentation's index page:" multiline: true type: str diff --git a/includes/sample.jinja b/includes/sample.jinja index 4b69ea42..e41ad692 100644 --- a/includes/sample.jinja +++ b/includes/sample.jinja @@ -1,13 +1,13 @@ -[% macro readme_content() %] -[% from pathjoin("includes", "variable.jinja") import page_url with context %] -[% from pathjoin("includes", "variable.jinja") import repo_url with context %] +{% macro readme_content() %} +{% from pathjoin("includes", "variable.jinja") import page_url with context %} +{% from pathjoin("includes", "variable.jinja") import repo_url with context %} [![{{ project_name }}](https://{{ page_url() }}/_static/images/logo.svg)](https://{{ repo_url() }}) Serious Scaffold Python is crafted for long-term, maintainable Python projects. It includes GitHub Actions and GitLab CI/CD, automated dependency updates via Renovate, and comprehensive linting, testing, and documentation. Key integrations like pdm for environment and dependency management, click for CLI development, and pydantic for configuration enhance project robustness. With copier’s easy project setup and continuous updating, your project stays aligned with best practices for sustainable development. Pre-configured dev containers and cross-platform CI support ensure maintainability from the start. -[% if repo_platform == 'github' %] +{% if repo_platform == 'github' %} If you find this helpful, please consider [sponsorship](https://github.com/sponsors/{{ author_name }}). -[% endif %] +{% endif %} ## 🛠️ Features @@ -76,4 +76,4 @@ pipx install copier==9.4.1 ``` 1. That's it! Feel free to focus on the coding within `src` folder. -[% endmacro %] +{% endmacro %} diff --git a/includes/variable.jinja b/includes/variable.jinja index 4ba87b5a..fe6836fb 100644 --- a/includes/variable.jinja +++ b/includes/variable.jinja @@ -1,75 +1,75 @@ -[% macro coverage_badge() %] - [% if repo_platform == 'github' %] +{% macro coverage_badge() %} + {% if repo_platform == 'github' %} [![Coverage](https://img.shields.io/endpoint?url=https://{{ page_url() }}/_static/badges/coverage.json)](https://{{ page_url() }}/reports/coverage) - [%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] + {%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} [![coverage report](https://{{ repo_url() }}/badges/main/coverage.svg)](https://{{ repo_url() }}/-/commits/main) - [%- endif %] -[% endmacro %] + {%- endif %} +{% endmacro %} -[% macro license_badge() %] - [% if repo_platform == 'github' %] +{% macro license_badge() %} + {% if repo_platform == 'github' %} [![GitHub](https://img.shields.io/github/license/{{ repo_namespace }}/{{ repo_name }})]({{ license_url() }}) - [%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] + {%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} [![GitLab](https://img.shields.io/gitlab/license/{{ repo_namespace }}/{{ repo_name }}?gitlab_url=https%3A%2F%2F{{ repo_host }})]({{ license_url() }}) - [%- endif %] -[% endmacro %] + {%- endif %} +{% endmacro %} -[% macro license_url() %] - [% if repo_platform == 'github' %] +{% macro license_url() %} + {% if repo_platform == 'github' %} https://{{ repo_url() }}/blob/main/LICENSE - [%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] + {%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} https://{{ repo_url() }}/-/blob/main/LICENSE - [%- endif %] -[% endmacro %] + {%- endif %} +{% endmacro %} -[% macro logo_badge() %] +{% macro logo_badge() %} [![Serious Scaffold Python]({{ logo_badge_url() }})](https://serious-scaffold.github.io/ss-python) -[%- endmacro %] +{%- endmacro %} -[% macro logo_badge_url() %] +{% macro logo_badge_url() %} https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/logo.json -[%- endmacro %] +{%- endmacro %} -[% macro page_url() %] - [% if repo_platform == 'github' %] +{% macro page_url() %} + {% if repo_platform == 'github' %} {{ repo_namespace }}.github.io/{{ repo_name }} - [%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] -[% set repo_namespace_root = repo_namespace.split("/")[0] %] + {%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} +{% set repo_namespace_root = repo_namespace.split("/")[0] %} {{ repo_namespace_root }}.{{ page_host }}{{ repo_namespace | replace(repo_namespace_root, "", 1) }}/{{ repo_name }} - [%- endif %] -[% endmacro %] + {%- endif %} +{% endmacro %} -[% macro pipeline_badge() %] -[% if repo_platform == 'github' %] +{% macro pipeline_badge() %} +{% if repo_platform == 'github' %} [![CI](https://{{ repo_url() }}/actions/workflows/ci.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/ci.yml) [![CommitLint](https://{{ repo_url() }}/actions/workflows/commitlint.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/commitlint.yml) [![DevContainer](https://{{ repo_url() }}/actions/workflows/devcontainer.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/devcontainer.yml) [![Release](https://{{ repo_url() }}/actions/workflows/release.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/release.yml) [![Renovate](https://{{ repo_url() }}/actions/workflows/renovate.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/renovate.yml) [![Semantic Release](https://{{ repo_url() }}/actions/workflows/semantic-release.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/semantic-release.yml) - [%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] + {%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} [![pipeline status](https://{{ repo_url() }}/badges/main/pipeline.svg)](https://{{ repo_url() }}/-/commits/main) - [%- endif %] -[% endmacro %] + {%- endif %} +{% endmacro %} -[% macro releases_url() %] - [% if repo_platform == 'github' %] +{% macro releases_url() %} + {% if repo_platform == 'github' %} https://{{ repo_url() }}/releases - [%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] + {%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} https://{{ repo_url() }}/-/releases - [%- endif %] -[% endmacro %] + {%- endif %} +{% endmacro %} -[% macro release_badge() %] - [% if repo_platform == 'github' %] +{% macro release_badge() %} + {% if repo_platform == 'github' %} [![Release](https://img.shields.io/github/v/release/{{ repo_namespace }}/{{ repo_name }})] - [%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] + {%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} [![Latest Release](https://{{ repo_url() }}/-/badges/release.svg)] - [%- endif %] + {%- endif %} ({{ releases_url()}}) [![PyPI](https://img.shields.io/pypi/v/{{ package_name }})](https://pypi.org/project/{{ package_name }}/) -[%- endmacro %] +{%- endmacro %} -[% macro repo_url() %] +{% macro repo_url() %} {{ repo_host }}/{{ repo_namespace }}/{{ repo_name }} -[%- endmacro %] +{%- endmacro %} diff --git a/includes/version_compare.jinja b/includes/version_compare.jinja index 2842f550..5d7b90bb 100644 --- a/includes/version_compare.jinja +++ b/includes/version_compare.jinja @@ -1,23 +1,23 @@ -[% macro version_higher_than(version1, version2) %] +{% macro version_higher_than(version1, version2) %} {{ "1" if version1.split(".") | map("int") | list >= version2.split(".") | map("int") | list }} -[%- endmacro %] +{%- endmacro %} -[% macro version_higher_than_validator(version1, version2) %] +{% macro version_higher_than_validator(version1, version2) %} {{ "Invalid version. The version '%s' is not higher than '%s'." % (version1, version2) if not version_higher_than(version1, version2) }} -[%- endmacro %] +{%- endmacro %} -[% macro version_between(version, version_min, version_max) %] +{% macro version_between(version, version_min, version_max) %} {{ "1" if version_min.split(".") | map("int") | list <= version.split(".") | map("int") | list <= version_max.split(".") | map("int") | list }} -[%- endmacro %] +{%- endmacro %} -[% macro version_between_validator(version, version_min, version_max) %] +{% macro version_between_validator(version, version_min, version_max) %} {{ "Invalid version. The version '%s' is not between '%s' and '%s'." % (version, version_min, version_max) if not version_between(version, version_min, version_max) }} -[%- endmacro %] +{%- endmacro %} diff --git a/template/.gitignore.jinja b/template/.gitignore.jinja index 42e61687..bd665a00 100644 --- a/template/.gitignore.jinja +++ b/template/.gitignore.jinja @@ -1,9 +1,9 @@ # Custom *.swp .DS_Store -[% if project_name == "Serious Scaffold Python" %] +{% if project_name == "Serious Scaffold Python" %} .copier-answers.yml -[% endif %] +{% endif %} Pipfile public diff --git a/template/.pre-commit-config.yaml.jinja b/template/.pre-commit-config.yaml.jinja index 78fb4145..36afb214 100644 --- a/template/.pre-commit-config.yaml.jinja +++ b/template/.pre-commit-config.yaml.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "version_compare.jinja") import version_between %} default_install_hook_types: - post-checkout - post-merge @@ -71,9 +71,9 @@ repos: name: mypy entry: pdm run python -m mypy language: system -[% if project_name == 'Serious Scaffold Python' %] +{% if project_name == 'Serious Scaffold Python' %} exclude: ^template/.* -[% endif %] +{% endif %} types_or: - python - pyi diff --git a/template/.releaserc.json.jinja b/template/.releaserc.json.jinja index d1a60168..1678a1e1 100644 --- a/template/.releaserc.json.jinja +++ b/template/.releaserc.json.jinja @@ -112,18 +112,18 @@ } } ], -[% if repo_platform == 'github' %] +{% if repo_platform == 'github' %} "@semantic-release/github" -[% elif repo_platform == 'gitlab' %] +{% elif repo_platform == 'gitlab' %} "@semantic-release/gitlab" -[% elif repo_platform == 'gitlab-self-managed' %] +{% elif repo_platform == 'gitlab-self-managed' %} [ "@semantic-release/gitlab", { "gitlabUrl": "https://{{ repo_host }}" } ] -[% endif %] +{% endif %} ], "preset": "conventionalcommits" } diff --git a/template/.renovaterc.json.jinja b/template/.renovaterc.json.jinja index 9557b1f2..5983c05b 100644 --- a/template/.renovaterc.json.jinja +++ b/template/.renovaterc.json.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_higher_than %] +{% from pathjoin("includes", "version_compare.jinja") import version_higher_than %} { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "constraints": { @@ -19,7 +19,7 @@ "^\\.readthedocs\\.yaml$", "^\\.renovaterc\\.json$", "^docs/.+\\.md$" -[%- if project_name == "Serious Scaffold Python" %], +{%- if project_name == "Serious Scaffold Python" %}, "^includes/sample\\.jinja$", "^template/.*\\.github.*/workflows/.+\\.yml(\\.jinja)?$", "^template/.*\\.gitlab.*/workflows/.+\\.yml(\\.jinja)?$", @@ -28,7 +28,7 @@ "^template/\\.readthedocs\\.yaml\\.jinja$", "^template/\\.renovaterc\\.json\\.jinja$", "^template/docs/.+\\.md(\\.jinja)?$" -[% endif %] +{% endif %} ], "matchStrings": [ "pip install.* (?.*?)(\\[.*?\\])?==(?.*?)[\"\n]", @@ -42,9 +42,9 @@ "description": "Match debian packages installed in Dockerfiles", "fileMatch": [ "^\\.devcontainer\\/Dockerfile$" -[%- if project_name == "Serious Scaffold Python" %], +{%- if project_name == "Serious Scaffold Python" %}, "^template\\/\\.devcontainer/Dockerfile\\.jinja$" -[% endif %] +{% endif %} ], "matchStrings": [ "# renovate: depName=(?.*?)\nARG .*?_VERSION=\"(?.*)\"\n" @@ -58,9 +58,9 @@ "description": "Match pdm version specified in setup-pdm GitHub Action", "fileMatch": [ "^\\.github/workflows/.+\\.yml$" -[%- if project_name == "Serious Scaffold Python" %], +{%- if project_name == "Serious Scaffold Python" %}, "^template/.*\\.github.*/workflows/.+\\.yml(\\.jinja)?$" -[% endif %] +{% endif %} ], "matchStrings": [ "uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?.*)\n" @@ -73,9 +73,9 @@ "description": "Match pdm version specified in the renovate constraints", "fileMatch": [ "^\\.renovaterc\\.json$" -[%- if project_name == "Serious Scaffold Python" %], +{%- if project_name == "Serious Scaffold Python" %}, "^template/\\.renovaterc\\.json\\.jinja$" -[% endif %] +{% endif %} ], "matchStrings": [ "\"pdm\": \"(?.*)\"" @@ -102,10 +102,10 @@ "fileMatch": [ "^\\.github/workflows/.+\\.yml$", "^\\.gitlab/workflows/.+\\.yml$" -[%- if project_name == "Serious Scaffold Python" %], +{%- if project_name == "Serious Scaffold Python" %}, "^template/.*\\.github.*/workflows/.+\\.yml(\\.jinja)?$", "^template/.*\\.gitlab.*/workflows/.+\\.yml(\\.jinja)?$" -[% endif %] +{% endif %} ], "matchStrings": [ "--package (?.+?)@(?.+?)\\s" @@ -133,15 +133,15 @@ ":maintainLockFilesWeekly", ":semanticCommitTypeAll(build)" ], -[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' or project_name == 'Serious Scaffold Python' %] +{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' or project_name == 'Serious Scaffold Python' %} "gitlabci": { "fileMatch": [ "^.gitlab/workflows/.*\\.yml$" ] }, -[% endif %] +{% endif %} "packageRules": [ -[% if project_name == "Serious Scaffold Python" %] +{% if project_name == "Serious Scaffold Python" %} { "description": "Update GitHub Action in template", "matchDepTypes": [ @@ -203,7 +203,7 @@ ] } }, -[% endif %] +{% endif %} { "description": "Update lock files for development dependencies", "matchUpdateTypes": [ @@ -249,12 +249,12 @@ "github-tags" ], "matchDepNames": [ -[% if repo_platform == "github" %] +{% if repo_platform == "github" %} "ghcr.io/renovatebot/renovate", -[% endif %] -[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' or project_name == 'Serious Scaffold Python' %] +{% endif %} +{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' or project_name == 'Serious Scaffold Python' %} "renovate/renovate", -[% endif %] +{% endif %} "renovatebot/pre-commit-hooks" ] }, diff --git a/template/LICENSE.jinja b/template/LICENSE.jinja index 95961d43..0cc977d2 100644 --- a/template/LICENSE.jinja +++ b/template/LICENSE.jinja @@ -1,2 +1,2 @@ -[% set license_template = 'includes/licenses/' + copyright_license + '.jinja' %] -[% include license_template %] +{% set license_template = 'includes/licenses/' + copyright_license + '.jinja' %} +{% include license_template %} diff --git a/template/Makefile.jinja b/template/Makefile.jinja index 6137b12a..68dcc851 100644 --- a/template/Makefile.jinja +++ b/template/Makefile.jinja @@ -1,8 +1,8 @@ -[% from pathjoin("includes", "variable.jinja") import page_url with context %] +{% from pathjoin("includes", "variable.jinja") import page_url with context %} .PHONY: clean deepclean install dev prerequisites mypy ruff ruff-format pyproject-fmt codespell lint pre-commit test-run test build publish doc-watch doc-build doc-coverage doc -[%- if project_name == "Serious Scaffold Python" %] +{%- if project_name == "Serious Scaffold Python" %} template-watch template-build -[% endif %] +{% endif %} ######################################################################################## # Variables @@ -99,12 +99,12 @@ codespell: # Check jsonschema with check-jsonschema. check-jsonschema: -[% if repo_platform == "github" %] +{% if repo_platform == "github" %} check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yml -[% endif %] -[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' or project_name == "Serious Scaffold Python" %] +{% endif %} +{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' or project_name == "Serious Scaffold Python" %} check-jsonschema --builtin-schema vendor.gitlab-ci --data-transform gitlab-ci --regex-variant nonunicode .gitlab-ci.yml .gitlab/workflows/*.yml -[% endif %] +{% endif %} check-jsonschema --builtin-schema vendor.readthedocs .readthedocs.yaml check-jsonschema --builtin-schema vendor.renovate .renovaterc.json @@ -162,7 +162,7 @@ doc-coverage: test-run # Generate all documentation with reports. doc: doc-build mypy doc-coverage -[% if project_name == "Serious Scaffold Python" %] +{% if project_name == "Serious Scaffold Python" %} ######################################################################################## # Template ######################################################################################## @@ -177,7 +177,7 @@ template-build: copier copy -r HEAD --data-file includes/copier-answers-sample.yml -f . . rm -rf .copier-answers.yml -[% endif %] +{% endif %} ######################################################################################## # End ######################################################################################## diff --git a/template/README.md.jinja b/template/README.md.jinja index 9ba0aea4..083e6933 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -1,12 +1,12 @@ -[% from pathjoin("includes", "variable.jinja") import coverage_badge with context %] -[% from pathjoin("includes", "variable.jinja") import license_badge with context %] -[% from pathjoin("includes", "variable.jinja") import license_url with context %] -[% from pathjoin("includes", "variable.jinja") import logo_badge with context %] -[% from pathjoin("includes", "variable.jinja") import logo_badge_url with context %] -[% from pathjoin("includes", "variable.jinja") import page_url with context %] -[% from pathjoin("includes", "variable.jinja") import pipeline_badge with context %] -[% from pathjoin("includes", "variable.jinja") import release_badge with context %] -[% from pathjoin("includes", "variable.jinja") import repo_url with context %] +{% from pathjoin("includes", "variable.jinja") import coverage_badge with context %} +{% from pathjoin("includes", "variable.jinja") import license_badge with context %} +{% from pathjoin("includes", "variable.jinja") import license_url with context %} +{% from pathjoin("includes", "variable.jinja") import logo_badge with context %} +{% from pathjoin("includes", "variable.jinja") import logo_badge_url with context %} +{% from pathjoin("includes", "variable.jinja") import page_url with context %} +{% from pathjoin("includes", "variable.jinja") import pipeline_badge with context %} +{% from pathjoin("includes", "variable.jinja") import release_badge with context %} +{% from pathjoin("includes", "variable.jinja") import repo_url with context %} # {{ project_name }} {{ project_description }} @@ -27,19 +27,19 @@ {{ logo_badge() }} [![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://{{ repo_url() }}) -[% if development_status == "Alpha" %] +{% if development_status == "Alpha" %} > [!WARNING] -[% elif development_status == "Beta" %] +{% elif development_status == "Beta" %} > [!IMPORTANT] -[% elif development_status == "Stable" %] +{% elif development_status == "Stable" %} > [!NOTE] -[% endif %] +{% endif %} > _{{ project_name }}_ is in the **{{ development_status }}** phase. -[% if development_status == "Alpha" %] +{% if development_status == "Alpha" %} > Frequent changes and instability should be anticipated. -[% elif development_status == "Beta" %] +{% elif development_status == "Beta" %} > Changes and potential instability should be anticipated. -[% endif %] +{% endif %} > Any feedback, comments, suggestions and contributions are welcome! {{ readme_content }} diff --git a/template/docs/_static/badges/[% if project_name == 'Serious Scaffold Python' %]logo.json[% endif %].jinja b/template/docs/_static/badges/{% if project_name == 'Serious Scaffold Python' %}logo.json{% endif %}.jinja similarity index 100% rename from template/docs/_static/badges/[% if project_name == 'Serious Scaffold Python' %]logo.json[% endif %].jinja rename to template/docs/_static/badges/{% if project_name == 'Serious Scaffold Python' %}logo.json{% endif %}.jinja diff --git a/template/docs/advanced/cicd.md.jinja b/template/docs/advanced/cicd.md.jinja index eec65cc2..35ef7a5a 100644 --- a/template/docs/advanced/cicd.md.jinja +++ b/template/docs/advanced/cicd.md.jinja @@ -10,21 +10,21 @@ The `ci` workflow is the most frequently used workflow, running on all pull/merg The `commitlint` workflow checks whether the pull/merge request title comply with the . This ensures consistent commit history and enable the possibility of automated release pipeline. -[% if repo_platform == 'github' %] +{% if repo_platform == 'github' %} ## `delete-untagged-packages.yml` The `delete-untagged-packages` workflow removes untagged packages since GitHub will still keep the package when overridden with the same tag. It helps keep the GitHub Packages clean and tidy. -[% endif %] +{% endif %} ## `devcontainer.yml` The `devcontainer` workflow will be triggered by container related changes. It builds and tests the development and production containers and push the development container except during pull/merge requests, ensuring seamless containerized environments. -[% if repo_platform == 'github' %] +{% if repo_platform == 'github' %} ## `readthedocs-preview.yml` The `readthedocs-preview` workflow leverage the [readthedocs/actions/preview](https://github.com/readthedocs/actions/tree/v1/preview) to add Read the Docs preview links to the related pull requests. These links make it easy to review documentation changes. -[% endif %] +{% endif %} ## `release.yml` diff --git a/template/docs/conf.py.jinja b/template/docs/conf.py.jinja index 5c504533..db678c39 100644 --- a/template/docs/conf.py.jinja +++ b/template/docs/conf.py.jinja @@ -38,11 +38,11 @@ html_theme_options = { "announcement": ( "{{ project_name }} " "is in the {{ development_status }} phase. " -[% if development_status == "Alpha" %] +{% if development_status == "Alpha" %} "Frequent changes and instability should be anticipated. " -[% elif development_status == "Beta" %] +{% elif development_status == "Beta" %} "Changes and potential instability should be anticipated. " -[% endif %] +{% endif %} "Any feedback, comments, suggestions and contributions are welcome!" ), } diff --git a/template/docs/development/git-workflow.md.jinja b/template/docs/development/git-workflow.md.jinja index 3146b7f5..9b5e04af 100644 --- a/template/docs/development/git-workflow.md.jinja +++ b/template/docs/development/git-workflow.md.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "variable.jinja") import repo_url with context %] +{% from pathjoin("includes", "variable.jinja") import repo_url with context %} # Git Workflow This pages shows the recommended Git workflow to keep the local repository clean and organized while ensuring smooth collaboration among team members. diff --git a/template/docs/index.md.jinja b/template/docs/index.md.jinja index fc8a9197..4e403a6b 100644 --- a/template/docs/index.md.jinja +++ b/template/docs/index.md.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "variable.jinja") import releases_url with context %] +{% from pathjoin("includes", "variable.jinja") import releases_url with context %} # Welcome to {{ project_name }}'s documentation ```{toctree} diff --git a/template/docs/management/init.md.jinja b/template/docs/management/init.md.jinja index 225a8553..f1bd263a 100644 --- a/template/docs/management/init.md.jinja +++ b/template/docs/management/init.md.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "variable.jinja") import repo_url with context %] +{% from pathjoin("includes", "variable.jinja") import repo_url with context %} # Project Initialization ## Prerequisites diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 99030467..7366a990 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -1,6 +1,6 @@ -[% from pathjoin("includes", "variable.jinja") import page_url with context %] -[% from pathjoin("includes", "variable.jinja") import repo_url with context %] -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "variable.jinja") import page_url with context %} +{% from pathjoin("includes", "variable.jinja") import repo_url with context %} +{% from pathjoin("includes", "version_compare.jinja") import version_between %} [build-system] build-backend = "setuptools.build_meta" requires = [ @@ -18,53 +18,53 @@ keywords = [ "project-template", "serious-scaffold", ] -[% if copyright_license == "Apache Software License" %] +{% if copyright_license == "Apache Software License" %} license = { text = "Apache-2.0" } -[% elif copyright_license == "Boost Software License 1.0 (BSL-1.0)" %] +{% elif copyright_license == "Boost Software License 1.0 (BSL-1.0)" %} license = { text = "BSL-1.0" } -[% elif copyright_license == "GNU Affero General Public License v3" %] +{% elif copyright_license == "GNU Affero General Public License v3" %} license = { text = "AGPLv3" } -[% elif copyright_license == "GNU General Public License v3 (GPLv3)" %] +{% elif copyright_license == "GNU General Public License v3 (GPLv3)" %} license = { text = "GPLv3" } -[% elif copyright_license == "GNU Lesser General Public License v3 (LGPLv3)" %] +{% elif copyright_license == "GNU Lesser General Public License v3 (LGPLv3)" %} license = { text = "LGPLv3" } -[% elif copyright_license == "MIT License" %] +{% elif copyright_license == "MIT License" %} license = { text = "MIT" } -[% elif copyright_license == "Mozilla Public License 2.0 (MPL 2.0)" %] +{% elif copyright_license == "Mozilla Public License 2.0 (MPL 2.0)" %} license = { text = "MPL-2.0" } -[% elif copyright_license == "The Unlicense (Unlicense)" %] +{% elif copyright_license == "The Unlicense (Unlicense)" %} license = { text = "Unlicense" } -[% endif %] +{% endif %} authors = [ { email = "{{ author_email }}", name = "{{ author_name }}" }, ] requires-python = ">={{ min_py }}" classifiers = [ -[% if development_status == "Alpha" %] +{% if development_status == "Alpha" %} "Development Status :: 3 - Alpha", -[% elif development_status == "Beta" %] +{% elif development_status == "Beta" %} "Development Status :: 4 - Beta", -[% elif development_status == "Stable" %] +{% elif development_status == "Stable" %} "Development Status :: 5 - Production/Stable", -[% endif %] +{% endif %} "License :: OSI Approved :: {{ copyright_license }}", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", -[% if version_between("3.9", min_py, max_py) %] +{% if version_between("3.9", min_py, max_py) %} "Programming Language :: Python :: 3.9", -[% endif %] -[% if version_between("3.10", min_py, max_py) %] +{% endif %} +{% if version_between("3.10", min_py, max_py) %} "Programming Language :: Python :: 3.10", -[% endif %] -[% if version_between("3.11", min_py, max_py) %] +{% endif %} +{% if version_between("3.11", min_py, max_py) %} "Programming Language :: Python :: 3.11", -[% endif %] -[% if version_between("3.12", min_py, max_py) %] +{% endif %} +{% if version_between("3.12", min_py, max_py) %} "Programming Language :: Python :: 3.12", -[% endif %] -[% if version_between("3.13", min_py, max_py) %] +{% endif %} +{% if version_between("3.13", min_py, max_py) %} "Programming Language :: Python :: 3.13", -[% endif %] +{% endif %} ] dynamic = [ "version", @@ -74,11 +74,11 @@ dependencies = [ "pydantic-settings", ] urls.documentation = "https://{{ page_url() }}" -[% if repo_platform == 'github' %] +{% if repo_platform == 'github' %} urls.issue = "https://{{ repo_url() }}/issues" -[% elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %] +{% elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %} urls.issue = "https://{{ repo_url() }}/-/issues" -[% endif %] +{% endif %} urls.repository = "https://{{ repo_url() }}" scripts.{{ package_name }}-cli = "{{ module_name }}.cli:cli" @@ -112,11 +112,11 @@ fallback_version = "0.0.0" src = [ "src", ] -[% if project_name == "Serious Scaffold Python" %] +{% if project_name == "Serious Scaffold Python" %} extend-exclude = [ "template", ] -[% endif %] +{% endif %} fix = true lint.select = [ "B", # flake8-bugbear @@ -170,9 +170,9 @@ enable_error_code = [ exclude = [ "build", "doc", -[% if project_name == "Serious Scaffold Python" %] +{% if project_name == "Serious Scaffold Python" %} "template", -[% endif %] +{% endif %} ] no_implicit_optional = true show_error_codes = true diff --git a/template/src/{{ module_name }}/settings.py.jinja b/template/src/{{ module_name }}/settings.py.jinja index 68d38a3c..a9a80b55 100644 --- a/template/src/{{ module_name }}/settings.py.jinja +++ b/template/src/{{ module_name }}/settings.py.jinja @@ -1,11 +1,11 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_higher_than %] +{% from pathjoin("includes", "version_compare.jinja") import version_higher_than %} """Settings Module.""" import logging from logging import getLevelName -[% if not version_higher_than(min_py, "3.10") %] +{% if not version_higher_than(min_py, "3.10") %} from typing import Optional -[% endif %] +{% endif %} from pydantic_settings import BaseSettings, SettingsConfigDict @@ -20,11 +20,11 @@ class GlobalSettings(BaseSettings): class Settings(BaseSettings): """Project specific settings.""" -[% if not version_higher_than(min_py, "3.10") %] +{% if not version_higher_than(min_py, "3.10") %} logging_level: Optional[str] = getLevelName(logging.INFO) -[% else %] +{% else %} logging_level: str | None = getLevelName(logging.INFO) -[% endif %] +{% endif %} """Default logging level for the project.""" model_config = SettingsConfigDict( diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/FUNDING.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/FUNDING.yml.jinja similarity index 100% rename from template/[% if repo_platform == 'github' %].github[% endif %]/FUNDING.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/FUNDING.yml.jinja diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/ci.yml.jinja similarity index 75% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/ci.yml.jinja index 6254196a..7317698d 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/ci.yml.jinja +++ b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/ci.yml.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "version_compare.jinja") import version_between %} name: CI on: @@ -36,35 +36,35 @@ jobs: strategy: matrix: os: -[% if "macos" in platforms %] +{% if "macos" in platforms %} # renovate: github-runner - macos-14 -[% endif %] -[% if "ubuntu" in platforms %] +{% endif %} +{% if "ubuntu" in platforms %} # renovate: github-runner - ubuntu-24.04 -[% endif %] -[% if "windows" in platforms %] +{% endif %} +{% if "windows" in platforms %} # renovate: github-runner - windows-2022 -[% endif %] +{% endif %} python-version: -[% if version_between("3.9", min_py, max_py) %] +{% if version_between("3.9", min_py, max_py) %} - '3.9' -[% endif %] -[% if version_between("3.10", min_py, max_py) %] +{% endif %} +{% if version_between("3.10", min_py, max_py) %} - '3.10' -[% endif %] -[% if version_between("3.11", min_py, max_py) %] +{% endif %} +{% if version_between("3.11", min_py, max_py) %} - '3.11' -[% endif %] -[% if version_between("3.12", min_py, max_py) %] +{% endif %} +{% if version_between("3.12", min_py, max_py) %} - '3.12' -[% endif %] -[% if version_between("3.13", min_py, max_py) %] +{% endif %} +{% if version_between("3.13", min_py, max_py) %} - '3.13' -[% endif %] -[% if project_name == "Serious Scaffold Python" %] +{% endif %} +{% if project_name == "Serious Scaffold Python" %} consistency: if: {{ '${{ !cancelled() && ! failure() }}' }} runs-on: ubuntu-24.04 @@ -81,4 +81,4 @@ jobs: - run: git diff - run: git status --porcelain - run: test -z "$(git status --porcelain)" -[% endif %] +{% endif %} diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/commitlint.yml b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/commitlint.yml similarity index 100% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/commitlint.yml rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/commitlint.yml diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/delete-untagged-packages.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/delete-untagged-packages.yml.jinja similarity index 100% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/delete-untagged-packages.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/delete-untagged-packages.yml.jinja diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/devcontainer.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/devcontainer.yml.jinja similarity index 88% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/devcontainer.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/devcontainer.yml.jinja index 07c5aa8d..695a8eb8 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/devcontainer.yml.jinja +++ b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/devcontainer.yml.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "version_compare.jinja") import version_between %} name: DevContainer on: @@ -77,18 +77,18 @@ jobs: strategy: matrix: python-version: -[% if version_between("3.9", min_py, max_py) %] +{% if version_between("3.9", min_py, max_py) %} - '3.9' -[% endif %] -[% if version_between("3.10", min_py, max_py) %] +{% endif %} +{% if version_between("3.10", min_py, max_py) %} - '3.10' -[% endif %] -[% if version_between("3.11", min_py, max_py) %] +{% endif %} +{% if version_between("3.11", min_py, max_py) %} - '3.11' -[% endif %] -[% if version_between("3.12", min_py, max_py) %] +{% endif %} +{% if version_between("3.12", min_py, max_py) %} - '3.12' -[% endif %] -[% if version_between("3.13", min_py, max_py) %] +{% endif %} +{% if version_between("3.13", min_py, max_py) %} - '3.13' -[% endif %] +{% endif %} diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/readthedocs-preview.yml.jinja similarity index 100% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/readthedocs-preview.yml.jinja diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/release.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/release.yml.jinja similarity index 93% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/release.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/release.yml.jinja index eeff6896..2f5dfc1d 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/release.yml.jinja +++ b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/release.yml.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "version_compare.jinja") import version_between %} name: Release on: @@ -112,21 +112,21 @@ jobs: strategy: matrix: python-version: -[% if version_between("3.9", min_py, max_py) %] +{% if version_between("3.9", min_py, max_py) %} - '3.9' -[% endif %] -[% if version_between("3.10", min_py, max_py) %] +{% endif %} +{% if version_between("3.10", min_py, max_py) %} - '3.10' -[% endif %] -[% if version_between("3.11", min_py, max_py) %] +{% endif %} +{% if version_between("3.11", min_py, max_py) %} - '3.11' -[% endif %] -[% if version_between("3.12", min_py, max_py) %] +{% endif %} +{% if version_between("3.12", min_py, max_py) %} - '3.12' -[% endif %] -[% if version_between("3.13", min_py, max_py) %] +{% endif %} +{% if version_between("3.13", min_py, max_py) %} - '3.13' -[% endif %] +{% endif %} package-publish: runs-on: ubuntu-24.04 steps: diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/renovate.yml.jinja similarity index 97% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/renovate.yml.jinja index b05e2add..3abd3d1d 100644 --- a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/renovate.yml.jinja +++ b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/renovate.yml.jinja @@ -7,11 +7,11 @@ jobs: RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^git", "^pdm", "^pip", "^copier", "^find"]' RENOVATE_BRANCH_PREFIX: renovate-github/ RENOVATE_ENABLED: {{ '${{ vars.RENOVATE_ENABLED || true }}' }} -[% if project_name == "Serious Scaffold Python" %] +{% if project_name == "Serious Scaffold Python" %} RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "gitlabci", "regex", "pre-commit"]' -[% else %] +{% else %} RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "regex", "pre-commit"]' -[% endif %] +{% endif %} RENOVATE_OPTIMIZE_FOR_DISABLED: "true" RENOVATE_PLATFORM: github RENOVATE_REPOSITORIES: '["{{ '${{ github.repository }}' }}"]' diff --git a/template/[% if repo_platform == 'github' %].github[% endif %]/workflows/semantic-release.yml.jinja b/template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/semantic-release.yml.jinja similarity index 100% rename from template/[% if repo_platform == 'github' %].github[% endif %]/workflows/semantic-release.yml.jinja rename to template/{% if repo_platform == 'github' %}.github{% endif %}/workflows/semantic-release.yml.jinja diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab-ci.yml{% endif %}.jinja similarity index 100% rename from template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja rename to template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab-ci.yml{% endif %}.jinja diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/ci.yml.jinja b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/ci.yml.jinja similarity index 73% rename from template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/ci.yml.jinja rename to template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/ci.yml.jinja index 3a5b5c05..523449c6 100644 --- a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/ci.yml.jinja +++ b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/ci.yml.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "version_compare.jinja") import version_between %} ci: artifacts: reports: @@ -19,21 +19,21 @@ ci: parallel: matrix: - PYTHON_VERSION: -[% if version_between("3.9", min_py, max_py) %] +{% if version_between("3.9", min_py, max_py) %} - '3.9' -[% endif %] -[% if version_between("3.10", min_py, max_py) %] +{% endif %} +{% if version_between("3.10", min_py, max_py) %} - '3.10' -[% endif %] -[% if version_between("3.11", min_py, max_py) %] +{% endif %} +{% if version_between("3.11", min_py, max_py) %} - '3.11' -[% endif %] -[% if version_between("3.12", min_py, max_py) %] +{% endif %} +{% if version_between("3.12", min_py, max_py) %} - '3.12' -[% endif %] -[% if version_between("3.13", min_py, max_py) %] +{% endif %} +{% if version_between("3.13", min_py, max_py) %} - '3.13' -[% endif %] +{% endif %} rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push" - if: $CI_PIPELINE_SOURCE == 'merge_request_event' @@ -42,7 +42,7 @@ ci: - make dev - make lint test doc build stage: ci -[% if project_name == 'Serious Scaffold Python' %] +{% if project_name == 'Serious Scaffold Python' %} consistency: interruptible: true rules: @@ -57,4 +57,4 @@ consistency: - git status --porcelain - test -z "$(git status --porcelain)" stage: ci -[% endif %] +{% endif %} diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/commitlint.yml b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/commitlint.yml similarity index 100% rename from template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/commitlint.yml rename to template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/commitlint.yml diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/devcontainer.yml.jinja b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/devcontainer.yml.jinja similarity index 86% rename from template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/devcontainer.yml.jinja rename to template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/devcontainer.yml.jinja index 2b8bd27b..42eb0815 100644 --- a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/devcontainer.yml.jinja +++ b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/devcontainer.yml.jinja @@ -1,24 +1,24 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "version_compare.jinja") import version_between %} dev-container-publish: image: docker:27.5.1@sha256:3ab005a2e4872f0b10fb9c00d4230334043f1281f29299bd3de94a8f14a05e69 parallel: matrix: - PYTHON_VERSION: -[% if version_between("3.9", min_py, max_py) %] +{% if version_between("3.9", min_py, max_py) %} - '3.9' -[% endif %] -[% if version_between("3.10", min_py, max_py) %] +{% endif %} +{% if version_between("3.10", min_py, max_py) %} - '3.10' -[% endif %] -[% if version_between("3.11", min_py, max_py) %] +{% endif %} +{% if version_between("3.11", min_py, max_py) %} - '3.11' -[% endif %] -[% if version_between("3.12", min_py, max_py) %] +{% endif %} +{% if version_between("3.12", min_py, max_py) %} - '3.12' -[% endif %] -[% if version_between("3.13", min_py, max_py) %] +{% endif %} +{% if version_between("3.13", min_py, max_py) %} - '3.13' -[% endif %] +{% endif %} rules: - changes: - .devcontainer/Dockerfile diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/release.yml.jinja b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/release.yml.jinja similarity index 90% rename from template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/release.yml.jinja rename to template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/release.yml.jinja index 637a007e..8e8bd225 100644 --- a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/release.yml.jinja +++ b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/release.yml.jinja @@ -1,4 +1,4 @@ -[% from pathjoin("includes", "version_compare.jinja") import version_between %] +{% from pathjoin("includes", "version_compare.jinja") import version_between %} pages-build: artifacts: paths: @@ -36,21 +36,21 @@ container-publish: parallel: matrix: - PYTHON_VERSION: -[% if version_between("3.9", min_py, max_py) %] +{% if version_between("3.9", min_py, max_py) %} - '3.9' -[% endif %] -[% if version_between("3.10", min_py, max_py) %] +{% endif %} +{% if version_between("3.10", min_py, max_py) %} - '3.10' -[% endif %] -[% if version_between("3.11", min_py, max_py) %] +{% endif %} +{% if version_between("3.11", min_py, max_py) %} - '3.11' -[% endif %] -[% if version_between("3.12", min_py, max_py) %] +{% endif %} +{% if version_between("3.12", min_py, max_py) %} - '3.12' -[% endif %] -[% if version_between("3.13", min_py, max_py) %] +{% endif %} +{% if version_between("3.13", min_py, max_py) %} - '3.13' -[% endif %] +{% endif %} 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: diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/renovate.yml similarity index 100% rename from template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/renovate.yml rename to template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/renovate.yml diff --git a/template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/semantic-release.yml.jinja b/template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/semantic-release.yml.jinja similarity index 100% rename from template/[% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %].gitlab[% endif %]/workflows/semantic-release.yml.jinja rename to template/{% if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' %}.gitlab{% endif %}/workflows/semantic-release.yml.jinja