Numba-Python Compatibility Check #1168
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Numba-Python Compatibility Check | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 14 * * *' # 2pm UTC == 9am EST | |
| jobs: | |
| get_latest_python_version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| latest_python_version: ${{ steps.set-latest.outputs.latest_python_version }} | |
| steps: | |
| - name: Checkout STUMPY | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: stumpy-dev/stumpy | |
| - name: Upgrade Pip, Install Minimum Requirements | |
| run: | | |
| python -m pip install --upgrade pip pandas lxml packaging | |
| shell: bash | |
| - name: Get Latest Python Version | |
| id: set-latest | |
| run: | | |
| echo "latest_python_version=$(python ./versions.py -mode latest)" >> $GITHUB_OUTPUT | |
| shell: bash | |
| check_numba_python_compatibility: | |
| needs: get_latest_python_version | |
| env: | |
| #req-python-version: '3.14' | |
| req-python-version: ${{ fromJSON(needs.get_latest_python_version.outputs.latest_python_version) }} | |
| runs-on: ubuntu-latest | |
| environment: API_Access | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Set Up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.req-python-version }} | |
| continue-on-error: true | |
| - name: Display Python Version | |
| id: python | |
| run: | | |
| python -c "import sys; print(sys.version)" | |
| echo "version=$(python -c 'import sys; print(sys.version)' | awk '{print $1}')" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Check Required Python Version | |
| if: "!startsWith(steps.python.outputs.version, env.req-python-version)" | |
| run: | | |
| echo "Expected Python version ${{ env.req-python-version }} but found version ${{ steps.python.outputs.version }} instead :(" | |
| echo 'Please see "Set Up Python" step above and confirm that the required Python version is available' | |
| shell: bash | |
| - name: Checkout STUMPY | |
| if: "startsWith(steps.python.outputs.version, env.req-python-version)" | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: stumpy-dev/stumpy | |
| - name: Install STUMPY And Other Dependencies | |
| if: "startsWith(steps.python.outputs.version, env.req-python-version)" | |
| run: python -m pip install --editable .[ci] 2> stderr.txt || true | |
| shell: bash | |
| - name: Check installation | |
| if: "startsWith(steps.python.outputs.version, env.req-python-version)" | |
| run: | | |
| if [[ `grep RuntimeError stderr.txt | wc -l` -gt "0" ]]; then | |
| echo "Installation failed (gracefully)" | |
| cat stderr.txt | |
| exit 0 | |
| else | |
| echo "Installation succeeded on Python ${{ env.req-python-version }}" | |
| exit 1 | |
| fi | |
| - name: Run STUMPY Unit Tests | |
| id: unittests | |
| if: failure() | |
| run: ./test.sh unit | |
| shell: bash | |
| - name: Create New STUMPY Issue Using REST API | |
| if: ${{ failure() && steps.unittests.conclusion != 'failure' }} | |
| run: | | |
| curl --request POST \ | |
| --url https://api.github.com/repos/stumpy-dev/stumpy/issues \ | |
| --header 'Authorization: token ${{ secrets.ACCESS_TOKEN }}' \ | |
| --header 'Content-Type: application/json' \ | |
| --data '{ | |
| "title": "Numba Python Version ${{ env.req-python-version }} Compatibility Update", | |
| "body": "This issue was automatically created by the stumpy-bot.\n\n Numba is now compatible with Python version ${{ env.req-python-version }} (see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" | |
| }' \ | |
| --fail | |
| shell: bash |