From 5844fa84a929c0ae7c57e3b9b68f1496823c97b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Kir=C3=A1ly?= Date: Sat, 15 Mar 2025 17:23:29 +0100 Subject: [PATCH 1/6] remove --- .github/workflows/lint.yml | 26 ---------------- .github/workflows/pypi_release.yml | 4 ++- .github/workflows/test.yml | 48 ++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 9b91811b4..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - pre-commit-hooks: - name: Check that pre-commit hooks pass - runs-on: ubuntu-latest - steps: - - name: repository checkout step - uses: actions/checkout@v4 - - name: python environment step - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: install pre-commit - run: python3 -m pip install pre-commit - - id: changed-files - name: identify modified files - uses: tj-actions/changed-files@v44 - - name: run pre-commit hooks on modified files - run: pre-commit run --color always --files ${{ steps.changed-files.outputs.all_changed_files }} --show-diff-on-failure diff --git a/.github/workflows/pypi_release.yml b/.github/workflows/pypi_release.yml index ed1b692ef..d2828df81 100644 --- a/.github/workflows/pypi_release.yml +++ b/.github/workflows/pypi_release.yml @@ -72,6 +72,9 @@ jobs: runs-on: ubuntu-latest needs: [pytest-nosoftdeps] + permissions: + id-token: write + steps: - uses: actions/download-artifact@v4 with: @@ -81,5 +84,4 @@ jobs: - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: wheelhouse/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5fcd9c1ff..1341eecd9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,53 @@ concurrency: cancel-in-progress: true jobs: + +jobs: + code-quality: + name: code-quality + runs-on: ubuntu-latest + steps: + - name: repository checkout step + uses: actions/checkout@v4 + + - name: python environment step + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: install pre-commit + run: python3 -m pip install pre-commit + + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + run: | + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr '\n' ' ') + echo "CHANGED_FILES=${CHANGED_FILES}" >> $GITHUB_ENV + + - name: Print changed files + run: | + echo "Changed files:" && echo "$CHANGED_FILES" | tr ' ' '\n' + + - name: Run pre-commit on changed files + run: | + if [ -n "$CHANGED_FILES" ]; then + pre-commit run --color always --files $CHANGED_FILES --show-diff-on-failure + else + echo "No changed files to check." + fi + + - name: check missing __init__ files + + run: build_tools/fail_on_missing_init_files.sh + shell: bash + run-notebook-tutorials: + needs: code-quality runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -35,6 +81,7 @@ jobs: shell: bash pytest-nosoftdeps: + needs: code-quality name: no-softdeps runs-on: ${{ matrix.os }} strategy: @@ -74,6 +121,7 @@ jobs: run: python -m pytest tests pytest: + needs: pytest-nosoftdeps name: Run pytest runs-on: ${{ matrix.os }} strategy: From a390afb74f86156cfe1ac9adfdff629840682fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Kir=C3=A1ly?= Date: Sat, 15 Mar 2025 17:31:02 +0100 Subject: [PATCH 2/6] Update test.yml --- .github/workflows/test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1341eecd9..576467feb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -jobs: - jobs: code-quality: name: code-quality @@ -60,6 +58,7 @@ jobs: shell: bash run-notebook-tutorials: + name: Run notebook tutorials needs: code-quality runs-on: ubuntu-latest steps: @@ -81,8 +80,8 @@ jobs: shell: bash pytest-nosoftdeps: - needs: code-quality name: no-softdeps + needs: code-quality runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -121,8 +120,8 @@ jobs: run: python -m pytest tests pytest: - needs: pytest-nosoftdeps name: Run pytest + needs: pytest-nosoftdeps runs-on: ${{ matrix.os }} strategy: fail-fast: false From 7cc6a76f14b22b00d49fe29408d72a85cc989869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Kir=C3=A1ly?= Date: Sat, 15 Mar 2025 17:49:18 +0100 Subject: [PATCH 3/6] Create fail_on_missing_init_files.sh --- build_tools/fail_on_missing_init_files.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 build_tools/fail_on_missing_init_files.sh diff --git a/build_tools/fail_on_missing_init_files.sh b/build_tools/fail_on_missing_init_files.sh new file mode 100644 index 000000000..3428c0ba3 --- /dev/null +++ b/build_tools/fail_on_missing_init_files.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Script to search for missing init FILES. +set -euxo pipefail + +FILES=$( find ./sktime -type d '!' -exec test -e "{}/__init__.py" ";" -not -path "**/__pycache__" -not -path "**/datasets/data*" -not -path "**/contrib/*" -print ) + +if [[ -n "$FILES" ]] +then + echo "Missing __init__.py files detected in the following modules:" + echo "$FILES" + exit 1 +fi From bdab0dabca2773bef892c5e5dafcd75163461f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Kir=C3=A1ly?= Date: Sat, 15 Mar 2025 17:51:59 +0100 Subject: [PATCH 4/6] remove init check --- .github/workflows/test.yml | 5 ----- build_tools/fail_on_missing_init_files.sh | 13 ------------- 2 files changed, 18 deletions(-) delete mode 100644 build_tools/fail_on_missing_init_files.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 576467feb..6ec8ca117 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,11 +52,6 @@ jobs: echo "No changed files to check." fi - - name: check missing __init__ files - - run: build_tools/fail_on_missing_init_files.sh - shell: bash - run-notebook-tutorials: name: Run notebook tutorials needs: code-quality diff --git a/build_tools/fail_on_missing_init_files.sh b/build_tools/fail_on_missing_init_files.sh deleted file mode 100644 index 3428c0ba3..000000000 --- a/build_tools/fail_on_missing_init_files.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Script to search for missing init FILES. -set -euxo pipefail - -FILES=$( find ./sktime -type d '!' -exec test -e "{}/__init__.py" ";" -not -path "**/__pycache__" -not -path "**/datasets/data*" -not -path "**/contrib/*" -print ) - -if [[ -n "$FILES" ]] -then - echo "Missing __init__.py files detected in the following modules:" - echo "$FILES" - exit 1 -fi From 80f4960fb03da9fd9718d71aa11539828c8bfca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Kir=C3=A1ly?= Date: Sat, 15 Mar 2025 17:52:20 +0100 Subject: [PATCH 5/6] Revert "remove init check" This reverts commit bdab0dabca2773bef892c5e5dafcd75163461f65. --- .github/workflows/test.yml | 5 +++++ build_tools/fail_on_missing_init_files.sh | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 build_tools/fail_on_missing_init_files.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ec8ca117..576467feb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,6 +52,11 @@ jobs: echo "No changed files to check." fi + - name: check missing __init__ files + + run: build_tools/fail_on_missing_init_files.sh + shell: bash + run-notebook-tutorials: name: Run notebook tutorials needs: code-quality diff --git a/build_tools/fail_on_missing_init_files.sh b/build_tools/fail_on_missing_init_files.sh new file mode 100644 index 000000000..3428c0ba3 --- /dev/null +++ b/build_tools/fail_on_missing_init_files.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Script to search for missing init FILES. +set -euxo pipefail + +FILES=$( find ./sktime -type d '!' -exec test -e "{}/__init__.py" ";" -not -path "**/__pycache__" -not -path "**/datasets/data*" -not -path "**/contrib/*" -print ) + +if [[ -n "$FILES" ]] +then + echo "Missing __init__.py files detected in the following modules:" + echo "$FILES" + exit 1 +fi From 4eba6a76ee8f62325709fd4ae8a449893e0f6042 Mon Sep 17 00:00:00 2001 From: Anirban Ray <> Date: Sun, 16 Mar 2025 14:35:42 +0530 Subject: [PATCH 6/6] made executable --- build_tools/fail_on_missing_init_files.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build_tools/fail_on_missing_init_files.sh diff --git a/build_tools/fail_on_missing_init_files.sh b/build_tools/fail_on_missing_init_files.sh old mode 100644 new mode 100755