diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ccbb25b33..0b64cf74c 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 100755 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