Skip to content

Commit

Permalink
CI: Use alternatives to select python version (#4)
Browse files Browse the repository at this point in the history
* CI: Use alternatives to select python version

* CI: Specify full path to alternatives

/usr/sbin isn't in PATH

* DBG: Print uname to try to avoid bad pip install.

pip>=22 on 32-bit Cygwin seems to cause problems installing coverage.  I have no idea why this is, so I just skip upgrading pip there.

* FIX: Fix syntax of conditional for 32-bit Cygwin

I have no idea if it needs to be able to accept i386, but it will if it comes up.

* FIX: Revert earlier debug change.
  • Loading branch information
DWesl committed May 3, 2022
1 parent ce74898 commit 0b13425
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .ci/install.sh
Expand Up @@ -25,7 +25,7 @@ if [[ $(uname) != CYGWIN* ]]; then
cmake meson imagemagick libharfbuzz-dev libfribidi-dev
fi

if [[ $(uname -mo) != "i*86 Cygwin" ]]; then
if [[ $(uname -mo) != i*86" Cygwin" ]]; then
python3 -m pip install --upgrade pip
fi

Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/test-cygwin.yml
Expand Up @@ -53,10 +53,18 @@ jobs:
key: ${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }}
restore-keys: |
${{ runner.os }}-cygwin-${{ matrix.architecture }}-pip3.${{ matrix.python-minor-version }}-
- name: Ensure correct python minor version used in scripts
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
/usr/sbin/alternatives --set python3 /usr/bin/python3.${{ matrix.python-minor-version }}
/usr/sbin/alternatives --display python3
/usr/sbin/alternatives --set python /usr/bin/python3.${{ matrix.python-minor-version }}
/usr/sbin/alternatives --display python
- name: Build system information
run: |
dash.exe -c "python3.${{ matrix.python-minor-version }} .github/workflows/system-info.py"
dash.exe -c "python3 .github/workflows/system-info.py"
- name: Install dependencies
run: |
Expand All @@ -66,20 +74,20 @@ jobs:
if: matrix.architecture == 'x86_64'
shell: dash.exe -l "{0}"
run: |
python3.${{ matrix.python-minor-version }} -m pip install -U 'numpy!=1.21.*'
python3 -m pip install -U 'numpy!=1.21.*'
- name: Check imports
shell: dash.exe -l "{0}"
run: |
python3.${{ matrix.python-minor-version }} -c 'import numpy as np; print(np.__version__)'
python3 -c 'import numpy as np; print(np.__version__)'
- name: Build
shell: bash.exe -eo pipefail -o igncr "{0}"
run: |
python3.${{ matrix.python-minor-version }} -m coverage erase
python3 -m coverage erase
make clean
CFLAGS="-coverage -Werror=implicit-function-declaration" python3.${{ matrix.python-minor-version }} -m pip install -v --global-option="build_ext" .
python3.${{ matrix.python-minor-version }} selftest.py
CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip install -v --global-option="build_ext" .
python3 selftest.py
- name: Rebase dlls
shell: bash.exe -eo pipefail -o igncr "{0}"
Expand Down

0 comments on commit 0b13425

Please sign in to comment.