From 112d5c738d9831608655c42f1b6fa91627eaaaa1 Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Wed, 30 Aug 2023 06:04:42 +0000 Subject: [PATCH 1/2] Use subdirectory for template. --- .github/workflows/ci.yml | 12 +- .vscode/settings.json | 2 +- copier.yaml | 12 +- .gitignore.jinja => template/.gitignore.jinja | 0 template/.pre-commit-config.yaml | 74 +++++++++++ .../.readthedocs.yaml.jinja | 0 template/.vscode/extensions.json | 14 +++ template/.vscode/settings.json | 115 ++++++++++++++++++ template/LICENSE | 21 ++++ Makefile.jinja => template/Makefile.jinja | 0 README.md.jinja => template/README.md.jinja | 0 .../FUNDING.yml.jinja | 0 .../workflows/ci.yml.jinja | 12 +- .../workflows/readthedocs-preview.yml.jinja | 0 .../workflows/release.yml.jinja | 0 ...managed' %].gitlab-ci.yml[% endif %].jinja | 0 template/constraints/default.txt | 75 ++++++++++++ template/docs/_static/images/logo.svg | 1 + {docs => template/docs}/api/index.rst.jinja | 0 .../docs}/api/settings.rst.jinja | 0 {docs => template/docs}/cli/index.rst.jinja | 0 {docs => template/docs}/conf.py.jinja | 0 {docs => template/docs}/index.rst.jinja | 0 template/docs/reports/coverage/index.rst | 4 + template/docs/reports/index.rst | 8 ++ template/docs/reports/mypy/index.rst | 4 + .../pyproject.toml.jinja | 0 template/requirements.txt | 3 + template/requirements/docs.txt | 9 ++ template/requirements/lint.txt | 6 + template/requirements/package.txt | 4 + template/requirements/test.txt | 3 + .../src}/{{ module_name }}/__init__.py | 0 .../src}/{{ module_name }}/cli.py.jinja | 0 .../src}/{{ module_name }}/settings.py.jinja | 0 template/test/__init__.py | 1 + {test => template/test}/cli_test.py.jinja | 0 {test => template/test}/pkg_test.py.jinja | 0 .../test}/settings_test.py.jinja | 0 .../{{_copier_conf.answers_file}}.jinja | 0 40 files changed, 352 insertions(+), 28 deletions(-) rename .gitignore.jinja => template/.gitignore.jinja (100%) create mode 100644 template/.pre-commit-config.yaml rename .readthedocs.yaml.jinja => template/.readthedocs.yaml.jinja (100%) create mode 100644 template/.vscode/extensions.json create mode 100644 template/.vscode/settings.json create mode 100644 template/LICENSE rename Makefile.jinja => template/Makefile.jinja (100%) rename README.md.jinja => template/README.md.jinja (100%) rename {[% if repo_host_type == 'github.com' %].github[% endif %] => template/[% if repo_host_type == 'github.com' %].github[% endif %]}/FUNDING.yml.jinja (100%) rename {[% if repo_host_type == 'github.com' %].github[% endif %] => template/[% if repo_host_type == 'github.com' %].github[% endif %]}/workflows/ci.yml.jinja (91%) rename {[% if repo_host_type == 'github.com' %].github[% endif %] => template/[% if repo_host_type == 'github.com' %].github[% endif %]}/workflows/readthedocs-preview.yml.jinja (100%) rename {[% if repo_host_type == 'github.com' %].github[% endif %] => template/[% if repo_host_type == 'github.com' %].github[% endif %]}/workflows/release.yml.jinja (100%) rename [% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja => template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja (100%) create mode 100644 template/constraints/default.txt create mode 100644 template/docs/_static/images/logo.svg rename {docs => template/docs}/api/index.rst.jinja (100%) rename {docs => template/docs}/api/settings.rst.jinja (100%) rename {docs => template/docs}/cli/index.rst.jinja (100%) rename {docs => template/docs}/conf.py.jinja (100%) rename {docs => template/docs}/index.rst.jinja (100%) create mode 100644 template/docs/reports/coverage/index.rst create mode 100644 template/docs/reports/index.rst create mode 100644 template/docs/reports/mypy/index.rst rename pyproject.toml.jinja => template/pyproject.toml.jinja (100%) create mode 100644 template/requirements.txt create mode 100644 template/requirements/docs.txt create mode 100644 template/requirements/lint.txt create mode 100644 template/requirements/package.txt create mode 100644 template/requirements/test.txt rename {src => template/src}/{{ module_name }}/__init__.py (100%) rename {src => template/src}/{{ module_name }}/cli.py.jinja (100%) rename {src => template/src}/{{ module_name }}/settings.py.jinja (100%) create mode 100644 template/test/__init__.py rename {test => template/test}/cli_test.py.jinja (100%) rename {test => template/test}/pkg_test.py.jinja (100%) rename {test => template/test}/settings_test.py.jinja (100%) rename {{_copier_conf.answers_file}}.jinja => template/{{_copier_conf.answers_file}}.jinja (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af32425a..76988875 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,18 +59,14 @@ jobs: run: python -m pip install --user copier - name: Generate the project with the default value run: | - rm -rf src/serious_scaffold - rm -rf .github - rm -rf .gitlab-ci.yml - copier copy -x '!src/serious_scaffold' -d repo_host_type=gitlab.com -r HEAD -f . . + find . -maxdepth 1 | grep -vE "(\.|template|includes|\.git|copier\.yaml)$" | xargs -I {} rm -r {} + copier copy -d repo_host_type=gitlab.com -r HEAD -f . . rm .copier-answers.yml copier copy -r HEAD -f . . + rm .copier-answers.yml - run: git diff - run: git status --porcelain - - run: | - if [[ -n `git status --porcelain` ]]; then - exit 1 - fi + - run: [[ -n `git status --porcelain` ]] && exit 1 strategy: matrix: python-version: diff --git a/.vscode/settings.json b/.vscode/settings.json index c0aaf7da..739028ba 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -75,7 +75,7 @@ }, "vscode-yaml-sort.customSortKeywords_2": [ "_envops", - "_exclude", + "_subdirectory", "project_name", "project_description", "author_name", diff --git a/copier.yaml b/copier.yaml index bec2a927..034f4005 100644 --- a/copier.yaml +++ b/copier.yaml @@ -1,17 +1,7 @@ _envops: block_end_string: '%]' block_start_string: '[%' -_exclude: - - '*.py[co]' - - .DS_Store - - .git - - .svn - - __pycache__ - - copier.yaml - - copier.yml - - includes - - src/serious_scaffold - - ~* +_subdirectory: template project_name: default: Serious Scaffold Python help: 'Enter the name of the project in CamelCase format:' diff --git a/.gitignore.jinja b/template/.gitignore.jinja similarity index 100% rename from .gitignore.jinja rename to template/.gitignore.jinja diff --git a/template/.pre-commit-config.yaml b/template/.pre-commit-config.yaml new file mode 100644 index 00000000..23ffb7ea --- /dev/null +++ b/template/.pre-commit-config.yaml @@ -0,0 +1,74 @@ +repos: + - hooks: + - id: check-added-large-files + - id: check-docstring-first + - id: check-json + - id: check-merge-conflict + - id: check-toml + - id: check-xml + - id: check-yaml + - id: end-of-file-fixer + - id: forbid-new-submodules + - id: mixed-line-ending + - id: name-tests-test + - stages: + - push + id: no-commit-to-branch + - args: + - '--autofix' + id: pretty-format-json + - args: + - constraints/default.txt + - requirements.txt + - requirements/docs.txt + - requirements/lint.txt + - requirements/package.txt + - requirements/test.txt + id: requirements-txt-fixer + - files: .pre-commit-config.yaml + id: sort-simple-yaml + - id: trailing-whitespace + repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + - hooks: + - entry: pipenv run python -m black + id: black + language: system + name: black + types: + - python + - entry: pipenv run python -m isort + id: isort + language: system + name: isort + require_serial: true + types_or: + - cython + - pyi + - python + - entry: make mypy + id: mypy + language: system + name: mypy + pass_filenames: false + require_serial: true + types: + - python + - entry: pipenv run python -m ruff + id: ruff + language: system + name: ruff + types: + - python + - entry: pipenv run toml-sort + id: toml-sort + language: system + name: toml-sort + types: + - toml + - entry: found Copier update rejection files; review them and remove them + files: \.rej$ + id: forbidden-files + language: fail + name: forbidden files + repo: local diff --git a/.readthedocs.yaml.jinja b/template/.readthedocs.yaml.jinja similarity index 100% rename from .readthedocs.yaml.jinja rename to template/.readthedocs.yaml.jinja diff --git a/template/.vscode/extensions.json b/template/.vscode/extensions.json new file mode 100644 index 00000000..3eeefedd --- /dev/null +++ b/template/.vscode/extensions.json @@ -0,0 +1,14 @@ +{ + "recommendations": [ + "DavidAnson.vscode-markdownlint", + "PascalReitermann93.vscode-yaml-sort", + "charliermarsh.ruff", + "ms-python.black-formatter", + "ms-python.mypy-type-checker", + "ms-python.python", + "richie5um2.vscode-sort-json", + "shd101wyy.markdown-preview-enhanced", + "streetsidesoftware.code-spell-checker", + "trond-snekvik.simple-rst" + ] +} diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json new file mode 100644 index 00000000..739028ba --- /dev/null +++ b/template/.vscode/settings.json @@ -0,0 +1,115 @@ +{ + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[markdown]": { + "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" + }, + "[python]": { + "editor.codeActionsOnSave": { + "source.organizeImports": true + }, + "editor.defaultFormatter": "ms-python.black-formatter" + }, + "[yaml]": { + "editor.defaultFormatter": "PascalReitermann93.vscode-yaml-sort" + }, + "cSpell.words": [ + "autofix", + "automodule", + "cobertura", + "codecov", + "elif", + "endmacro", + "epub", + "furo", + "huxuan", + "interruptible", + "isort", + "JPKXI", + "mypy", + "pathjoin", + "pipenv", + "pipx", + "pycache", + "pydantic", + "pytest", + "Quickstart", + "setuptools", + "typer" + ], + "editor.codeActionsOnSave": { + "source.fixAll": true + }, + "editor.formatOnSave": true, + "editor.rulers": [ + 88 + ], + "files.exclude": { + "**/*.egg-info": true, + "**/.coverage": true, + "**/.mypy_cache": true, + "**/.pytest_cache": true, + "**/.ruff_cache": true, + "**/.venv": true, + "**/Pipfile*": true, + "**/__pycache__": true, + "**/_build": true, + "**/coverage.xml": true, + "**/htmlcov": true + }, + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "files.trimTrailingWhitespace": true, + "markdown-preview-enhanced.breakOnSingleNewLine": false, + "sortJSON.contextMenu": { + "sortJSONAlphaNum": false, + "sortJSONAlphaNumReverse": false, + "sortJSONKeyLength": false, + "sortJSONKeyLengthReverse": false, + "sortJSONReverse": false, + "sortJSONType": false, + "sortJSONTypeReverse": false, + "sortJSONValues": false, + "sortJSONValuesReverse": false + }, + "vscode-yaml-sort.customSortKeywords_2": [ + "_envops", + "_subdirectory", + "project_name", + "project_description", + "author_name", + "organization_name", + "author_email", + "repo_host_type", + "repo_host", + "ci", + "repo_namespace", + "repo_name", + "package_name", + "module_name", + "coverage_threshold", + "min_py", + "max_py", + "default_py", + "choices", + "stages", + "default", + "lint", + "test", + "package", + "pages", + "release", + "3.8", + "3.9", + "3.10", + "3.11" + ], + "vscode-yaml-sort.noCompatMode": true, + "vscode-yaml-sort.sortOnSave": 2, + "vscode-yaml-sort.useArrayProcessor": false, + "vscode-yaml-sort.useBlockProcessor": false, + "vscode-yaml-sort.useCustomSortRecursively": true, + "vscode-yaml-sort.useHelmProcessor": false, + "vscode-yaml-sort.useLeadingDashes": false +} diff --git a/template/LICENSE b/template/LICENSE new file mode 100644 index 00000000..d32ca515 --- /dev/null +++ b/template/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Xuan (Sean) Hu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile.jinja b/template/Makefile.jinja similarity index 100% rename from Makefile.jinja rename to template/Makefile.jinja diff --git a/README.md.jinja b/template/README.md.jinja similarity index 100% rename from README.md.jinja rename to template/README.md.jinja diff --git a/[% if repo_host_type == 'github.com' %].github[% endif %]/FUNDING.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/FUNDING.yml.jinja similarity index 100% rename from [% if repo_host_type == 'github.com' %].github[% endif %]/FUNDING.yml.jinja rename to template/[% if repo_host_type == 'github.com' %].github[% endif %]/FUNDING.yml.jinja diff --git a/[% 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 similarity index 91% rename from [% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja rename to template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja index d608fc2a..6ade31ba 100644 --- a/[% 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 @@ -77,18 +77,14 @@ jobs: run: python -m pip install --user copier - name: Generate the project with the default value run: | - rm -rf src/serious_scaffold - rm -rf .github - rm -rf .gitlab-ci.yml - copier copy -x '!src/serious_scaffold' -d repo_host_type=gitlab.com -r HEAD -f . . + find . -maxdepth 1 | grep -vE "(\.|template|includes|\.git|copier\.yaml)$" | xargs -I {} rm -r {} + copier copy -d repo_host_type=gitlab.com -r HEAD -f . . rm .copier-answers.yml copier copy -r HEAD -f . . + rm .copier-answers.yml - run: git diff - run: git status --porcelain - - run: | - if [[ -n `git status --porcelain` ]]; then - exit 1 - fi + - run: [[ -n `git status --porcelain` ]] && exit 1 strategy: matrix: python-version: diff --git a/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja similarity index 100% rename from [% if repo_host_type == 'github.com' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja rename to template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/readthedocs-preview.yml.jinja diff --git a/[% 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 similarity index 100% rename from [% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja rename to template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja diff --git a/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja b/template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja similarity index 100% rename from [% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja rename to template/[% if repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' %].gitlab-ci.yml[% endif %].jinja diff --git a/template/constraints/default.txt b/template/constraints/default.txt new file mode 100644 index 00000000..21de3f61 --- /dev/null +++ b/template/constraints/default.txt @@ -0,0 +1,75 @@ +alabaster==0.7.13 +annotated-types==0.5.0 +autodoc-pydantic==2.0.1 +Babel==2.12.1 +beautifulsoup4==4.12.2 +black==23.7.0 +bleach==6.0.0 +build==0.10.0 +certifi==2023.7.22 +charset-normalizer==3.2.0 +click==8.1.6 +colorama==0.4.6 +coverage==7.2.7 +docutils==0.20.1 +exceptiongroup==1.1.2 +furo==2023.7.26 +idna==3.4 +imagesize==1.4.1 +importlib-metadata==6.8.0 +iniconfig==2.0.0 +isort==5.12.0 +jaraco.classes==3.3.0 +Jinja2==3.1.2 +keyring==24.2.0 +livereload==2.6.3 +lxml==4.9.3 +markdown-it-py==3.0.0 +MarkupSafe==2.1.3 +mdurl==0.1.2 +more-itertools==10.0.0 +mypy==1.4.1 +mypy-extensions==1.0.0 +packaging==23.1 +pathspec==0.11.2 +pkginfo==1.9.6 +platformdirs==3.10.0 +pluggy==1.2.0 +pydantic==2.1.1 +pydantic-settings==2.0.2 +pydantic_core==2.4.0 +Pygments==2.15.1 +pyproject_hooks==1.0.0 +pytest==7.4.0 +python-dotenv==1.0.0 +readme-renderer==40.0 +requests==2.31.0 +requests-toolbelt==1.0.0 +rfc3986==2.0.0 +rich==13.5.2 +ruff==0.0.282 +setuptools-scm==7.1.0 +shellingham==1.5.0.post1 +six==1.16.0 +snowballstemmer==2.2.0 +soupsieve==2.4.1 +Sphinx==7.1.2 +sphinx-autobuild==2021.3.14 +sphinx-basic-ng==1.0.0b2 +sphinx-click==4.4.0 +sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.5 +toml-sort==0.23.1 +tomli==2.0.1 +tomlkit==0.12.1 +tornado==6.3.2 +twine==4.0.2 +typer==0.9.0 +typing_extensions==4.7.1 +urllib3==2.0.4 +webencodings==0.5.1 +zipp==3.16.2 diff --git a/template/docs/_static/images/logo.svg b/template/docs/_static/images/logo.svg new file mode 100644 index 00000000..bbe95fae --- /dev/null +++ b/template/docs/_static/images/logo.svg @@ -0,0 +1 @@ + diff --git a/docs/api/index.rst.jinja b/template/docs/api/index.rst.jinja similarity index 100% rename from docs/api/index.rst.jinja rename to template/docs/api/index.rst.jinja diff --git a/docs/api/settings.rst.jinja b/template/docs/api/settings.rst.jinja similarity index 100% rename from docs/api/settings.rst.jinja rename to template/docs/api/settings.rst.jinja diff --git a/docs/cli/index.rst.jinja b/template/docs/cli/index.rst.jinja similarity index 100% rename from docs/cli/index.rst.jinja rename to template/docs/cli/index.rst.jinja diff --git a/docs/conf.py.jinja b/template/docs/conf.py.jinja similarity index 100% rename from docs/conf.py.jinja rename to template/docs/conf.py.jinja diff --git a/docs/index.rst.jinja b/template/docs/index.rst.jinja similarity index 100% rename from docs/index.rst.jinja rename to template/docs/index.rst.jinja diff --git a/template/docs/reports/coverage/index.rst b/template/docs/reports/coverage/index.rst new file mode 100644 index 00000000..95f61be3 --- /dev/null +++ b/template/docs/reports/coverage/index.rst @@ -0,0 +1,4 @@ +Coverage Reports +================ + +This is a placeholder for coverage reports which supposed to be overridden. diff --git a/template/docs/reports/index.rst b/template/docs/reports/index.rst new file mode 100644 index 00000000..cf491a7c --- /dev/null +++ b/template/docs/reports/index.rst @@ -0,0 +1,8 @@ +Code Quality Reports +==================== + +.. toctree:: + :maxdepth: 2 + + mypy/index + coverage/index diff --git a/template/docs/reports/mypy/index.rst b/template/docs/reports/mypy/index.rst new file mode 100644 index 00000000..16f27ab4 --- /dev/null +++ b/template/docs/reports/mypy/index.rst @@ -0,0 +1,4 @@ +MyPy Reports +============ + +This is a placeholder for mypy reports which supposed to be overridden. diff --git a/pyproject.toml.jinja b/template/pyproject.toml.jinja similarity index 100% rename from pyproject.toml.jinja rename to template/pyproject.toml.jinja diff --git a/template/requirements.txt b/template/requirements.txt new file mode 100644 index 00000000..7faba444 --- /dev/null +++ b/template/requirements.txt @@ -0,0 +1,3 @@ +# Requirements for runtime. +pydantic-settings +typer[all] diff --git a/template/requirements/docs.txt b/template/requirements/docs.txt new file mode 100644 index 00000000..e5227c95 --- /dev/null +++ b/template/requirements/docs.txt @@ -0,0 +1,9 @@ +# Requirements for docs. +autodoc-pydantic +coverage +furo +mypy[reports] +pytest +Sphinx +sphinx-autobuild +sphinx-click diff --git a/template/requirements/lint.txt b/template/requirements/lint.txt new file mode 100644 index 00000000..8b8f70fe --- /dev/null +++ b/template/requirements/lint.txt @@ -0,0 +1,6 @@ +# Requirements for lint. +black +isort +mypy +ruff +toml-sort diff --git a/template/requirements/package.txt b/template/requirements/package.txt new file mode 100644 index 00000000..0918c6ba --- /dev/null +++ b/template/requirements/package.txt @@ -0,0 +1,4 @@ +# Requirements for package. +build +setuptools-scm +twine diff --git a/template/requirements/test.txt b/template/requirements/test.txt new file mode 100644 index 00000000..4b4fbc0b --- /dev/null +++ b/template/requirements/test.txt @@ -0,0 +1,3 @@ +# Requirements for test. +coverage +pytest diff --git a/src/{{ module_name }}/__init__.py b/template/src/{{ module_name }}/__init__.py similarity index 100% rename from src/{{ module_name }}/__init__.py rename to template/src/{{ module_name }}/__init__.py diff --git a/src/{{ module_name }}/cli.py.jinja b/template/src/{{ module_name }}/cli.py.jinja similarity index 100% rename from src/{{ module_name }}/cli.py.jinja rename to template/src/{{ module_name }}/cli.py.jinja diff --git a/src/{{ module_name }}/settings.py.jinja b/template/src/{{ module_name }}/settings.py.jinja similarity index 100% rename from src/{{ module_name }}/settings.py.jinja rename to template/src/{{ module_name }}/settings.py.jinja diff --git a/template/test/__init__.py b/template/test/__init__.py new file mode 100644 index 00000000..6f62d034 --- /dev/null +++ b/template/test/__init__.py @@ -0,0 +1 @@ +"""Init for the test.""" diff --git a/test/cli_test.py.jinja b/template/test/cli_test.py.jinja similarity index 100% rename from test/cli_test.py.jinja rename to template/test/cli_test.py.jinja diff --git a/test/pkg_test.py.jinja b/template/test/pkg_test.py.jinja similarity index 100% rename from test/pkg_test.py.jinja rename to template/test/pkg_test.py.jinja diff --git a/test/settings_test.py.jinja b/template/test/settings_test.py.jinja similarity index 100% rename from test/settings_test.py.jinja rename to template/test/settings_test.py.jinja diff --git a/{{_copier_conf.answers_file}}.jinja b/template/{{_copier_conf.answers_file}}.jinja similarity index 100% rename from {{_copier_conf.answers_file}}.jinja rename to template/{{_copier_conf.answers_file}}.jinja From 35b14e9b648f265115b7320763f84d9f958d3e4a Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Wed, 30 Aug 2023 07:06:47 +0000 Subject: [PATCH 2/2] Fix github actions. --- .github/workflows/ci.yml | 2 +- .../workflows/ci.yml.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76988875..32f9a741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: rm .copier-answers.yml - run: git diff - run: git status --porcelain - - run: [[ -n `git status --porcelain` ]] && exit 1 + - run: test -z "$(git status --porcelain)" strategy: matrix: python-version: 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 6ade31ba..b9fb8cc4 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 @@ -84,7 +84,7 @@ jobs: rm .copier-answers.yml - run: git diff - run: git status --porcelain - - run: [[ -n `git status --porcelain` ]] && exit 1 + - run: test -z "$(git status --porcelain)" strategy: matrix: python-version: