CI: - Micropython-specific code from CPython-only branches

This commit is contained in:
Ivan Pozdeev 2025-12-13 18:04:15 +03:00
parent 9b85239875
commit 4b33cb68b6
No known key found for this signature in database
GPG Key ID: FB6A628DCF06DCD7

View File

@ -121,33 +121,22 @@ jobs:
pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$? pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$?
if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi
pyenv global ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }}
# Micropython doesn't support --version
- run: | - run: |
#print version #print version
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then python --version
python -c 'import sys; print(sys.version)' python -m pip --version
else
python --version
python -m pip --version
fi
# Micropython doesn't support sys.executable, os.path, older versions even os
- env: - env:
EXPECTED_PYTHON: ${{ matrix.python-version }} EXPECTED_PYTHON: ${{ matrix.python-version }}
run: | run: |
#check #check
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then python -c 'if True:
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1 import os, sys, os.path
python -c 'import sys; assert sys.implementation.name == "micropython"' correct_dir = os.path.join(
else os.environ["PYENV_ROOT"],
python -c 'if True: "versions",
import os, sys, os.path os.environ["EXPECTED_PYTHON"],
correct_dir = os.path.join( "bin")
os.environ["PYENV_ROOT"], assert os.path.dirname(sys.executable) == correct_dir'
"versions",
os.environ["EXPECTED_PYTHON"],
"bin")
assert os.path.dirname(sys.executable) == correct_dir'
fi
# bundled executables in some Anaconda releases cause the post-run step to hang in MacOS # bundled executables in some Anaconda releases cause the post-run step to hang in MacOS
- run: | - run: |
pyenv global system pyenv global system
@ -245,30 +234,19 @@ jobs:
pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$? pyenv --debug install ${{ matrix.python-version }} && rc=$? || rc=$?
if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi if [[ $rc -ne 0 ]]; then echo config.log:; cat $TMPDIR/python-build*/*/config.log; false; fi
pyenv global ${{ matrix.python-version }} pyenv global ${{ matrix.python-version }}
# Micropython doesn't support --version
- run: | - run: |
#print version #print version
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then python --version
python -c 'import sys; print(sys.version)' python -m pip --version
else
python --version
python -m pip --version
fi
# Micropython doesn't support sys.executable, os.path, older versions even os
- env: - env:
EXPECTED_PYTHON: ${{ matrix.python-version }} EXPECTED_PYTHON: ${{ matrix.python-version }}
run: | run: |
#check #check
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then python -c 'if True:
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1 import os, sys, os.path
python -c 'import sys; assert sys.implementation.name == "micropython"' correct_dir = os.path.join(
else os.environ["PYENV_ROOT"],
python -c 'if True: "versions",
import os, sys, os.path os.environ["EXPECTED_PYTHON"],
correct_dir = os.path.join( "bin")
os.environ["PYENV_ROOT"], assert os.path.dirname(sys.executable) == correct_dir'
"versions",
os.environ["EXPECTED_PYTHON"],
"bin")
assert os.path.dirname(sys.executable) == correct_dir'
fi