From aeaf9332a46682015a89092f220090bdda0aa8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Motheu?= Date: Fri, 27 Dec 2024 19:31:48 +0100 Subject: [PATCH 1/7] chore: example failing commit --- .pre-commit-config.yaml | 3 --- src/main.py | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e38b9e8..d8a25f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,6 @@ repos: entry: poetry run ruff format language: python types_or: [ python, pyi, jupyter ] - args: [ "--config", "pyproject.toml", "src/" ] pass_filenames: true - id: ruff-lint @@ -22,7 +21,6 @@ repos: entry: poetry run ruff check language: python types_or: [ python, pyi, jupyter ] - args: [ "--config", "pyproject.toml", "src/" ] pass_filenames: true exclude: tests @@ -31,5 +29,4 @@ repos: entry: poetry run mypy language: python types_or: [ python, pyi, jupyter ] - args: [ "--config", "pyproject.toml", "src/" ] pass_filenames: true diff --git a/src/main.py b/src/main.py index 159d1ac..7342010 100644 --- a/src/main.py +++ b/src/main.py @@ -1,8 +1,16 @@ """Public module example.""" +from typing import Optional + from loguru import logger +def a_new_method() -> None: + print("example!") + a: Optional[str] = None + example(data=a) + + def example(data: str) -> None: """Use this docstring as an example for an Example function. From 5bb7d7d6753c24703c718cc0ef5cb61d52be32ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Motheu?= Date: Fri, 27 Dec 2024 19:33:34 +0100 Subject: [PATCH 2/7] ci: fix quote issue in main pipeline --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7875d29..93a4fe5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ jobs: release: needs: [ config, setup, format, lint, type-check, test ] - if: github.ref == "refs/heads/main" + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From eb8602b1b7dbd253d50e2905bb15e5d1bfb9a7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Motheu?= Date: Fri, 27 Dec 2024 19:34:20 +0100 Subject: [PATCH 3/7] ci: fix issues with quotes in pipeline --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93a4fe5..5354997 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,7 +97,7 @@ jobs: fi - name: Find Previous Release - if: env.CREATE_RELEASE == "true" + if: env.CREATE_RELEASE == 'true' run: | PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") if [ -n "$PREV_TAG" ]; then @@ -105,7 +105,7 @@ jobs: fi - name: Generate Compare URL - if: env.CREATE_RELEASE == "true" + if: env.CREATE_RELEASE == 'true' run: | if [ -n "${{ env.PREV_TAG }}" ]; then echo "URL=${{ github.server_url }}/${{ github.repository }}/compare/${{ env.PREV_TAG }}...${{ env.VERSION }}" >> $GITHUB_ENV @@ -114,7 +114,7 @@ jobs: fi - name: Generate Changelog - if: env.CREATE_RELEASE == "true" + if: env.CREATE_RELEASE == 'true' run: | chmod +x .github/generate_changelog.sh source .github/generate_changelog.sh @@ -128,7 +128,7 @@ jobs: echo "EOF" >> $GITHUB_ENV - name: Create Release - if: env.CREATE_RELEASE == "true" + if: env.CREATE_RELEASE == 'true' uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.VERSION }} From 65b72d0a2129cf6e8793b45576e3c38eace9df94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Motheu?= Date: Fri, 27 Dec 2024 19:36:21 +0100 Subject: [PATCH 4/7] ci: fix issue with quote setup-env --- .github/actions/setup-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 7e42f32..f04186c 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -29,7 +29,7 @@ runs: path: | ~/.cache/pypoetry ~/.poetry - key: ${{ runner.os }}-poetry-${{ hashFiles("**/poetry.lock") }}${{ inputs.cache-key-suffix }} + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}${{ inputs.cache-key-suffix }} - name: Install dependencies shell: bash From b43ad3317a5a28db3d7b695412193661b1258bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Motheu?= Date: Fri, 27 Dec 2024 19:38:02 +0100 Subject: [PATCH 5/7] ci: fix quote issue in action yml --- .github/actions/code-quality/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/code-quality/action.yml b/.github/actions/code-quality/action.yml index 44021b7..ade9cca 100644 --- a/.github/actions/code-quality/action.yml +++ b/.github/actions/code-quality/action.yml @@ -14,16 +14,16 @@ runs: using: "composite" steps: - name: Run Ruff Formatting - if: inputs.check-type == "format" + if: inputs.check-type == 'format' shell: bash run: poetry run ruff format --config pyproject.toml ${{ inputs.source-dir }} - name: Run Ruff Linting - if: inputs.check-type == "lint" + if: inputs.check-type == 'lint' shell: bash run: poetry run ruff check --config pyproject.toml ${{ inputs.source-dir }} - name: Run Mypy Type Checking - if: inputs.check-type == "type-check" + if: inputs.check-type == 'type-check' shell: bash run: poetry run mypy --config-file pyproject.toml ${{ inputs.source-dir }} \ No newline at end of file From 7aedf2c21dc5620c9064bc70cca70656e9908ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Motheu?= Date: Fri, 27 Dec 2024 19:40:26 +0100 Subject: [PATCH 6/7] ci: ensure all tasks run in parallel --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5354997..7ed1324 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: source-dir: ${{ needs.config.outputs.source-dir }} lint: - needs: [ config, format ] + needs: [ config, setup ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: source-dir: ${{ needs.config.outputs.source-dir }} type-check: - needs: [ config, format ] + needs: [ config, setup ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From daeac805cef9aea9ebbfe5aca1083078f5d72d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Motheu?= Date: Fri, 27 Dec 2024 19:41:56 +0100 Subject: [PATCH 7/7] chore: remove unused code --- src/main.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/main.py b/src/main.py index 7342010..159d1ac 100644 --- a/src/main.py +++ b/src/main.py @@ -1,16 +1,8 @@ """Public module example.""" -from typing import Optional - from loguru import logger -def a_new_method() -> None: - print("example!") - a: Optional[str] = None - example(data=a) - - def example(data: str) -> None: """Use this docstring as an example for an Example function.