From 9cfa3f0e6d9732d9f925367f4a9708a41f0db312 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:30:22 +0200 Subject: [PATCH 01/17] tests(data): update biskotaki-no-input Snapshot, used in Regression Testing --- .../.github/workflows/test.yaml | 127 +++++++----------- .../biskotaki-no-input/CHANGELOG.rst | 2 +- .../biskotaki-no-input/docs/make.bat | 70 +++++----- 3 files changed, 85 insertions(+), 114 deletions(-) diff --git a/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml b/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml index ba7727ab..21b0bf3f 100644 --- a/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml +++ b/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml @@ -241,7 +241,7 @@ jobs: runs-on: ubuntu-latest needs: test_suite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Get Codecov binary run: | curl -Os https://uploader.codecov.io/latest/linux/codecov @@ -260,7 +260,7 @@ jobs: done ## DOCKER BUILD and PUBLISH ON DOCKERHUB ## -# Docs Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ +# Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ docker_build: needs: [set_github_outputs, test_suite] uses: boromir674/automated-workflows/.github/workflows/docker.yml@v1.1.0 @@ -275,31 +275,32 @@ jobs: secrets: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} -# PUBLISH DISTRIBUTIONS ON PYPI -# we consider publishing on tags starting with "v" + ## JOB: Signal for Automated PyPI Upload ## check_which_git_branch_we_are_on: runs-on: ubuntu-latest - needs: set_github_outputs - if: startsWith(github.event.ref, 'refs/tags/v') && needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' - outputs: - ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} - AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + if: ${{ startsWith(github.event.ref, 'refs/tags/v') }} + env: + RELEASE_BR: ${{ vars.RELEASE_BRANCH || 'release' }} + MAIN_BR: ${{ vars.MAIN_BRANCH || 'main' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: rickstaa/action-contains-tag@v1 + - run: git branch --track "${{ env.RELEASE_BR }}" "origin/${{ env.RELEASE_BR }}" + + - name: "Check if '${{ github.ref }}' tag is on '${{ env.MAIN_BR }}' branch" + uses: rickstaa/action-contains-tag@v1 id: main_contains_tag with: - reference: "master" - tag: ${{ github.ref }} - - run: echo "ON_MAIN_BRANCH=${{ steps.main_contains_tag.outputs.retval }}" >> $GITHUB_OUTPUT - - uses: rickstaa/action-contains-tag@v1 + reference: ${{ env.MAIN_BR }} + tag: "${{ github.ref }}" + - name: "Check if '${{ github.ref }}' tag is on '${{ env.RELEASE_BR }}' branch" + uses: rickstaa/action-contains-tag@v1 id: release_contains_tag with: - reference: "release" - tag: ${{ github.ref }} - - run: echo "ON_RELEASE_BRANCH=${{ steps.release_contains_tag.outputs.retval }}" >> $GITHUB_OUTPUT + reference: ${{ env.RELEASE_BR }} + tag: "${{ github.ref }}" + - name: Pick Production or Test Environment, if tag on master or release branch respectively id: set_environment_name run: | @@ -313,67 +314,24 @@ jobs: DEPLOY=false fi echo "AUTOMATED_DEPLOY=$DEPLOY" >> $GITHUB_OUTPUT - + outputs: + ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} + AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + ## JOB: PYPI UPLOAD ## pypi_publish: - needs: [test_suite, check_which_git_branch_we_are_on] - runs-on: ubuntu-latest - # if we are on tag starting with "v" and if we are on master or dev branch - if: startsWith(github.event.ref, 'refs/tags/v') && ${{ needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} - environment: - name: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }} - env: - DIST_DIR: dist - PACKAGE_DIST_VERSION: ${{ needs.test_suite.outputs.PEP_VERSION }} - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + needs: [set_github_outputs, test_suite, check_which_git_branch_we_are_on] + uses: boromir674/automated-workflows/.github/workflows/pypi_env.yml@8e97f596067fcbbaa0a6927ec1ee47dce4ab5f1a + with: + should_trigger: ${{ needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' && needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} + distro_name: cookiecutter_python + distro_version: ${{ needs.test_suite.outputs.PEP_VERSION }} + pypi_env: '${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }}' + artifacts_path: downloaded-artifacts + + require_wheel: true + allow_existing: true + secrets: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - PYPI_SERVER: ${{ vars.PYPI_SERVER }} - steps: - - uses: actions/checkout@v3 - - name: Download Source & Wheel distributions - uses: actions/download-artifact@v3 - with: - path: downloaded-artifacts - - name: Get Publishable files from the Artifacts - run: | - TAG="${GITHUB_REF_NAME}" - SEM_VER="${TAG:1}" # remove the first character (v) - PARSER="./scripts/parse_version.py" - PACKAGE_VERSION=$(python "${PARSER}") - if [[ "${PACKAGE_VERSION}" != "${SEM_VER}" ]]; then - echo "ERROR: Sem Ver, from Python Code (${PACKAGE_VERSION}), does not match tag version (${SEM_VER})" - exit 1 - fi - - run: mkdir ${DIST_DIR} - - run: | - # Get Source Distribution (tar.gz of source code) - source_distributions=$(find downloaded-artifacts -type f -name biskotaki*.tar.gz) - source_distributions_array=($source_distributions) - source_distribution=${source_distributions_array[0]} # a *.tar.gz file path - # Extract the base name (without the path) - source_distribution_name=$(basename "$source_distribution") - # Check if all source distribution (.tar.gz) files have the same name - for file in "${source_distributions_array[@]}"; do - if [ "$source_distribution_name" != "$(basename "$file")" ]; then - echo "Error: Not all Source Distribution .tar.gz files have the same name!" - exit 1 - fi - done - echo "source_distribution=$source_distribution" >> $GITHUB_ENV - - run: cp "$source_distribution" ${DIST_DIR} - - run: | - # Get all built Wheels and copy to dist folder - for f in `find downloaded-artifacts -type f -name biskotaki*.whl`; do - echo "F: $f"; - # TODO check for duplicates, which means that our build matrix produces the same wheel (need a different compiler that python such as pypy, cython, etc) - cp $f ${DIST_DIR} - done - - name: Install Dependencies - run: pip install tox==3.28 - - run: echo "Publishing $PACKAGE_DIST_VERSION to $PYPI_SERVER PyPI" - - name: Publish to PyPI - run: tox -vv -s false -e deploy -- upload --non-interactive --skip-existing - - run: echo "Published :\)" - ### STATIC CODE ANALYSIS & LINTING ### lint: name: Static Code Analysis @@ -400,10 +358,23 @@ jobs: code_visualization: needs: set_github_outputs name: Code Visualization of Python Imports as Graphs, in .svg - uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@8a441fa8fa008f1902ba892f8e8332fc77284597 + uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@v1.3.0 with: run_policy: '${{ needs.set_github_outputs.outputs.PIPE_CODE_VIZ_POLICY }}' branches: 'main, master, dev' source_code_targets: 'src' python_version: '3.10' artifacts_dir: 'dependency-graphs' + +### Make a Github Release ### + gh_release: + needs: [test_suite, check_which_git_branch_we_are_on] + if: ${{ needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} + uses: boromir674/automated-workflows/.github/workflows/gh-release.yml@test + name: 'GH Release' + with: + tag: ${{ github.ref_name }} + draft: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME == 'TEST_DEPLOYMENT' }} + secrets: + # passing the GH_TOKEN PAT, to render in GH as ie: 'boromir674 released this yesterday', instead of 'github-actions released this yesterday' + gh_token: ${{ secrets.GH_TOKEN }} diff --git a/tests/data/snapshots/biskotaki-no-input/CHANGELOG.rst b/tests/data/snapshots/biskotaki-no-input/CHANGELOG.rst index 6d72b332..59ca7bc3 100644 --- a/tests/data/snapshots/biskotaki-no-input/CHANGELOG.rst +++ b/tests/data/snapshots/biskotaki-no-input/CHANGELOG.rst @@ -2,7 +2,7 @@ Changelog ========= -0.0.1 (2024-02-02) +0.0.1 (2024-03-13) ======================================= | This is the first ever release of the **biskotaki** Python Package. diff --git a/tests/data/snapshots/biskotaki-no-input/docs/make.bat b/tests/data/snapshots/biskotaki-no-input/docs/make.bat index 922152e9..2119f510 100644 --- a/tests/data/snapshots/biskotaki-no-input/docs/make.bat +++ b/tests/data/snapshots/biskotaki-no-input/docs/make.bat @@ -1,35 +1,35 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd From 19a191a05e89ec9d1bfd3e85504627cf16891094 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:40:07 +0200 Subject: [PATCH 02/17] tests(data): update biskotaki-interactive Snapshot, used in Regression Testing --- .../.github/workflows/test.yaml | 127 +++++++----------- .../biskotaki-interactive/CHANGELOG.rst | 2 +- .../biskotaki-interactive/docs/make.bat | 70 +++++----- 3 files changed, 85 insertions(+), 114 deletions(-) diff --git a/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml b/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml index ba7727ab..21b0bf3f 100644 --- a/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml +++ b/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml @@ -241,7 +241,7 @@ jobs: runs-on: ubuntu-latest needs: test_suite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Get Codecov binary run: | curl -Os https://uploader.codecov.io/latest/linux/codecov @@ -260,7 +260,7 @@ jobs: done ## DOCKER BUILD and PUBLISH ON DOCKERHUB ## -# Docs Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ +# Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ docker_build: needs: [set_github_outputs, test_suite] uses: boromir674/automated-workflows/.github/workflows/docker.yml@v1.1.0 @@ -275,31 +275,32 @@ jobs: secrets: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} -# PUBLISH DISTRIBUTIONS ON PYPI -# we consider publishing on tags starting with "v" + ## JOB: Signal for Automated PyPI Upload ## check_which_git_branch_we_are_on: runs-on: ubuntu-latest - needs: set_github_outputs - if: startsWith(github.event.ref, 'refs/tags/v') && needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' - outputs: - ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} - AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + if: ${{ startsWith(github.event.ref, 'refs/tags/v') }} + env: + RELEASE_BR: ${{ vars.RELEASE_BRANCH || 'release' }} + MAIN_BR: ${{ vars.MAIN_BRANCH || 'main' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: rickstaa/action-contains-tag@v1 + - run: git branch --track "${{ env.RELEASE_BR }}" "origin/${{ env.RELEASE_BR }}" + + - name: "Check if '${{ github.ref }}' tag is on '${{ env.MAIN_BR }}' branch" + uses: rickstaa/action-contains-tag@v1 id: main_contains_tag with: - reference: "master" - tag: ${{ github.ref }} - - run: echo "ON_MAIN_BRANCH=${{ steps.main_contains_tag.outputs.retval }}" >> $GITHUB_OUTPUT - - uses: rickstaa/action-contains-tag@v1 + reference: ${{ env.MAIN_BR }} + tag: "${{ github.ref }}" + - name: "Check if '${{ github.ref }}' tag is on '${{ env.RELEASE_BR }}' branch" + uses: rickstaa/action-contains-tag@v1 id: release_contains_tag with: - reference: "release" - tag: ${{ github.ref }} - - run: echo "ON_RELEASE_BRANCH=${{ steps.release_contains_tag.outputs.retval }}" >> $GITHUB_OUTPUT + reference: ${{ env.RELEASE_BR }} + tag: "${{ github.ref }}" + - name: Pick Production or Test Environment, if tag on master or release branch respectively id: set_environment_name run: | @@ -313,67 +314,24 @@ jobs: DEPLOY=false fi echo "AUTOMATED_DEPLOY=$DEPLOY" >> $GITHUB_OUTPUT - + outputs: + ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} + AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + ## JOB: PYPI UPLOAD ## pypi_publish: - needs: [test_suite, check_which_git_branch_we_are_on] - runs-on: ubuntu-latest - # if we are on tag starting with "v" and if we are on master or dev branch - if: startsWith(github.event.ref, 'refs/tags/v') && ${{ needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} - environment: - name: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }} - env: - DIST_DIR: dist - PACKAGE_DIST_VERSION: ${{ needs.test_suite.outputs.PEP_VERSION }} - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + needs: [set_github_outputs, test_suite, check_which_git_branch_we_are_on] + uses: boromir674/automated-workflows/.github/workflows/pypi_env.yml@8e97f596067fcbbaa0a6927ec1ee47dce4ab5f1a + with: + should_trigger: ${{ needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' && needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} + distro_name: cookiecutter_python + distro_version: ${{ needs.test_suite.outputs.PEP_VERSION }} + pypi_env: '${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }}' + artifacts_path: downloaded-artifacts + + require_wheel: true + allow_existing: true + secrets: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - PYPI_SERVER: ${{ vars.PYPI_SERVER }} - steps: - - uses: actions/checkout@v3 - - name: Download Source & Wheel distributions - uses: actions/download-artifact@v3 - with: - path: downloaded-artifacts - - name: Get Publishable files from the Artifacts - run: | - TAG="${GITHUB_REF_NAME}" - SEM_VER="${TAG:1}" # remove the first character (v) - PARSER="./scripts/parse_version.py" - PACKAGE_VERSION=$(python "${PARSER}") - if [[ "${PACKAGE_VERSION}" != "${SEM_VER}" ]]; then - echo "ERROR: Sem Ver, from Python Code (${PACKAGE_VERSION}), does not match tag version (${SEM_VER})" - exit 1 - fi - - run: mkdir ${DIST_DIR} - - run: | - # Get Source Distribution (tar.gz of source code) - source_distributions=$(find downloaded-artifacts -type f -name biskotaki*.tar.gz) - source_distributions_array=($source_distributions) - source_distribution=${source_distributions_array[0]} # a *.tar.gz file path - # Extract the base name (without the path) - source_distribution_name=$(basename "$source_distribution") - # Check if all source distribution (.tar.gz) files have the same name - for file in "${source_distributions_array[@]}"; do - if [ "$source_distribution_name" != "$(basename "$file")" ]; then - echo "Error: Not all Source Distribution .tar.gz files have the same name!" - exit 1 - fi - done - echo "source_distribution=$source_distribution" >> $GITHUB_ENV - - run: cp "$source_distribution" ${DIST_DIR} - - run: | - # Get all built Wheels and copy to dist folder - for f in `find downloaded-artifacts -type f -name biskotaki*.whl`; do - echo "F: $f"; - # TODO check for duplicates, which means that our build matrix produces the same wheel (need a different compiler that python such as pypy, cython, etc) - cp $f ${DIST_DIR} - done - - name: Install Dependencies - run: pip install tox==3.28 - - run: echo "Publishing $PACKAGE_DIST_VERSION to $PYPI_SERVER PyPI" - - name: Publish to PyPI - run: tox -vv -s false -e deploy -- upload --non-interactive --skip-existing - - run: echo "Published :\)" - ### STATIC CODE ANALYSIS & LINTING ### lint: name: Static Code Analysis @@ -400,10 +358,23 @@ jobs: code_visualization: needs: set_github_outputs name: Code Visualization of Python Imports as Graphs, in .svg - uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@8a441fa8fa008f1902ba892f8e8332fc77284597 + uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@v1.3.0 with: run_policy: '${{ needs.set_github_outputs.outputs.PIPE_CODE_VIZ_POLICY }}' branches: 'main, master, dev' source_code_targets: 'src' python_version: '3.10' artifacts_dir: 'dependency-graphs' + +### Make a Github Release ### + gh_release: + needs: [test_suite, check_which_git_branch_we_are_on] + if: ${{ needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} + uses: boromir674/automated-workflows/.github/workflows/gh-release.yml@test + name: 'GH Release' + with: + tag: ${{ github.ref_name }} + draft: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME == 'TEST_DEPLOYMENT' }} + secrets: + # passing the GH_TOKEN PAT, to render in GH as ie: 'boromir674 released this yesterday', instead of 'github-actions released this yesterday' + gh_token: ${{ secrets.GH_TOKEN }} diff --git a/tests/data/snapshots/biskotaki-interactive/CHANGELOG.rst b/tests/data/snapshots/biskotaki-interactive/CHANGELOG.rst index 4d6004e5..59ca7bc3 100644 --- a/tests/data/snapshots/biskotaki-interactive/CHANGELOG.rst +++ b/tests/data/snapshots/biskotaki-interactive/CHANGELOG.rst @@ -2,7 +2,7 @@ Changelog ========= -0.0.1 (2024-02-18) +0.0.1 (2024-03-13) ======================================= | This is the first ever release of the **biskotaki** Python Package. diff --git a/tests/data/snapshots/biskotaki-interactive/docs/make.bat b/tests/data/snapshots/biskotaki-interactive/docs/make.bat index 922152e9..2119f510 100644 --- a/tests/data/snapshots/biskotaki-interactive/docs/make.bat +++ b/tests/data/snapshots/biskotaki-interactive/docs/make.bat @@ -1,35 +1,35 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd From b431401dc9f33d151606d268bfdb98685f5f7578 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:41:45 +0200 Subject: [PATCH 03/17] ci: clean code --- .github/workflows/test.yaml | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f52c363f..af9439a3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,16 +1,17 @@ name: CI/CD Pipeline # Continuous Integration / Continuous Delivery -# Triggers on all branches and tags starting with v +# Triggers on all Branches and v* Tags -### Full Job Matrix for Stress Testing on: ### +### Stress-Testing, with Multi-Factor Job Matrix, on: ### # - tags v* # - the 'stress-test' branch (GITHUB_REF_NAME == 'stress-test') -### PyPI publish on: ### +### Production PyPI Publish, pypi.org, on: ### # - v* tags on 'master' branch only +### Staging/Test PyPI Publish, test.pypi.org, on: ### ## Test PyPI publish on: ## # - v*-rc 'pre-release' tags on 'release' branch @@ -32,7 +33,7 @@ env: UBUNTU_PY310_STRATEGY: "{\"platform\": [\"ubuntu-latest\"], \"python-version\": [\"3.10\"]}" TEST_STRATEGY: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\":[\"3.10\"]}" - ##### JOB ON/OFF SWITCHES - 1st level overrides ##### + ##### JOB ON/OFF SWITCHES - Top/1st level overrides ##### RUN_UNIT_TESTS: "true" RUN_LINT_CHECKS: "true" DOCKER_JOB_ON: "true" @@ -297,6 +298,7 @@ jobs: done ## DOCKER BUILD and PUBLISH ON DOCKERHUB ## +# Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ docker_build: needs: [set_github_outputs, test_suite] uses: boromir674/automated-workflows/.github/workflows/docker.yml@v1.1.0 @@ -354,7 +356,6 @@ jobs: outputs: ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} - TAG_ON_MASTER: ${{ steps.main_contains_tag.outputs.retval }} ## JOB: PYPI UPLOAD ## pypi_publish: @@ -372,18 +373,6 @@ jobs: secrets: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} -### DOCS BUILD/TEST - DOCUMENTATION SITE ### - docs: - name: Build Documentation - needs: set_github_outputs - # bafaa2c2a014758a4421fe9b5c02ba66dbfdbef6 - uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@test - with: - run_policy: '${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }}' - python_version: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_PY }} - command: "tox -e docs --sitepackages -vv -s false" - # command: "tox -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false" - ### STATIC CODE ANALYSIS & LINTING ### lint: name: Static Code Analysis @@ -396,11 +385,23 @@ jobs: python_version: ${{ needs.set_github_outputs.outputs.PIPE_SQA_PY }} pylint_threshold: ${{ needs.set_github_outputs.outputs.PIPE_SQA_PYLINT_PASS_SCORE }} +### DOCS BUILD/TEST - DOCUMENTATION SITE ### + docs: + name: Build Documentation + needs: set_github_outputs + # bafaa2c2a014758a4421fe9b5c02ba66dbfdbef6 + uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@test + with: + run_policy: '${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }}' + python_version: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_PY }} + command: "tox -e docs --sitepackages -vv -s false" + # command: "tox -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false" + ### DRAW PYTHON DEPENDENCY GRAPHS ### code_visualization: needs: set_github_outputs name: Code Visualization of Python Imports as Graphs, in .svg - uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@test + uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@v1.3.0 with: run_policy: '${{ needs.set_github_outputs.outputs.PIPE_CODE_VIZ_POLICY }}' branches: 'main, master, dev' @@ -408,7 +409,6 @@ jobs: python_version: '3.10' artifacts_dir: 'dependency-graphs' - ### Make a Github Release ### gh_release: needs: [test_suite, check_which_git_branch_we_are_on] From b28c3c37daa5fd90a89ede5211491ee8b0ef7045 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:43:20 +0200 Subject: [PATCH 04/17] fix: expect interpreters to be loaded as dict by cookiecutter in intereactive mode --- src/cookiecutter_python/backend/helpers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cookiecutter_python/backend/helpers.py b/src/cookiecutter_python/backend/helpers.py index bbd624f3..8f8f83d3 100644 --- a/src/cookiecutter_python/backend/helpers.py +++ b/src/cookiecutter_python/backend/helpers.py @@ -53,7 +53,12 @@ def parse_context(config_file: str): data = get_user_config(config_file, default_config=False) # data = load_yaml(config_file) user_context = data['default_context'] - c = json.loads(user_context.get('interpreters', '{}')) + _interpreters: t.Mapping[str, t.List[str]] = user_context.get('interpreters', '{}') + if isinstance(_interpreters, str): + logger.warning("Interpreters expected to be loaded in a python dict already. Got a string instead.") + logger.info("Converting interpreters %s to a python dict", _interpreters) + _interpreters = json.loads(_interpreters) + c = _interpreters context_defaults = dict(cookie_defaults, **user_context) From c1db7ca43baa471e223fa83c1807d0733d1b89d5 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:43:59 +0200 Subject: [PATCH 05/17] feat(cicd): add Job that makes a Github Release on v* tags on Main Branch --- .../.github/workflows/test.yaml | 129 +++++++----------- 1 file changed, 50 insertions(+), 79 deletions(-) diff --git a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml index be4a0b6c..3e439728 100644 --- a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml +++ b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml @@ -241,7 +241,7 @@ jobs: runs-on: ubuntu-latest needs: test_suite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Get Codecov binary run: | curl -Os https://uploader.codecov.io/latest/linux/codecov @@ -260,7 +260,7 @@ jobs: done ## DOCKER BUILD and PUBLISH ON DOCKERHUB ## -# Docs Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ +# Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ docker_build: needs: [set_github_outputs, test_suite] uses: boromir674/automated-workflows/.github/workflows/docker.yml@v1.1.0 @@ -275,31 +275,32 @@ jobs: secrets: DOCKER_PASSWORD: ${{ "{{" }} secrets.DOCKER_PASSWORD {{ "}}" }} -# PUBLISH DISTRIBUTIONS ON PYPI -# we consider publishing on tags starting with "v" + ## JOB: Signal for Automated PyPI Upload ## check_which_git_branch_we_are_on: runs-on: ubuntu-latest - needs: set_github_outputs - if: startsWith(github.event.ref, 'refs/tags/v') && needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' - outputs: - ENVIRONMENT_NAME: ${{ "{{" }} steps.set_environment_name.outputs.ENVIRONMENT_NAME {{ "}}" }} - AUTOMATED_DEPLOY: ${{ "{{" }} steps.set_environment_name.outputs.AUTOMATED_DEPLOY {{ "}}" }} + if: ${{ "{{" }} startsWith(github.event.ref, 'refs/tags/v') {{ "}}" }} + env: + RELEASE_BR: ${{ "{{" }} vars.RELEASE_BRANCH || 'release' {{ "}}" }} + MAIN_BR: ${{ "{{" }} vars.MAIN_BRANCH || 'main' {{ "}}" }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: rickstaa/action-contains-tag@v1 + - run: git branch --track "${{ "{{" }} env.RELEASE_BR {{ "}}" }}" "origin/${{ "{{" }} env.RELEASE_BR {{ "}}" }}" + + - name: "Check if '${{ "{{" }} github.ref {{ "}}" }}' tag is on '${{ "{{" }} env.MAIN_BR {{ "}}" }}' branch" + uses: rickstaa/action-contains-tag@v1 id: main_contains_tag with: - reference: "master" - tag: ${{ "{{" }} github.ref {{ "}}" }} - - run: echo "ON_MAIN_BRANCH=${{ "{{" }} steps.main_contains_tag.outputs.retval {{ "}}" }}" >> $GITHUB_OUTPUT - - uses: rickstaa/action-contains-tag@v1 + reference: ${{ "{{" }} env.MAIN_BR {{ "}}" }} + tag: "${{ "{{" }} github.ref {{ "}}" }}" + - name: "Check if '${{ "{{" }} github.ref {{ "}}" }}' tag is on '${{ "{{" }} env.RELEASE_BR {{ "}}" }}' branch" + uses: rickstaa/action-contains-tag@v1 id: release_contains_tag with: - reference: "release" - tag: ${{ "{{" }} github.ref {{ "}}" }} - - run: echo "ON_RELEASE_BRANCH=${{ "{{" }} steps.release_contains_tag.outputs.retval {{ "}}" }}" >> $GITHUB_OUTPUT + reference: ${{ "{{" }} env.RELEASE_BR {{ "}}" }} + tag: "${{ "{{" }} github.ref {{ "}}" }}" + - name: Pick Production or Test Environment, if tag on master or release branch respectively id: set_environment_name run: | @@ -313,67 +314,24 @@ jobs: DEPLOY=false fi echo "AUTOMATED_DEPLOY=$DEPLOY" >> $GITHUB_OUTPUT - + outputs: + ENVIRONMENT_NAME: ${{ "{{" }} steps.set_environment_name.outputs.ENVIRONMENT_NAME {{ "}}" }} + AUTOMATED_DEPLOY: ${{ "{{" }} steps.set_environment_name.outputs.AUTOMATED_DEPLOY {{ "}}" }} + ## JOB: PYPI UPLOAD ## pypi_publish: - needs: [test_suite, check_which_git_branch_we_are_on] - runs-on: ubuntu-latest - # if we are on tag starting with "v" and if we are on master or dev branch - if: startsWith(github.event.ref, 'refs/tags/v') && ${{ "{{" }} needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' {{ "}}" }} - environment: - name: ${{ "{{" }} needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME {{ "}}" }} - env: - DIST_DIR: dist - PACKAGE_DIST_VERSION: ${{ "{{" }} needs.test_suite.outputs.PEP_VERSION {{ "}}" }} - TWINE_USERNAME: ${{ "{{" }} secrets.TWINE_USERNAME {{ "}}" }} - TWINE_PASSWORD: ${{ "{{" }} secrets.TWINE_PASSWORD {{ "}}" }} - PYPI_SERVER: ${{ "{{" }} vars.PYPI_SERVER {{ "}}" }} - steps: - - uses: actions/checkout@v3 - - name: Download Source & Wheel distributions - uses: actions/download-artifact@v3 - with: - path: downloaded-artifacts - - name: Get Publishable files from the Artifacts - run: | - TAG="${GITHUB_REF_NAME}" - SEM_VER="${TAG:1}" # remove the first character (v) - PARSER="./scripts/parse_version.py" - PACKAGE_VERSION=$(python "${PARSER}") - if [[ "${PACKAGE_VERSION}" != "${SEM_VER}" ]]; then - echo "ERROR: Sem Ver, from Python Code (${PACKAGE_VERSION}), does not match tag version (${SEM_VER})" - exit 1 - fi - - run: mkdir ${DIST_DIR} - - run: | - # Get Source Distribution (tar.gz of source code) - source_distributions=$(find downloaded-artifacts -type f -name {{ cookiecutter.pkg_name }}*.tar.gz) - source_distributions_array=($source_distributions) - source_distribution=${source_distributions_array[0]} # a *.tar.gz file path - # Extract the base name (without the path) - source_distribution_name=$(basename "$source_distribution") - # Check if all source distribution (.tar.gz) files have the same name - for file in "${source_distributions_array[@]}"; do - if [ "$source_distribution_name" != "$(basename "$file")" ]; then - echo "Error: Not all Source Distribution .tar.gz files have the same name!" - exit 1 - fi - done - echo "source_distribution=$source_distribution" >> $GITHUB_ENV - - run: cp "$source_distribution" ${DIST_DIR} - - run: | - # Get all built Wheels and copy to dist folder - for f in `find downloaded-artifacts -type f -name {{ cookiecutter.pkg_name }}*.whl`; do - echo "F: $f"; - # TODO check for duplicates, which means that our build matrix produces the same wheel (need a different compiler that python such as pypy, cython, etc) - cp $f ${DIST_DIR} - done - - name: Install Dependencies - run: pip install tox==3.28 - - run: echo "Publishing $PACKAGE_DIST_VERSION to $PYPI_SERVER PyPI" - - name: Publish to PyPI - run: tox -vv -s false -e deploy -- upload --non-interactive --skip-existing - - run: echo "Published :\)" - + needs: [set_github_outputs, test_suite, check_which_git_branch_we_are_on] + uses: boromir674/automated-workflows/.github/workflows/pypi_env.yml@8e97f596067fcbbaa0a6927ec1ee47dce4ab5f1a + with: + should_trigger: ${{ "{{" }} needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' && needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' {{ "}}" }} + distro_name: cookiecutter_python + distro_version: ${{ "{{" }} needs.test_suite.outputs.PEP_VERSION {{ "}}" }} + pypi_env: '${{ "{{" }} needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME {{ "}}" }}' + artifacts_path: downloaded-artifacts + + require_wheel: true + allow_existing: true + secrets: + TWINE_PASSWORD: ${{ "{{" }} secrets.TWINE_PASSWORD }} ### STATIC CODE ANALYSIS & LINTING ### lint: name: Static Code Analysis @@ -400,10 +358,23 @@ jobs: code_visualization: needs: set_github_outputs name: Code Visualization of Python Imports as Graphs, in .svg - uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@8a441fa8fa008f1902ba892f8e8332fc77284597 + uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@v1.3.0 with: run_policy: '${{ "{{" }} needs.set_github_outputs.outputs.PIPE_CODE_VIZ_POLICY {{ "}}" }}' branches: 'main, master, dev' source_code_targets: 'src' python_version: '3.10' artifacts_dir: 'dependency-graphs' + +### Make a Github Release ### + gh_release: + needs: [test_suite, check_which_git_branch_we_are_on] + if: ${{ "{{" }} needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' {{ "}}" }} + uses: boromir674/automated-workflows/.github/workflows/gh-release.yml@test + name: 'GH Release' + with: + tag: ${{ "{{" }} github.ref_name {{ "}}" }} + draft: ${{ "{{" }} needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME == 'TEST_DEPLOYMENT' {{ "}}" }} + secrets: + # passing the GH_TOKEN PAT, to render in GH as ie: 'boromir674 released this yesterday', instead of 'github-actions released this yesterday' + gh_token: ${{ "{{" }} secrets.GH_TOKEN {{ "}}" }} From 5dde939c40b00b4e95598503688bfee00d96e876 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:45:00 +0200 Subject: [PATCH 06/17] test: update Gold Standard Snapshot CI / CD Pipeline in Workflow test.yaml --- .../.github/workflows/test.yaml | 129 +++++++----------- 1 file changed, 51 insertions(+), 78 deletions(-) diff --git a/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/test.yaml b/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/test.yaml index bab92dc0..b0723637 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/test.yaml +++ b/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/test.yaml @@ -33,7 +33,7 @@ env: UBUNTU_PY310_STRATEGY: "{\"platform\":[\"ubuntu-latest\"], \"python-version\":[\"3.10\"]}" TEST_STRATEGY: "{\"platform\":[\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\":[\"3.9\"]}" - ##### JOB ON/OFF SWITCHES ##### + ##### JOB ON/OFF SWITCHES - Top/1st level overrides ##### RUN_UNIT_TESTS: "true" RUN_LINT_CHECKS: "true" DOCKER_JOB_ON: "true" @@ -241,7 +241,7 @@ jobs: runs-on: ubuntu-latest needs: test_suite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Get Codecov binary run: | curl -Os https://uploader.codecov.io/latest/linux/codecov @@ -260,7 +260,7 @@ jobs: done ## DOCKER BUILD and PUBLISH ON DOCKERHUB ## -# Docs Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ +# Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/ docker_build: needs: [set_github_outputs, test_suite] uses: boromir674/automated-workflows/.github/workflows/docker.yml@v1.1.0 @@ -275,31 +275,32 @@ jobs: secrets: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} -# PUBLISH DISTRIBUTIONS ON PYPI -# we consider publishing on tags starting with "v" + ## JOB: Signal for Automated PyPI Upload ## check_which_git_branch_we_are_on: runs-on: ubuntu-latest - needs: set_github_outputs - if: startsWith(github.event.ref, 'refs/tags/v') && needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' - outputs: - ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} - AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + if: ${{ startsWith(github.event.ref, 'refs/tags/v') }} + env: + RELEASE_BR: ${{ vars.RELEASE_BRANCH || 'release' }} + MAIN_BR: ${{ vars.MAIN_BRANCH || 'main' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: rickstaa/action-contains-tag@v1 + - run: git branch --track "${{ env.RELEASE_BR }}" "origin/${{ env.RELEASE_BR }}" + + - name: "Check if '${{ github.ref }}' tag is on '${{ env.MAIN_BR }}' branch" + uses: rickstaa/action-contains-tag@v1 id: main_contains_tag with: - reference: "master" - tag: ${{ github.ref }} - - run: echo "ON_MAIN_BRANCH=${{ steps.main_contains_tag.outputs.retval }}" >> $GITHUB_OUTPUT - - uses: rickstaa/action-contains-tag@v1 + reference: ${{ env.MAIN_BR }} + tag: "${{ github.ref }}" + - name: "Check if '${{ github.ref }}' tag is on '${{ env.RELEASE_BR }}' branch" + uses: rickstaa/action-contains-tag@v1 id: release_contains_tag with: - reference: "release" - tag: ${{ github.ref }} - - run: echo "ON_RELEASE_BRANCH=${{ steps.release_contains_tag.outputs.retval }}" >> $GITHUB_OUTPUT + reference: ${{ env.RELEASE_BR }} + tag: "${{ github.ref }}" + - name: Pick Production or Test Environment, if tag on master or release branch respectively id: set_environment_name run: | @@ -313,66 +314,25 @@ jobs: DEPLOY=false fi echo "AUTOMATED_DEPLOY=$DEPLOY" >> $GITHUB_OUTPUT + outputs: + ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} + AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + ## JOB: PYPI UPLOAD ## pypi_publish: - needs: [test_suite, check_which_git_branch_we_are_on] - runs-on: ubuntu-latest - # if we are on tag starting with "v" and if we are on master or dev branch - if: startsWith(github.event.ref, 'refs/tags/v') && ${{ needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} - environment: - name: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }} - env: - DIST_DIR: dist - PACKAGE_DIST_VERSION: ${{ needs.test_suite.outputs.PEP_VERSION }} - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + needs: [set_github_outputs, test_suite, check_which_git_branch_we_are_on] + uses: boromir674/automated-workflows/.github/workflows/pypi_env.yml@8e97f596067fcbbaa0a6927ec1ee47dce4ab5f1a + with: + should_trigger: ${{ needs.set_github_outputs.outputs.PUBLISH_ON_PYPI == 'true' && needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} + distro_name: cookiecutter_python + distro_version: ${{ needs.test_suite.outputs.PEP_VERSION }} + pypi_env: '${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }}' + artifacts_path: downloaded-artifacts + + require_wheel: true + allow_existing: true + secrets: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - PYPI_SERVER: ${{ vars.PYPI_SERVER }} - steps: - - uses: actions/checkout@v3 - - name: Download Source & Wheel distributions - uses: actions/download-artifact@v3 - with: - path: downloaded-artifacts - - name: Get Publishable files from the Artifacts - run: | - TAG="${GITHUB_REF_NAME}" - SEM_VER="${TAG:1}" # remove the first character (v) - PARSER="./scripts/parse_version.py" - PACKAGE_VERSION=$(python "${PARSER}") - if [[ "${PACKAGE_VERSION}" != "${SEM_VER}" ]]; then - echo "ERROR: Sem Ver, from Python Code (${PACKAGE_VERSION}), does not match tag version (${SEM_VER})" - exit 1 - fi - - run: mkdir ${DIST_DIR} - - run: | - # Get Source Distribution (tar.gz of source code) - source_distributions=$(find downloaded-artifacts -type f -name biskotakigold*.tar.gz) - source_distributions_array=($source_distributions) - source_distribution=${source_distributions_array[0]} # a *.tar.gz file path - # Extract the base name (without the path) - source_distribution_name=$(basename "$source_distribution") - # Check if all source distribution (.tar.gz) files have the same name - for file in "${source_distributions_array[@]}"; do - if [ "$source_distribution_name" != "$(basename "$file")" ]; then - echo "Error: Not all Source Distribution .tar.gz files have the same name!" - exit 1 - fi - done - echo "source_distribution=$source_distribution" >> $GITHUB_ENV - - run: cp "$source_distribution" ${DIST_DIR} - - run: | - # Get all built Wheels and copy to dist folder - for f in `find downloaded-artifacts -type f -name biskotakigold*.whl`; do - echo "F: $f"; - # TODO check for duplicates, which means that our build matrix produces the same wheel (need a different compiler that python such as pypy, cython, etc) - cp $f ${DIST_DIR} - done - - name: Install Dependencies - run: pip install tox==3.28 - - run: echo "Publishing $PACKAGE_DIST_VERSION to $PYPI_SERVER PyPI" - - name: Publish to PyPI - run: tox -vv -s false -e deploy -- upload --non-interactive --skip-existing - - run: echo "Published :\)" ### STATIC CODE ANALYSIS & LINTING ### lint: @@ -392,7 +352,7 @@ jobs: needs: set_github_outputs uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.3.0 with: - run_policy: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }} + run_policy: '${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }}' python_version: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_PY }} command: 'tox -s false -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false' @@ -400,10 +360,23 @@ jobs: code_visualization: needs: set_github_outputs name: Code Visualization of Python Imports as Graphs, in .svg - uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@8a441fa8fa008f1902ba892f8e8332fc77284597 + uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@v1.3.0 with: run_policy: '${{ needs.set_github_outputs.outputs.PIPE_CODE_VIZ_POLICY }}' branches: 'main, master, dev' source_code_targets: 'src' python_version: '3.10' artifacts_dir: 'dependency-graphs' + +### Make a Github Release ### + gh_release: + needs: [test_suite, check_which_git_branch_we_are_on] + if: ${{ needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY == 'true' }} + uses: boromir674/automated-workflows/.github/workflows/gh-release.yml@test + name: 'GH Release' + with: + tag: ${{ github.ref_name }} + draft: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME == 'TEST_DEPLOYMENT' }} + secrets: + # passing the GH_TOKEN PAT, to render in GH as ie: 'boromir674 released this yesterday', instead of 'github-actions released this yesterday' + gh_token: ${{ secrets.GH_TOKEN }} From 989a808f095d2190c338adfe9af3307dc80b702a Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:54:40 +0200 Subject: [PATCH 07/17] make Template produce Gold Standard Snapshot --- .../.github/workflows/test.yaml | 6 ++++-- tests/test_gold_standard.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml index 3e439728..4075b84c 100644 --- a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml +++ b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml @@ -33,7 +33,7 @@ env: UBUNTU_PY310_STRATEGY: "{\"platform\":[\"ubuntu-latest\"], \"python-version\":[\"3.10\"]}" TEST_STRATEGY: "{\"platform\":[\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\":[\"3.9\"]}" - ##### JOB ON/OFF SWITCHES ##### + ##### JOB ON/OFF SWITCHES - Top/1st level overrides ##### RUN_UNIT_TESTS: "true" RUN_LINT_CHECKS: "true" DOCKER_JOB_ON: "true" @@ -317,6 +317,7 @@ jobs: outputs: ENVIRONMENT_NAME: ${{ "{{" }} steps.set_environment_name.outputs.ENVIRONMENT_NAME {{ "}}" }} AUTOMATED_DEPLOY: ${{ "{{" }} steps.set_environment_name.outputs.AUTOMATED_DEPLOY {{ "}}" }} + ## JOB: PYPI UPLOAD ## pypi_publish: needs: [set_github_outputs, test_suite, check_which_git_branch_we_are_on] @@ -332,6 +333,7 @@ jobs: allow_existing: true secrets: TWINE_PASSWORD: ${{ "{{" }} secrets.TWINE_PASSWORD }} + ### STATIC CODE ANALYSIS & LINTING ### lint: name: Static Code Analysis @@ -350,7 +352,7 @@ jobs: needs: set_github_outputs uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.3.0 with: - run_policy: ${{ "{{" }} needs.set_github_outputs.outputs.PIPE_DOCS_POLICY {{ "}}" }} + run_policy: '${{ "{{" }} needs.set_github_outputs.outputs.PIPE_DOCS_POLICY {{ "}}" }}' python_version: ${{ "{{" }} needs.set_github_outputs.outputs.PIPE_DOCS_PY {{ "}}" }} command: 'tox -s false -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false' diff --git a/tests/test_gold_standard.py b/tests/test_gold_standard.py index e9d41b47..92f8dbf3 100644 --- a/tests/test_gold_standard.py +++ b/tests/test_gold_standard.py @@ -176,6 +176,7 @@ def test_gs_matches_runtime(gen_gs_project, test_root): if not running_on_ci: # just exclude pre-emptively '.vscode/' folder, and '.vscode/settings.json' file # also exclude .tox/ folder, and .tox/ folder contents + # also exlude reqs.txt, in case developer ran command `tox -e pin-deps` snap_relative_paths_set = set( [ x @@ -187,6 +188,8 @@ def test_gs_matches_runtime(gen_gs_project, test_root): and '.tox' not in x.parts # EXCLUDE .pytest_cache/ folder if x.parts[0] != '.pytest_cache' + # EXCLUDE reqs.txt file + and x.name != 'reqs.txt' ] ) From 3391506f1afb7cdc75037709605c7a9db92a9b25 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:55:03 +0200 Subject: [PATCH 08/17] tests(data): update biskotaki-no-input Snapshot, used in Regression Testing --- .../biskotaki-no-input/.github/workflows/test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml b/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml index 21b0bf3f..98b8be27 100644 --- a/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml +++ b/tests/data/snapshots/biskotaki-no-input/.github/workflows/test.yaml @@ -33,7 +33,7 @@ env: UBUNTU_PY310_STRATEGY: "{\"platform\":[\"ubuntu-latest\"], \"python-version\":[\"3.10\"]}" TEST_STRATEGY: "{\"platform\":[\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\":[\"3.9\"]}" - ##### JOB ON/OFF SWITCHES ##### + ##### JOB ON/OFF SWITCHES - Top/1st level overrides ##### RUN_UNIT_TESTS: "true" RUN_LINT_CHECKS: "true" DOCKER_JOB_ON: "true" @@ -317,6 +317,7 @@ jobs: outputs: ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + ## JOB: PYPI UPLOAD ## pypi_publish: needs: [set_github_outputs, test_suite, check_which_git_branch_we_are_on] @@ -332,6 +333,7 @@ jobs: allow_existing: true secrets: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + ### STATIC CODE ANALYSIS & LINTING ### lint: name: Static Code Analysis @@ -350,7 +352,7 @@ jobs: needs: set_github_outputs uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.3.0 with: - run_policy: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }} + run_policy: '${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }}' python_version: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_PY }} command: 'tox -s false -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false' From fab2cc31557b26e7b1f93eff6bb00f91d5c3d3e9 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:55:37 +0200 Subject: [PATCH 09/17] tests(data): update biskotaki-interactive Snapshot, used in Regression Testing --- .../biskotaki-interactive/.github/workflows/test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml b/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml index 21b0bf3f..98b8be27 100644 --- a/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml +++ b/tests/data/snapshots/biskotaki-interactive/.github/workflows/test.yaml @@ -33,7 +33,7 @@ env: UBUNTU_PY310_STRATEGY: "{\"platform\":[\"ubuntu-latest\"], \"python-version\":[\"3.10\"]}" TEST_STRATEGY: "{\"platform\":[\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\":[\"3.9\"]}" - ##### JOB ON/OFF SWITCHES ##### + ##### JOB ON/OFF SWITCHES - Top/1st level overrides ##### RUN_UNIT_TESTS: "true" RUN_LINT_CHECKS: "true" DOCKER_JOB_ON: "true" @@ -317,6 +317,7 @@ jobs: outputs: ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }} AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }} + ## JOB: PYPI UPLOAD ## pypi_publish: needs: [set_github_outputs, test_suite, check_which_git_branch_we_are_on] @@ -332,6 +333,7 @@ jobs: allow_existing: true secrets: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + ### STATIC CODE ANALYSIS & LINTING ### lint: name: Static Code Analysis @@ -350,7 +352,7 @@ jobs: needs: set_github_outputs uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.3.0 with: - run_policy: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }} + run_policy: '${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }}' python_version: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_PY }} command: 'tox -s false -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false' From a18d4a90b0ab8414de2cc4b659d47093a2dbe3da Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 20:56:40 +0200 Subject: [PATCH 10/17] refactor(black): apply black --- src/cookiecutter_python/backend/helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cookiecutter_python/backend/helpers.py b/src/cookiecutter_python/backend/helpers.py index 8f8f83d3..8c818c78 100644 --- a/src/cookiecutter_python/backend/helpers.py +++ b/src/cookiecutter_python/backend/helpers.py @@ -55,7 +55,9 @@ def parse_context(config_file: str): user_context = data['default_context'] _interpreters: t.Mapping[str, t.List[str]] = user_context.get('interpreters', '{}') if isinstance(_interpreters, str): - logger.warning("Interpreters expected to be loaded in a python dict already. Got a string instead.") + logger.warning( + "Interpreters expected to be loaded in a python dict already. Got a string instead." + ) logger.info("Converting interpreters %s to a python dict", _interpreters) _interpreters = json.loads(_interpreters) c = _interpreters From 6d93898ceb4b2495f1921b498302685b603cb1bc Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 21:10:23 +0200 Subject: [PATCH 11/17] feat: cover most source code areas, wehn PR labeling: src, tests, ci, data, config --- .../.github/labeler.yml | 134 ++++++++++++++++-- .../.github/workflows/labeler.yaml | 12 +- 2 files changed, 132 insertions(+), 14 deletions(-) diff --git a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/labeler.yml b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/labeler.yml index 53a24c27..ecc255bd 100644 --- a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/labeler.yml +++ b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/labeler.yml @@ -1,20 +1,134 @@ # Pull Request Labeling Rules based on changed files +# https://github.com/actions/labeler -# Add 'ci' label to any change within the '.github' dir -ci: -- any: ['.github/*', '.github/**/*'] + +####### LABELS based on FILE CHANGES ####### + +# Here, we declare Rules for Labeling PR based on the file changes + +# Each Label is added, when their Rule(s) are True +# - 'any' block is True, if any of the conditions are True +# - 'all' block is True, if all of the conditions are True + +# Typically a Label, only features one of 'any' or 'all' block + +# Each label declares Rules that are mutually exclusive, in boolean logic. +# Thus, the set of matching file paths are non-overlapping, across the labels. -# Add 'business_logic' label to any change within the 'src/{{ cookiecutter.pkg_name }}' dir +### SRC ### +# Add 'business_logic' label to any change within the 'src/cookiecutter_python' dir business_logic: -- any: ['src/{{ cookiecutter.pkg_name }}/*', 'src/{{ cookiecutter.pkg_name }}/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'src/{{ cookiecutter.pkg_name }}/*' + - 'src/{{ cookiecutter.pkg_name }}/*' +stubs: + - any: + - changed-files: + - any-glob-to-any-file: ['src/stubs/*', 'src/stubs/**/*'] -# Add 'docs' label to any change within the 'docs' dir +### TESTS ### +## Add 'test' label to any change within the 'tests' dir # +test: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tests/*' + - 'tests/**/*' + + # exclude any changes within the 'tests/data/' dir + - all: + - changed-files: + - all-globs-to-all-files: + - '!tests/data/*' + - '!tests/data/**/*' + +test_data: + - any: + - changed-files: + - any-glob-to-any-file: ['tests/data/*', 'tests/data/**/*'] + +### DOCS ### +# Any change within the 'docs' dir, or the '.readthedocs.yml' file docs: -- any: ['docs/*', 'docs/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'docs/*' + - 'docs/**/*' + - '.readthedocs.yml' + - 'README.rst' + - 'README.md' +### SCRIPTS ### +scripts: + - any: + - changed-files: + - any-glob-to-any-file: + - 'scripts/**' -# Add 'test' label to any change within the 'tests' dir -test: -- any: ['tests/*', 'tests/**/*'] +### CI ### +# Add 'ci' label to any change within the '.github' dir +ci: + - any: + - changed-files: + - any-glob-to-any-file: ['.github/*', '.github/**/*'] + +### DOCKER ### +docker: + - any: + - changed-files: + - any-glob-to-any-file: + - 'Dockerfile' + - 'docker-compose.yml' + - 'docker-compose.*.yml' + - '.dockerignore' + +### POETRY ### +poetry: + - any: + - changed-files: + - any-glob-to-any-file: + - 'pyproject.toml' + - 'poetry.lock' + +### TOX ### +tox: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tox.ini' + +config: + - any: + - changed-files: + - any-glob-to-any-file: + - '.bettercodehub.yml' + - '.coveragerc' + - '.gitignore' + - '.prospector.yml' + - '.pylintrc' + + +####### LABELS based on BRANCH NAME ####### + +## Pull Request Labeling Rules based Base Branch + +# Add 'release' label to any PR that is opened against the `main` branch +release: + - base-branch: 'main' + +# Add 'boarding_auto' label to any PR that is opened against the `boarding-auto` branch +# [GITOPS]: This should act as a signal, ie for a Listener Workflow to Merge the PR +boarding_auto: + - base-branch: ['^boarding-auto', 'boarding-auto'] + - base-branch: ['^board-n-release', 'board-n-release'] + + +# Add 'feature' label to any PR where the head branch name starts with +# `feature` or has a `feature` section in the name +feature: + - head-branch: ['^feature', 'feature'] diff --git a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/labeler.yaml b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/labeler.yaml index f2961b31..e7e15217 100644 --- a/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/labeler.yaml +++ b/src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/labeler.yaml @@ -3,12 +3,16 @@ on: - pull_request_target jobs: - triage: + label_PR: permissions: contents: read pull-requests: write runs-on: ubuntu-latest + # This Job behaves as a Listener to PR events, and each step is a Handler steps: - - uses: actions/labeler@v4 - with: - repo-token: ${{ "{{" }} secrets.GITHUB_TOKEN {{ "}}" }} + # HANDLER 1: Label PR, given file changes and Labeling Rules '.github/labeler.yml' + - uses: actions/labeler@v5 + with: + # if you want your labels to trigger other Workflows, pass-in a PAT + # with permission for label creation events to trigger listeners + repo-token: ${{ "{{" }} secrets.GITHUB_TOKEN {{ "}}" }} From ece0c5ca9fdc0fb8495de939e58d59a0d50ac4d5 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 21:11:00 +0200 Subject: [PATCH 12/17] tests(data): update biskotaki-no-input Snapshot, used in Regression Testing --- .../biskotaki-no-input/.github/labeler.yml | 134 ++++++++++++++++-- .../.github/workflows/labeler.yaml | 12 +- 2 files changed, 132 insertions(+), 14 deletions(-) diff --git a/tests/data/snapshots/biskotaki-no-input/.github/labeler.yml b/tests/data/snapshots/biskotaki-no-input/.github/labeler.yml index 31c01408..e9a99eb4 100644 --- a/tests/data/snapshots/biskotaki-no-input/.github/labeler.yml +++ b/tests/data/snapshots/biskotaki-no-input/.github/labeler.yml @@ -1,20 +1,134 @@ # Pull Request Labeling Rules based on changed files +# https://github.com/actions/labeler -# Add 'ci' label to any change within the '.github' dir -ci: -- any: ['.github/*', '.github/**/*'] + +####### LABELS based on FILE CHANGES ####### + +# Here, we declare Rules for Labeling PR based on the file changes + +# Each Label is added, when their Rule(s) are True +# - 'any' block is True, if any of the conditions are True +# - 'all' block is True, if all of the conditions are True + +# Typically a Label, only features one of 'any' or 'all' block + +# Each label declares Rules that are mutually exclusive, in boolean logic. +# Thus, the set of matching file paths are non-overlapping, across the labels. -# Add 'business_logic' label to any change within the 'src/biskotaki' dir +### SRC ### +# Add 'business_logic' label to any change within the 'src/cookiecutter_python' dir business_logic: -- any: ['src/biskotaki/*', 'src/biskotaki/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'src/biskotaki/*' + - 'src/biskotaki/*' +stubs: + - any: + - changed-files: + - any-glob-to-any-file: ['src/stubs/*', 'src/stubs/**/*'] -# Add 'docs' label to any change within the 'docs' dir +### TESTS ### +## Add 'test' label to any change within the 'tests' dir # +test: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tests/*' + - 'tests/**/*' + + # exclude any changes within the 'tests/data/' dir + - all: + - changed-files: + - all-globs-to-all-files: + - '!tests/data/*' + - '!tests/data/**/*' + +test_data: + - any: + - changed-files: + - any-glob-to-any-file: ['tests/data/*', 'tests/data/**/*'] + +### DOCS ### +# Any change within the 'docs' dir, or the '.readthedocs.yml' file docs: -- any: ['docs/*', 'docs/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'docs/*' + - 'docs/**/*' + - '.readthedocs.yml' + - 'README.rst' + - 'README.md' +### SCRIPTS ### +scripts: + - any: + - changed-files: + - any-glob-to-any-file: + - 'scripts/**' -# Add 'test' label to any change within the 'tests' dir -test: -- any: ['tests/*', 'tests/**/*'] +### CI ### +# Add 'ci' label to any change within the '.github' dir +ci: + - any: + - changed-files: + - any-glob-to-any-file: ['.github/*', '.github/**/*'] + +### DOCKER ### +docker: + - any: + - changed-files: + - any-glob-to-any-file: + - 'Dockerfile' + - 'docker-compose.yml' + - 'docker-compose.*.yml' + - '.dockerignore' + +### POETRY ### +poetry: + - any: + - changed-files: + - any-glob-to-any-file: + - 'pyproject.toml' + - 'poetry.lock' + +### TOX ### +tox: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tox.ini' + +config: + - any: + - changed-files: + - any-glob-to-any-file: + - '.bettercodehub.yml' + - '.coveragerc' + - '.gitignore' + - '.prospector.yml' + - '.pylintrc' + + +####### LABELS based on BRANCH NAME ####### + +## Pull Request Labeling Rules based Base Branch + +# Add 'release' label to any PR that is opened against the `main` branch +release: + - base-branch: 'main' + +# Add 'boarding_auto' label to any PR that is opened against the `boarding-auto` branch +# [GITOPS]: This should act as a signal, ie for a Listener Workflow to Merge the PR +boarding_auto: + - base-branch: ['^boarding-auto', 'boarding-auto'] + - base-branch: ['^board-n-release', 'board-n-release'] + + +# Add 'feature' label to any PR where the head branch name starts with +# `feature` or has a `feature` section in the name +feature: + - head-branch: ['^feature', 'feature'] diff --git a/tests/data/snapshots/biskotaki-no-input/.github/workflows/labeler.yaml b/tests/data/snapshots/biskotaki-no-input/.github/workflows/labeler.yaml index d66758a4..2b7c4909 100644 --- a/tests/data/snapshots/biskotaki-no-input/.github/workflows/labeler.yaml +++ b/tests/data/snapshots/biskotaki-no-input/.github/workflows/labeler.yaml @@ -3,12 +3,16 @@ on: - pull_request_target jobs: - triage: + label_PR: permissions: contents: read pull-requests: write runs-on: ubuntu-latest + # This Job behaves as a Listener to PR events, and each step is a Handler steps: - - uses: actions/labeler@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + # HANDLER 1: Label PR, given file changes and Labeling Rules '.github/labeler.yml' + - uses: actions/labeler@v5 + with: + # if you want your labels to trigger other Workflows, pass-in a PAT + # with permission for label creation events to trigger listeners + repo-token: ${{ secrets.GITHUB_TOKEN }} From a23217bf67fcab42e1927796fbfba4b57b2b1b6f Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 21:13:01 +0200 Subject: [PATCH 13/17] tests(data): update biskotaki-interactive Snapshot, used in Regression Testing --- .../biskotaki-interactive/.github/labeler.yml | 134 ++++++++++++++++-- .../.github/workflows/labeler.yaml | 12 +- 2 files changed, 132 insertions(+), 14 deletions(-) diff --git a/tests/data/snapshots/biskotaki-interactive/.github/labeler.yml b/tests/data/snapshots/biskotaki-interactive/.github/labeler.yml index 31c01408..e9a99eb4 100644 --- a/tests/data/snapshots/biskotaki-interactive/.github/labeler.yml +++ b/tests/data/snapshots/biskotaki-interactive/.github/labeler.yml @@ -1,20 +1,134 @@ # Pull Request Labeling Rules based on changed files +# https://github.com/actions/labeler -# Add 'ci' label to any change within the '.github' dir -ci: -- any: ['.github/*', '.github/**/*'] + +####### LABELS based on FILE CHANGES ####### + +# Here, we declare Rules for Labeling PR based on the file changes + +# Each Label is added, when their Rule(s) are True +# - 'any' block is True, if any of the conditions are True +# - 'all' block is True, if all of the conditions are True + +# Typically a Label, only features one of 'any' or 'all' block + +# Each label declares Rules that are mutually exclusive, in boolean logic. +# Thus, the set of matching file paths are non-overlapping, across the labels. -# Add 'business_logic' label to any change within the 'src/biskotaki' dir +### SRC ### +# Add 'business_logic' label to any change within the 'src/cookiecutter_python' dir business_logic: -- any: ['src/biskotaki/*', 'src/biskotaki/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'src/biskotaki/*' + - 'src/biskotaki/*' +stubs: + - any: + - changed-files: + - any-glob-to-any-file: ['src/stubs/*', 'src/stubs/**/*'] -# Add 'docs' label to any change within the 'docs' dir +### TESTS ### +## Add 'test' label to any change within the 'tests' dir # +test: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tests/*' + - 'tests/**/*' + + # exclude any changes within the 'tests/data/' dir + - all: + - changed-files: + - all-globs-to-all-files: + - '!tests/data/*' + - '!tests/data/**/*' + +test_data: + - any: + - changed-files: + - any-glob-to-any-file: ['tests/data/*', 'tests/data/**/*'] + +### DOCS ### +# Any change within the 'docs' dir, or the '.readthedocs.yml' file docs: -- any: ['docs/*', 'docs/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'docs/*' + - 'docs/**/*' + - '.readthedocs.yml' + - 'README.rst' + - 'README.md' +### SCRIPTS ### +scripts: + - any: + - changed-files: + - any-glob-to-any-file: + - 'scripts/**' -# Add 'test' label to any change within the 'tests' dir -test: -- any: ['tests/*', 'tests/**/*'] +### CI ### +# Add 'ci' label to any change within the '.github' dir +ci: + - any: + - changed-files: + - any-glob-to-any-file: ['.github/*', '.github/**/*'] + +### DOCKER ### +docker: + - any: + - changed-files: + - any-glob-to-any-file: + - 'Dockerfile' + - 'docker-compose.yml' + - 'docker-compose.*.yml' + - '.dockerignore' + +### POETRY ### +poetry: + - any: + - changed-files: + - any-glob-to-any-file: + - 'pyproject.toml' + - 'poetry.lock' + +### TOX ### +tox: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tox.ini' + +config: + - any: + - changed-files: + - any-glob-to-any-file: + - '.bettercodehub.yml' + - '.coveragerc' + - '.gitignore' + - '.prospector.yml' + - '.pylintrc' + + +####### LABELS based on BRANCH NAME ####### + +## Pull Request Labeling Rules based Base Branch + +# Add 'release' label to any PR that is opened against the `main` branch +release: + - base-branch: 'main' + +# Add 'boarding_auto' label to any PR that is opened against the `boarding-auto` branch +# [GITOPS]: This should act as a signal, ie for a Listener Workflow to Merge the PR +boarding_auto: + - base-branch: ['^boarding-auto', 'boarding-auto'] + - base-branch: ['^board-n-release', 'board-n-release'] + + +# Add 'feature' label to any PR where the head branch name starts with +# `feature` or has a `feature` section in the name +feature: + - head-branch: ['^feature', 'feature'] diff --git a/tests/data/snapshots/biskotaki-interactive/.github/workflows/labeler.yaml b/tests/data/snapshots/biskotaki-interactive/.github/workflows/labeler.yaml index d66758a4..2b7c4909 100644 --- a/tests/data/snapshots/biskotaki-interactive/.github/workflows/labeler.yaml +++ b/tests/data/snapshots/biskotaki-interactive/.github/workflows/labeler.yaml @@ -3,12 +3,16 @@ on: - pull_request_target jobs: - triage: + label_PR: permissions: contents: read pull-requests: write runs-on: ubuntu-latest + # This Job behaves as a Listener to PR events, and each step is a Handler steps: - - uses: actions/labeler@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + # HANDLER 1: Label PR, given file changes and Labeling Rules '.github/labeler.yml' + - uses: actions/labeler@v5 + with: + # if you want your labels to trigger other Workflows, pass-in a PAT + # with permission for label creation events to trigger listeners + repo-token: ${{ secrets.GITHUB_TOKEN }} From 860b929c28ad2236d3859f3e125d0eaf566e0dc6 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 21:15:39 +0200 Subject: [PATCH 14/17] test: update Gold Standard Snapshot --- .../.github/labeler.yml | 134 +++++++++++- .../.github/workflows/labeler.yaml | 12 +- .../biskotaki-gold-standard/CHANGELOG.rst | 2 +- .../scripts/gen_api_refs_pages.py | 206 +++++++++--------- 4 files changed, 236 insertions(+), 118 deletions(-) diff --git a/tests/data/snapshots/biskotaki-gold-standard/.github/labeler.yml b/tests/data/snapshots/biskotaki-gold-standard/.github/labeler.yml index 9586abdf..746c392d 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/.github/labeler.yml +++ b/tests/data/snapshots/biskotaki-gold-standard/.github/labeler.yml @@ -1,20 +1,134 @@ # Pull Request Labeling Rules based on changed files +# https://github.com/actions/labeler -# Add 'ci' label to any change within the '.github' dir -ci: -- any: ['.github/*', '.github/**/*'] + +####### LABELS based on FILE CHANGES ####### + +# Here, we declare Rules for Labeling PR based on the file changes + +# Each Label is added, when their Rule(s) are True +# - 'any' block is True, if any of the conditions are True +# - 'all' block is True, if all of the conditions are True + +# Typically a Label, only features one of 'any' or 'all' block + +# Each label declares Rules that are mutually exclusive, in boolean logic. +# Thus, the set of matching file paths are non-overlapping, across the labels. -# Add 'business_logic' label to any change within the 'src/biskotakigold' dir +### SRC ### +# Add 'business_logic' label to any change within the 'src/cookiecutter_python' dir business_logic: -- any: ['src/biskotakigold/*', 'src/biskotakigold/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'src/biskotakigold/*' + - 'src/biskotakigold/*' +stubs: + - any: + - changed-files: + - any-glob-to-any-file: ['src/stubs/*', 'src/stubs/**/*'] -# Add 'docs' label to any change within the 'docs' dir +### TESTS ### +## Add 'test' label to any change within the 'tests' dir # +test: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tests/*' + - 'tests/**/*' + + # exclude any changes within the 'tests/data/' dir + - all: + - changed-files: + - all-globs-to-all-files: + - '!tests/data/*' + - '!tests/data/**/*' + +test_data: + - any: + - changed-files: + - any-glob-to-any-file: ['tests/data/*', 'tests/data/**/*'] + +### DOCS ### +# Any change within the 'docs' dir, or the '.readthedocs.yml' file docs: -- any: ['docs/*', 'docs/**/*'] + - any: + - changed-files: + - any-glob-to-any-file: + - 'docs/*' + - 'docs/**/*' + - '.readthedocs.yml' + - 'README.rst' + - 'README.md' +### SCRIPTS ### +scripts: + - any: + - changed-files: + - any-glob-to-any-file: + - 'scripts/**' -# Add 'test' label to any change within the 'tests' dir -test: -- any: ['tests/*', 'tests/**/*'] +### CI ### +# Add 'ci' label to any change within the '.github' dir +ci: + - any: + - changed-files: + - any-glob-to-any-file: ['.github/*', '.github/**/*'] + +### DOCKER ### +docker: + - any: + - changed-files: + - any-glob-to-any-file: + - 'Dockerfile' + - 'docker-compose.yml' + - 'docker-compose.*.yml' + - '.dockerignore' + +### POETRY ### +poetry: + - any: + - changed-files: + - any-glob-to-any-file: + - 'pyproject.toml' + - 'poetry.lock' + +### TOX ### +tox: + - any: + - changed-files: + - any-glob-to-any-file: + - 'tox.ini' + +config: + - any: + - changed-files: + - any-glob-to-any-file: + - '.bettercodehub.yml' + - '.coveragerc' + - '.gitignore' + - '.prospector.yml' + - '.pylintrc' + + +####### LABELS based on BRANCH NAME ####### + +## Pull Request Labeling Rules based Base Branch + +# Add 'release' label to any PR that is opened against the `main` branch +release: + - base-branch: 'main' + +# Add 'boarding_auto' label to any PR that is opened against the `boarding-auto` branch +# [GITOPS]: This should act as a signal, ie for a Listener Workflow to Merge the PR +boarding_auto: + - base-branch: ['^boarding-auto', 'boarding-auto'] + - base-branch: ['^board-n-release', 'board-n-release'] + + +# Add 'feature' label to any PR where the head branch name starts with +# `feature` or has a `feature` section in the name +feature: + - head-branch: ['^feature', 'feature'] diff --git a/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/labeler.yaml b/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/labeler.yaml index d66758a4..2b7c4909 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/labeler.yaml +++ b/tests/data/snapshots/biskotaki-gold-standard/.github/workflows/labeler.yaml @@ -3,12 +3,16 @@ on: - pull_request_target jobs: - triage: + label_PR: permissions: contents: read pull-requests: write runs-on: ubuntu-latest + # This Job behaves as a Listener to PR events, and each step is a Handler steps: - - uses: actions/labeler@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + # HANDLER 1: Label PR, given file changes and Labeling Rules '.github/labeler.yml' + - uses: actions/labeler@v5 + with: + # if you want your labels to trigger other Workflows, pass-in a PAT + # with permission for label creation events to trigger listeners + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/data/snapshots/biskotaki-gold-standard/CHANGELOG.rst b/tests/data/snapshots/biskotaki-gold-standard/CHANGELOG.rst index 4b7f4531..6f441fde 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/CHANGELOG.rst +++ b/tests/data/snapshots/biskotaki-gold-standard/CHANGELOG.rst @@ -2,7 +2,7 @@ Changelog ========= -0.0.1 (2024-02-17) +0.0.1 (2024-03-13) ======================================= | This is the first ever release of the **biskotakigold** Python Package. diff --git a/tests/data/snapshots/biskotaki-gold-standard/scripts/gen_api_refs_pages.py b/tests/data/snapshots/biskotaki-gold-standard/scripts/gen_api_refs_pages.py index fa819d48..7fa559a9 100644 --- a/tests/data/snapshots/biskotaki-gold-standard/scripts/gen_api_refs_pages.py +++ b/tests/data/snapshots/biskotaki-gold-standard/scripts/gen_api_refs_pages.py @@ -1,103 +1,103 @@ -"""Generate the code reference pages.""" - -import typing as t -from pathlib import Path - -import mkdocs_gen_files - -# Initialize the navigation object -nav = mkdocs_gen_files.Nav() - -# Search inside 'src' dir for python 'packages' (dirs with __init__.py) -src = Path(__file__).parent.parent / "src" - -cli_module_path: t.Optional[Path] = None - - -# Loop, recursively, over all Python *.py Files, inside 'src' dir and subdirs -for path in sorted(src.rglob("*.py")): - ## 1. extract Relative path from Python File and remove suffix (.py) - # EG src/biskotaki/cli.py --> biskotaki/cli - _module_path = path.relative_to(src).with_suffix("") - ## 2. derive corresponding Docs File to write Directives into - # EG biskotaki/cli --> biskotaki/cli.md - doc_path = path.relative_to(src).with_suffix(".md") - ## 3. derive Full Path to Docs File - full_doc_path = Path("reference", doc_path) - - parts = list(_module_path.parts) - - # Skip __main__ Files - if parts[-1] == "__main__": - continue - - # For __init__ Files dedicate an index.md file, instead of __init__.md - if parts[-1] == "__init__": - parts = parts[:-1] - ## https://mkdocstrings.github.io/recipes/#bind-pages-to-sections-themselves - doc_path = doc_path.with_name("index.md") - # full_doc_path = full_doc_path.with_name("index.md") - - if parts[-1] == 'cli': - cli_module_path = _module_path - - ## Progressively build the navigation object, creating a mapping: - # Navigatiion Item --> Docs File Path, *.md, with content for mkdocs build - # Sequence[str] --> str - nav[parts] = doc_path.as_posix() - # nav[parts] = str(doc_path) # use this in case as_posix() fails on windows - - # Write Contents for Item, with some kind of directive - with mkdocs_gen_files.open(Path("reference", doc_path), "w") as fd: - identifier = ".".join(parts) - print("::: " + identifier, file=fd) - -# Dedicate a custom Page for Entrypoint CLI, apart from auto-generated -# Automatic discovery happens, if a top-level cli.py file is found. -if cli_module_path: - # we want to place CLI in top-level navigation - navigation_key: t.Sequence[str] = ["CLI"] - # arbitrary Docs file name, since we will inject its contents automatically - doc_path = Path("CLI.md") - - # Add to Navigation Item - nav[navigation_key] = doc_path.as_posix() - - # Top-Level CLI.md Docs Contents: mainly using the 'mkdocs-click' Directive - CLI_DOC_CONTENT = """ -# CLI Reference - -This page provides documentation for our command line tools. - -::: mkdocs-click - :module: biskotakigold.cli - :command: main -""" - # TODO: write better content for the CLI.md file - with mkdocs_gen_files.open(Path("reference", doc_path), "w") as fd: - fd.write(CLI_DOC_CONTENT) - - # ROOT - # -> docs - # -> scripts - # -> src/python_package - mkdocs_gen_files.set_edit_path(full_doc_path, Path("../") / path) - # so that it correctly sets the edit path of (for example) nst_math.py to - # /blob/master/src/artificial_artwork/nst_math.py instead of - # /blob/master/docs/src/artificial_artwork/nst_math.py - - # mkdocs_gen_files.set_edit_path(full_doc_path, path) - - -# At the end, create a magic, literate navigation file called SUMMARY.md in the -# reference folder. -with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: - # Write the navigation as a Markdown list in the literate navigation file - nav_file.writelines(nav.build_literate_nav()) - -# Now we are able to remove our hard-coded navigation in mkdocs.yml, -# and replace it with a single line! - -# IE: - Code Reference: reference/ -# Note the trailing slash! It is needed so that mkdocs-literate-nav knows it has -# to look for a SUMMARY.md file in that folder +"""Generate the code reference pages.""" + +import typing as t +from pathlib import Path + +import mkdocs_gen_files + +# Initialize the navigation object +nav = mkdocs_gen_files.Nav() + +# Search inside 'src' dir for python 'packages' (dirs with __init__.py) +src = Path(__file__).parent.parent / "src" + +cli_module_path: t.Optional[Path] = None + + +# Loop, recursively, over all Python *.py Files, inside 'src' dir and subdirs +for path in sorted(src.rglob("*.py")): + ## 1. extract Relative path from Python File and remove suffix (.py) + # EG src/biskotaki/cli.py --> biskotaki/cli + _module_path = path.relative_to(src).with_suffix("") + ## 2. derive corresponding Docs File to write Directives into + # EG biskotaki/cli --> biskotaki/cli.md + doc_path = path.relative_to(src).with_suffix(".md") + ## 3. derive Full Path to Docs File + full_doc_path = Path("reference", doc_path) + + parts = list(_module_path.parts) + + # Skip __main__ Files + if parts[-1] == "__main__": + continue + + # For __init__ Files dedicate an index.md file, instead of __init__.md + if parts[-1] == "__init__": + parts = parts[:-1] + ## https://mkdocstrings.github.io/recipes/#bind-pages-to-sections-themselves + doc_path = doc_path.with_name("index.md") + # full_doc_path = full_doc_path.with_name("index.md") + + if parts[-1] == 'cli': + cli_module_path = _module_path + + ## Progressively build the navigation object, creating a mapping: + # Navigatiion Item --> Docs File Path, *.md, with content for mkdocs build + # Sequence[str] --> str + nav[parts] = doc_path.as_posix() + # nav[parts] = str(doc_path) # use this in case as_posix() fails on windows + + # Write Contents for Item, with some kind of directive + with mkdocs_gen_files.open(Path("reference", doc_path), "w") as fd: + identifier = ".".join(parts) + print("::: " + identifier, file=fd) + +# Dedicate a custom Page for Entrypoint CLI, apart from auto-generated +# Automatic discovery happens, if a top-level cli.py file is found. +if cli_module_path: + # we want to place CLI in top-level navigation + navigation_key: t.Sequence[str] = ["CLI"] + # arbitrary Docs file name, since we will inject its contents automatically + doc_path = Path("CLI.md") + + # Add to Navigation Item + nav[navigation_key] = doc_path.as_posix() + + # Top-Level CLI.md Docs Contents: mainly using the 'mkdocs-click' Directive + CLI_DOC_CONTENT = """ +# CLI Reference + +This page provides documentation for our command line tools. + +::: mkdocs-click + :module: biskotakigold.cli + :command: main +""" + # TODO: write better content for the CLI.md file + with mkdocs_gen_files.open(Path("reference", doc_path), "w") as fd: + fd.write(CLI_DOC_CONTENT) + + # ROOT + # -> docs + # -> scripts + # -> src/python_package + mkdocs_gen_files.set_edit_path(full_doc_path, Path("../") / path) + # so that it correctly sets the edit path of (for example) nst_math.py to + # /blob/master/src/artificial_artwork/nst_math.py instead of + # /blob/master/docs/src/artificial_artwork/nst_math.py + + # mkdocs_gen_files.set_edit_path(full_doc_path, path) + + +# At the end, create a magic, literate navigation file called SUMMARY.md in the +# reference folder. +with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: + # Write the navigation as a Markdown list in the literate navigation file + nav_file.writelines(nav.build_literate_nav()) + +# Now we are able to remove our hard-coded navigation in mkdocs.yml, +# and replace it with a single line! + +# IE: - Code Reference: reference/ +# Note the trailing slash! It is needed so that mkdocs-literate-nav knows it has +# to look for a SUMMARY.md file in that folder From 9be6a2f2aa6e8fc398981ae0b2dbd0de6f86b5d5 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 22:10:36 +0200 Subject: [PATCH 15/17] gitops: pass git tag to Workflow for PR in to a boarding branch --- .github/workflows/pr-to-boarding.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-to-boarding.yml b/.github/workflows/pr-to-boarding.yml index 013f45cb..356098b7 100644 --- a/.github/workflows/pr-to-boarding.yml +++ b/.github/workflows/pr-to-boarding.yml @@ -15,7 +15,7 @@ jobs: uses: boromir674/automated-workflows/.github/workflows/go-pr-to-boarding.yml@test with: # pass tag to PR from --> - - board_tag: "${{ github.ref }}" + board_tag: "${{ github.ref_name }}" main_branch: ${{ vars.MAIN_BRANCH || 'main' }} secrets: github_pat: ${{ secrets.GH_TOKEN }} From c2516dad42a3c25e7b9f9406689cf3febdf63ae3 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 22:24:45 +0200 Subject: [PATCH 16/17] release(semantic_version): bump version to 2.3.0 --- README.rst | 4 ++-- docs/conf.py | 2 +- pyproject.toml | 2 +- src/cookiecutter_python/__init__.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index e2ed5b0d..e77aae70 100755 --- a/README.rst +++ b/README.rst @@ -275,9 +275,9 @@ Free/Libre and Open Source Software (FLOSS) .. Github Releases & Tags -.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.2.1-dev1/master?color=blue&logo=github +.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.3.0/master?color=blue&logo=github :alt: GitHub commits since tagged version (branch) - :target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.2.1-dev1..master + :target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.3.0..master .. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver :alt: GitHub commits since latest release (by SemVer) diff --git a/docs/conf.py b/docs/conf.py index bf324d1f..22db4c95 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,7 +30,7 @@ author = 'Konstantinos Lampridis' # The full version, including alpha/beta/rc tags -release = '2.2.1-dev1' +release = '2.3.0' # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index ed891beb..0dc343b3 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "poetry.core.masonry.api" ## Also renders on pypi as 'subtitle' [tool.poetry] name = "cookiecutter_python" -version = "2.2.1-dev1" +version = "2.3.0" description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline." authors = ["Konstantinos Lampridis "] maintainers = ["Konstantinos Lampridis "] diff --git a/src/cookiecutter_python/__init__.py b/src/cookiecutter_python/__init__.py index 85bb05e9..c046fb5f 100755 --- a/src/cookiecutter_python/__init__.py +++ b/src/cookiecutter_python/__init__.py @@ -1,3 +1,3 @@ -__version__ = '2.2.1-dev1' +__version__ = '2.3.0' from . import _logging # noqa From aa53ebad4167278ed1972e8c864c44841a7cb881 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Wed, 13 Mar 2024 22:25:57 +0200 Subject: [PATCH 17/17] docs: update changelog with the release's changes --- CHANGELOG.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 30b5b7c2..d6dc2d64 100755 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,36 @@ Changelog ========= +2.3.0 (2024-03-13) +================== + +Changes +^^^^^^^ + +feature +""""""" +- cover most source code areas, when PR labeling: src, tests, ci, data, config +- add Job that makes a Github Release on v* tags on Main Branch + +fix +""" +- expect interpreters to be loaded as dict by cookiecutter in intereactive mode + +test +"""" +- update Gold Standard Snapshot +- update biskotaki-interactive Snapshot, used in Regression Testing +- update biskotaki-no-input Snapshot, used in Regression Testing + +ci +"" +- clean code + +gitops +"""""" +- pass git tag to Workflow for PR in to a boarding branch + + 2.2.1-dev1 (2024-03-13) =======================