From 74daef006dd314d714873e0dce3bae04f61ecf9b Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 12:42:14 +0200 Subject: [PATCH 1/8] ci(generate): run poetry lock and add poetry.lock file in py-gold branch of biskotaki repo --- .github/workflows/generate.yaml | 54 ++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 48c0684a..cb95a101 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -67,8 +67,8 @@ jobs: - name: Test distributions 'Source', 'Built' and 'edit' (dev env) mode installation env: TOXPYTHON: "python${{ env.PY_VERSION }}" + working-directory: gen/biskotaki run: | - cd gen/biskotaki tox -e 'edit,sdist,wheel' tox -e wheel-test tox -e coverage @@ -77,30 +77,38 @@ jobs: # Running Type Check, on src and Test code: Passes - name: 'Mypy: Static Type Checker -> PASS' + working-directory: gen/biskotaki run: | - cd gen/biskotaki tox -e pin-deps -- -E typing tox -e type - name: 'Ruff: Fast Python Linter -> PASS' - run: | - cd gen/biskotaki - tox -e ruff + working-directory: gen/biskotaki + run: tox -e ruff + # Running Lint Check, on src and Test code: Passes - name: 'Isort, Black: Code Formatter -> PASS' - run: | - cd gen/biskotaki - tox -e lint + working-directory: gen/biskotaki + run: tox -e lint # Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files - name: 'Build: sdist, wheel -> PASS' - run: | - cd gen/biskotaki - tox -e build + working-directory: gen/biskotaki + run: tox -e build # Running Quality Checks against Distro Metadata: Passes with 10/10 score - name: 'Pyroma: Distro Quality -> PASS' + working-directory: gen/biskotaki + run: tox -e check + + # Docs Checks: Run Build Docs command, and verify it succeeds + - name: 'Build Docs: Sphinx -> PASS' + working-directory: gen/biskotaki run: | - cd gen/biskotaki - tox -e check + tox -e pin-deps -- -E docs # poetry export + tox -e docs + + - name: Remove requirements file generated with 'poetry export' for Docs + # See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE + run: rm -f gen/biskotaki/reqs.txt # tox -e graphs @@ -120,8 +128,8 @@ jobs: target-branch: ${{ env.branch }} commit-message: 'apply Template from https://github.com/boromir674/cookiecutter-python-package' - ## GENERATE Python Gold Standard FROM TEMPLATE into gen/ ## - # ROOT : gen/biskotaki/pyproject.toml + ## GENERATE Python GOLD STANDARD from TEMPLATE into gen/ ## + # ROOT : gen-gold/biskotaki-gold-standard/pyproject.toml - name: Generate Python Gold Standard Biskotaki from Template env: USER_CONFIG: tests/data/gold-standard.yml @@ -129,6 +137,22 @@ jobs: echo " version: \"${{ env.PKG_VERSION }}\"" >> ${{ env.USER_CONFIG }} generate-python -o gen-gold --config-file "${{ env.USER_CONFIG }}" --no-input -f --offline + # Generate poetry.lock to include in the Pushed Files + - name: Generate Poetry.lock + run: poetry lock + working-directory: gen-gold/biskotaki-gold-standard + + # Docs Checks: Run Build Docs command, and verify it succeeds + - name: 'Build Docs: Sphinx -> PASS' + working-directory: gen-gold/biskotaki-gold-standard + run: | + tox -e pin-deps -- -E docs # poetry export + tox -e docs + + - name: Remove requirements file generated with 'poetry export' for Docs + # See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE + run: rm -f gen-gold/biskotaki-gold-standard/reqs.txt + ## PUSH the Python Gold Standard to BISKOTAKI REPO ## - name: Push to dedicated branch in biskotaki repo # Pin to v1.7.2 -> 07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 From b8540154bfb887b93d982c6214038d5b6f7b822a Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 12:48:10 +0200 Subject: [PATCH 2/8] emphemerally deactivate Biskotaki CI generation, for quick Gold Standard feedback --- .github/workflows/generate.yaml | 160 ++++++++++++++++---------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index cb95a101..0ad5454e 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -46,87 +46,87 @@ jobs: cd cloned/biskotaki echo "PKG_VERSION=$(python scripts/parse_version.py)" >> $GITHUB_ENV - ## GENERATE FROM TEMPLATE into gen/ ## - # ROOT : gen/biskotaki/pyproject.toml - - name: Generate Biskotaki from Template - run: | - pip install --user -e . - echo " version: \"${{ env.PKG_VERSION }}\"" >> .github/biskotaki.yaml - generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f --offline - - ## VALIDATE BISKOTAKI CI CONFIG file is in valid Yaml format ## - - name: "Validate YAML format" - run: | - GEN_CI_CONFIG=gen/biskotaki/.github/workflows/test.yaml - if [ ! $(yq eval 'true' "$GEN_CI_CONFIG") ]; then - echo "ERROR: $GEN_CI_CONFIG is malformed" - exit 1 - fi - - ## Run Test Suite against the generated project ## - - name: Test distributions 'Source', 'Built' and 'edit' (dev env) mode installation - env: - TOXPYTHON: "python${{ env.PY_VERSION }}" - working-directory: gen/biskotaki - run: | - tox -e 'edit,sdist,wheel' - tox -e wheel-test - tox -e coverage + # ## GENERATE FROM TEMPLATE into gen/ ## + # # ROOT : gen/biskotaki/pyproject.toml + # - name: Generate Biskotaki from Template + # run: | + # pip install --user -e . + # echo " version: \"${{ env.PKG_VERSION }}\"" >> .github/biskotaki.yaml + # generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f --offline + + # ## VALIDATE BISKOTAKI CI CONFIG file is in valid Yaml format ## + # - name: "Validate YAML format" + # run: | + # GEN_CI_CONFIG=gen/biskotaki/.github/workflows/test.yaml + # if [ ! $(yq eval 'true' "$GEN_CI_CONFIG") ]; then + # echo "ERROR: $GEN_CI_CONFIG is malformed" + # exit 1 + # fi + + # ## Run Test Suite against the generated project ## + # - name: Test distributions 'Source', 'Built' and 'edit' (dev env) mode installation + # env: + # TOXPYTHON: "python${{ env.PY_VERSION }}" + # working-directory: gen/biskotaki + # run: | + # tox -e 'edit,sdist,wheel' + # tox -e wheel-test + # tox -e coverage - ## Verify all Tox Envs PASS, as intented, out of the box ## - - # Running Type Check, on src and Test code: Passes - - name: 'Mypy: Static Type Checker -> PASS' - working-directory: gen/biskotaki - run: | - tox -e pin-deps -- -E typing - tox -e type - - - name: 'Ruff: Fast Python Linter -> PASS' - working-directory: gen/biskotaki - run: tox -e ruff - - # Running Lint Check, on src and Test code: Passes - - name: 'Isort, Black: Code Formatter -> PASS' - working-directory: gen/biskotaki - run: tox -e lint - # Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files - - name: 'Build: sdist, wheel -> PASS' - working-directory: gen/biskotaki - run: tox -e build - # Running Quality Checks against Distro Metadata: Passes with 10/10 score - - name: 'Pyroma: Distro Quality -> PASS' - working-directory: gen/biskotaki - run: tox -e check - - # Docs Checks: Run Build Docs command, and verify it succeeds - - name: 'Build Docs: Sphinx -> PASS' - working-directory: gen/biskotaki - run: | - tox -e pin-deps -- -E docs # poetry export - tox -e docs - - - name: Remove requirements file generated with 'poetry export' for Docs - # See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE - run: rm -f gen/biskotaki/reqs.txt - - # tox -e graphs - - ## PUSH to BISKOTAKI REPO ## - - name: Push to dedicated branch in biskotaki repo - # Pin to v1.7.2 -> 07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 - uses: cpina/github-action-push-to-another-repository@07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 - env: - SSH_DEPLOY_KEY: ${{ secrets.SSH_GITHUB_KEY }} - with: - source-directory: 'gen/biskotaki' - destination-github-username: 'boromir674' - destination-repository-name: 'biskotaki' - user-email: k.lampridis@hotmail.com - user-name: 'Konstantinos' - destination-repository-username: 'boromir674' - target-branch: ${{ env.branch }} - commit-message: 'apply Template from https://github.com/boromir674/cookiecutter-python-package' + # ## Verify all Tox Envs PASS, as intented, out of the box ## + + # # Running Type Check, on src and Test code: Passes + # - name: 'Mypy: Static Type Checker -> PASS' + # working-directory: gen/biskotaki + # run: | + # tox -e pin-deps -- -E typing + # tox -e type + + # - name: 'Ruff: Fast Python Linter -> PASS' + # working-directory: gen/biskotaki + # run: tox -e ruff + + # # Running Lint Check, on src and Test code: Passes + # - name: 'Isort, Black: Code Formatter -> PASS' + # working-directory: gen/biskotaki + # run: tox -e lint + # # Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files + # - name: 'Build: sdist, wheel -> PASS' + # working-directory: gen/biskotaki + # run: tox -e build + # # Running Quality Checks against Distro Metadata: Passes with 10/10 score + # - name: 'Pyroma: Distro Quality -> PASS' + # working-directory: gen/biskotaki + # run: tox -e check + + # # Docs Checks: Run Build Docs command, and verify it succeeds + # - name: 'Build Docs: Sphinx -> PASS' + # working-directory: gen/biskotaki + # run: | + # tox -e pin-deps -- -E docs # poetry export + # tox -e docs + + # - name: Remove requirements file generated with 'poetry export' for Docs + # # See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE + # run: rm -f gen/biskotaki/reqs.txt + + # # tox -e graphs + + # ## PUSH to BISKOTAKI REPO ## + # - name: Push to dedicated branch in biskotaki repo + # # Pin to v1.7.2 -> 07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 + # uses: cpina/github-action-push-to-another-repository@07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 + # env: + # SSH_DEPLOY_KEY: ${{ secrets.SSH_GITHUB_KEY }} + # with: + # source-directory: 'gen/biskotaki' + # destination-github-username: 'boromir674' + # destination-repository-name: 'biskotaki' + # user-email: k.lampridis@hotmail.com + # user-name: 'Konstantinos' + # destination-repository-username: 'boromir674' + # target-branch: ${{ env.branch }} + # commit-message: 'apply Template from https://github.com/boromir674/cookiecutter-python-package' ## GENERATE Python GOLD STANDARD from TEMPLATE into gen/ ## # ROOT : gen-gold/biskotaki-gold-standard/pyproject.toml From 5807a22ab18c59b196fbe92b20c00312ed599042 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 12:48:32 +0200 Subject: [PATCH 3/8] ci(generate): install pipx and poetry (using pipx) --- .github/workflows/generate.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 0ad5454e..634091de 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -139,7 +139,10 @@ jobs: # Generate poetry.lock to include in the Pushed Files - name: Generate Poetry.lock - run: poetry lock + run: | + pip install pipx + pipx install poetry + poetry lock working-directory: gen-gold/biskotaki-gold-standard # Docs Checks: Run Build Docs command, and verify it succeeds From 8fe3fab2e6448ee2628570a4e42d7aa03d93df40 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 12:51:22 +0200 Subject: [PATCH 4/8] ci(generate): install 'generate-python' CLI in dedicated step --- .github/workflows/generate.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 634091de..45bef780 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -46,11 +46,14 @@ jobs: cd cloned/biskotaki echo "PKG_VERSION=$(python scripts/parse_version.py)" >> $GITHUB_ENV + # INSTALL `generate-python` CLI + - name: Install `generate-python` CLI + run: pip install --user -e . + # ## GENERATE FROM TEMPLATE into gen/ ## # # ROOT : gen/biskotaki/pyproject.toml # - name: Generate Biskotaki from Template # run: | - # pip install --user -e . # echo " version: \"${{ env.PKG_VERSION }}\"" >> .github/biskotaki.yaml # generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f --offline From 43127723041cacb73efca4f6f4d3d3707324c095 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 13:03:59 +0200 Subject: [PATCH 5/8] ci(generate): prevent Mkdocs 'site' folder from being pushed to Biskotaki repo, after 'tox -e docs' --- .github/workflows/generate.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 45bef780..063ccfd9 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -103,7 +103,7 @@ jobs: # run: tox -e check # # Docs Checks: Run Build Docs command, and verify it succeeds - # - name: 'Build Docs: Sphinx -> PASS' + # - name: 'Sphinx: Build Docs Web Site (html/css/js) -> PASS' # working-directory: gen/biskotaki # run: | # tox -e pin-deps -- -E docs # poetry export @@ -148,14 +148,19 @@ jobs: poetry lock working-directory: gen-gold/biskotaki-gold-standard - # Docs Checks: Run Build Docs command, and verify it succeeds - - name: 'Build Docs: Sphinx -> PASS' + ## MKDOCS Checks: Run Build Docs command, and verify it succeeds ## + - name: 'Mkdocs: Build Docs Web Site (html/css/js) -> PASS' working-directory: gen-gold/biskotaki-gold-standard run: | tox -e pin-deps -- -E docs # poetry export tox -e docs - - name: Remove requirements file generated with 'poetry export' for Docs + # exlude 'site' dir from pushing to biskotaki repo + - name: Exclude 'site' folder, built with Mkdocs, from 'git push' + run: rm -rf gen-gold/biskotaki-gold-standard/site + + # exlude 'reqs.txt' file, generated with 'poetry export' for Docs + - name: Exclude 'reqs.txt' file, generated with 'poetry export' for Docs # See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE run: rm -f gen-gold/biskotaki-gold-standard/reqs.txt From d117d0d4d012ebdac9204dd8b83bbea7acf1b4a4 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 13:41:01 +0200 Subject: [PATCH 6/8] feat(cli): comment out the 'verbose' cli flag to make pylint score over 8.2 on fresh project --- .../src/{{ cookiecutter.pkg_name }}/cli.py | 4 ++-- .../biskotaki-gold-standard/src/biskotakigold/cli.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py index 8782e715..6c000476 100644 --- a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py +++ b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py @@ -24,9 +24,9 @@ def version_msg(): @click.command(context_settings=dict(help_option_names=[u'-h', u'--help'])) @click.version_option(__version__, u'-V', u'--version', message=version_msg()) -@click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False) +# @click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False) def main( - verbose, + # verbose, ): """TODO Write this content that gets renders when invoking with --help flag! diff --git a/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py b/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py index cc10431a..9f14234a 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py +++ b/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py @@ -24,9 +24,9 @@ def version_msg(): @click.command(context_settings=dict(help_option_names=[u'-h', u'--help'])) @click.version_option(__version__, u'-V', u'--version', message=version_msg()) -@click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False) +# @click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False) def main( - verbose, + # verbose, ): """TODO Write this content that gets renders when invoking with --help flag! From 25c579d134f561bf82dcc2ac99559cc09c243305 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 15:30:53 +0200 Subject: [PATCH 7/8] feat: make Gold Standard Python Project pass Pylint Job on CI --- .../src/{{ cookiecutter.pkg_name }}/__main__.py | 2 +- .../src/{{ cookiecutter.pkg_name }}/cli.py | 2 +- .../biskotaki-gold-standard/src/biskotakigold/__main__.py | 2 +- .../snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/__main__.py b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/__main__.py index a3b43fa3..7cf7c3c4 100644 --- a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/__main__.py +++ b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/__main__.py @@ -14,4 +14,4 @@ from {{ cookiecutter.pkg_name }}.cli import main if __name__ == "__main__": # pragma: no cover - main(prog_name="{{ cookiecutter.pkg_name|replace('_', '-') }}") + main(prog_name="{{ cookiecutter.pkg_name|replace('_', '-') }}") # pylint: disable=unexpected-keyword-arg diff --git a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py index 6c000476..9d9ce2f8 100644 --- a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py +++ b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.pkg_name }}/cli.py @@ -39,7 +39,7 @@ def main( """ try: pass - except Exception as error: + except Exception as error: # pylint: disable=broad-except click.echo(error) sys.exit(1) diff --git a/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/__main__.py b/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/__main__.py index f5684fb1..7e94b292 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/__main__.py +++ b/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/__main__.py @@ -14,4 +14,4 @@ from biskotakigold.cli import main if __name__ == "__main__": # pragma: no cover - main(prog_name="biskotakigold") + main(prog_name="biskotakigold") # pylint: disable=unexpected-keyword-arg diff --git a/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py b/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py index 9f14234a..2d959ccb 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py +++ b/tests/data/snapshots/biskotaki-gold-standard/src/biskotakigold/cli.py @@ -39,7 +39,7 @@ def main( """ try: pass - except Exception as error: + except Exception as error: # pylint: disable=broad-except click.echo(error) sys.exit(1) From 85362e77af7843d2250efd1b55eca7733f5d5571 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Thu, 14 Mar 2024 15:37:30 +0200 Subject: [PATCH 8/8] set generate workflow to production state --- .github/workflows/generate.yaml | 158 ++++++++++++++++---------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 063ccfd9..6bd36285 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -50,86 +50,86 @@ jobs: - name: Install `generate-python` CLI run: pip install --user -e . - # ## GENERATE FROM TEMPLATE into gen/ ## - # # ROOT : gen/biskotaki/pyproject.toml - # - name: Generate Biskotaki from Template - # run: | - # echo " version: \"${{ env.PKG_VERSION }}\"" >> .github/biskotaki.yaml - # generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f --offline - - # ## VALIDATE BISKOTAKI CI CONFIG file is in valid Yaml format ## - # - name: "Validate YAML format" - # run: | - # GEN_CI_CONFIG=gen/biskotaki/.github/workflows/test.yaml - # if [ ! $(yq eval 'true' "$GEN_CI_CONFIG") ]; then - # echo "ERROR: $GEN_CI_CONFIG is malformed" - # exit 1 - # fi - - # ## Run Test Suite against the generated project ## - # - name: Test distributions 'Source', 'Built' and 'edit' (dev env) mode installation - # env: - # TOXPYTHON: "python${{ env.PY_VERSION }}" - # working-directory: gen/biskotaki - # run: | - # tox -e 'edit,sdist,wheel' - # tox -e wheel-test - # tox -e coverage + ## GENERATE FROM TEMPLATE into gen/ ## + # ROOT : gen/biskotaki/pyproject.toml + - name: Generate Biskotaki from Template + run: | + echo " version: \"${{ env.PKG_VERSION }}\"" >> .github/biskotaki.yaml + generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f --offline + + ## VALIDATE BISKOTAKI CI CONFIG file is in valid Yaml format ## + - name: "Validate YAML format" + run: | + GEN_CI_CONFIG=gen/biskotaki/.github/workflows/test.yaml + if [ ! $(yq eval 'true' "$GEN_CI_CONFIG") ]; then + echo "ERROR: $GEN_CI_CONFIG is malformed" + exit 1 + fi + + ## Run Test Suite against the generated project ## + - name: Test distributions 'Source', 'Built' and 'edit' (dev env) mode installation + env: + TOXPYTHON: "python${{ env.PY_VERSION }}" + working-directory: gen/biskotaki + run: | + tox -e 'edit,sdist,wheel' + tox -e wheel-test + tox -e coverage - # ## Verify all Tox Envs PASS, as intented, out of the box ## - - # # Running Type Check, on src and Test code: Passes - # - name: 'Mypy: Static Type Checker -> PASS' - # working-directory: gen/biskotaki - # run: | - # tox -e pin-deps -- -E typing - # tox -e type - - # - name: 'Ruff: Fast Python Linter -> PASS' - # working-directory: gen/biskotaki - # run: tox -e ruff - - # # Running Lint Check, on src and Test code: Passes - # - name: 'Isort, Black: Code Formatter -> PASS' - # working-directory: gen/biskotaki - # run: tox -e lint - # # Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files - # - name: 'Build: sdist, wheel -> PASS' - # working-directory: gen/biskotaki - # run: tox -e build - # # Running Quality Checks against Distro Metadata: Passes with 10/10 score - # - name: 'Pyroma: Distro Quality -> PASS' - # working-directory: gen/biskotaki - # run: tox -e check - - # # Docs Checks: Run Build Docs command, and verify it succeeds - # - name: 'Sphinx: Build Docs Web Site (html/css/js) -> PASS' - # working-directory: gen/biskotaki - # run: | - # tox -e pin-deps -- -E docs # poetry export - # tox -e docs - - # - name: Remove requirements file generated with 'poetry export' for Docs - # # See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE - # run: rm -f gen/biskotaki/reqs.txt - - # # tox -e graphs - - # ## PUSH to BISKOTAKI REPO ## - # - name: Push to dedicated branch in biskotaki repo - # # Pin to v1.7.2 -> 07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 - # uses: cpina/github-action-push-to-another-repository@07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 - # env: - # SSH_DEPLOY_KEY: ${{ secrets.SSH_GITHUB_KEY }} - # with: - # source-directory: 'gen/biskotaki' - # destination-github-username: 'boromir674' - # destination-repository-name: 'biskotaki' - # user-email: k.lampridis@hotmail.com - # user-name: 'Konstantinos' - # destination-repository-username: 'boromir674' - # target-branch: ${{ env.branch }} - # commit-message: 'apply Template from https://github.com/boromir674/cookiecutter-python-package' + ## Verify all Tox Envs PASS, as intented, out of the box ## + + # Running Type Check, on src and Test code: Passes + - name: 'Mypy: Static Type Checker -> PASS' + working-directory: gen/biskotaki + run: | + tox -e pin-deps -- -E typing + tox -e type + + - name: 'Ruff: Fast Python Linter -> PASS' + working-directory: gen/biskotaki + run: tox -e ruff + + # Running Lint Check, on src and Test code: Passes + - name: 'Isort, Black: Code Formatter -> PASS' + working-directory: gen/biskotaki + run: tox -e lint + # Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files + - name: 'Build: sdist, wheel -> PASS' + working-directory: gen/biskotaki + run: tox -e build + # Running Quality Checks against Distro Metadata: Passes with 10/10 score + - name: 'Pyroma: Distro Quality -> PASS' + working-directory: gen/biskotaki + run: tox -e check + + # Docs Checks: Run Build Docs command, and verify it succeeds + - name: 'Sphinx: Build Docs Web Site (html/css/js) -> PASS' + working-directory: gen/biskotaki + run: | + tox -e pin-deps -- -E docs # poetry export + tox -e docs + + - name: Remove requirements file generated with 'poetry export' for Docs + # See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE + run: rm -f gen/biskotaki/reqs.txt + + # tox -e graphs + + ## PUSH to BISKOTAKI REPO ## + - name: Push to dedicated branch in biskotaki repo + # Pin to v1.7.2 -> 07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 + uses: cpina/github-action-push-to-another-repository@07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 + env: + SSH_DEPLOY_KEY: ${{ secrets.SSH_GITHUB_KEY }} + with: + source-directory: 'gen/biskotaki' + destination-github-username: 'boromir674' + destination-repository-name: 'biskotaki' + user-email: k.lampridis@hotmail.com + user-name: 'Konstantinos' + destination-repository-username: 'boromir674' + target-branch: ${{ env.branch }} + commit-message: 'apply Template from https://github.com/boromir674/cookiecutter-python-package' ## GENERATE Python GOLD STANDARD from TEMPLATE into gen/ ## # ROOT : gen-gold/biskotaki-gold-standard/pyproject.toml