Skip to content

Commit

Permalink
chore: check init.py in separate workflow step
Browse files Browse the repository at this point in the history
  • Loading branch information
michalslomczynski authored and jdobes committed Dec 4, 2023
1 parent 03f7be4 commit cef6a89
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check init.py
run: |
/bin/bash scripts/check_init_py.sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry importlib-resources==1.5.0
Expand Down
4 changes: 0 additions & 4 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ pip freeze > /tmp/req.txt
pur -r /tmp/req.txt --verify True -o /dev/null | grep "Updated" | sed -e "s/Updated/You can update:/g"
echo -e "${CYAN}------------------------------${NO_COLOR}"

# Make sure there is __init__.py in each dir containing python scripts
find . -name '*.py' | xargs dirname | sort | uniq | xargs -I {} bash -c "test -f {}/__init__.py || ( echo {} directory does not have __init__.py! && false )"
rc=$(($rc+$?))

# Run unit tests
echo "Running unit tests:"
pytest -vvv -s --cov-report term --cov --color=yes --durations=1
Expand Down
4 changes: 4 additions & 0 deletions scripts/check_init_py.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Make sure there is __init__.py in each dir containing python scripts
find . -name '*.py' | xargs dirname | sort | uniq | xargs -I {} bash -c "test -f {}/__init__.py || ( echo {} directory does not have __init__.py! && false )"

0 comments on commit cef6a89

Please sign in to comment.