check_numba_python_compatibility #1004
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: | |
repository_dispatch: | |
types: [check_numba_python_compatibility] | |
jobs: | |
check_numba_python_compatibility: | |
env: | |
req-python-version: '3.14' | |
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 |