mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
CI: Support Micropython
This commit is contained in:
parent
13f273188d
commit
7c1e3a710c
1 changed files with 46 additions and 23 deletions
59
.github/workflows/modified_scripts_build.yml
vendored
59
.github/workflows/modified_scripts_build.yml
vendored
|
@ -40,20 +40,31 @@ jobs:
|
||||||
- run: |
|
- run: |
|
||||||
pyenv install ${{ matrix.python-version }}
|
pyenv install ${{ matrix.python-version }}
|
||||||
pyenv global ${{ matrix.python-version }}
|
pyenv global ${{ matrix.python-version }}
|
||||||
- run: |
|
# Micropython doesn't support --version
|
||||||
python --version
|
- run: >
|
||||||
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
|
python -c 'import sys; print(sys.version)'
|
||||||
|
else
|
||||||
|
python --version;
|
||||||
python -m pip --version
|
python -m pip --version
|
||||||
- shell: python # Prove that actual Python == expected Python
|
fi
|
||||||
env:
|
# Micropython doesn't support sys.executable, os.path, older versions even os
|
||||||
|
- env:
|
||||||
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||||
run: |
|
run: |
|
||||||
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
|
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
|
||||||
|
python -c 'import sys; assert sys.implementation.name == "micropython"'
|
||||||
|
else
|
||||||
|
python -c 'if True:
|
||||||
import os, sys, os.path
|
import os, sys, os.path
|
||||||
correct_dir = os.path.join(
|
correct_dir = os.path.join(
|
||||||
os.environ['PYENV_ROOT'],
|
os.environ["PYENV_ROOT"],
|
||||||
'versions',
|
"versions",
|
||||||
os.environ['EXPECTED_PYTHON'],
|
os.environ["EXPECTED_PYTHON"],
|
||||||
'bin')
|
"bin")
|
||||||
assert os.path.dirname(sys.executable) == correct_dir
|
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
|
||||||
|
@ -82,16 +93,28 @@ jobs:
|
||||||
- run: |
|
- run: |
|
||||||
pyenv install ${{ matrix.python-version }}
|
pyenv install ${{ matrix.python-version }}
|
||||||
pyenv global ${{ matrix.python-version }}
|
pyenv global ${{ matrix.python-version }}
|
||||||
- run: python --version
|
# Micropython doesn't support --version
|
||||||
- run: python -m pip --version
|
- run: >
|
||||||
- shell: python # Prove that actual Python == expected Python
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
env:
|
python -c 'import sys; print(sys.version)'
|
||||||
|
else
|
||||||
|
python --version;
|
||||||
|
python -m pip --version
|
||||||
|
fi
|
||||||
|
# Micropython doesn't support sys.executable, os.path, older versions even os
|
||||||
|
- env:
|
||||||
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||||
run: |
|
run: |
|
||||||
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
|
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
|
||||||
|
python -c 'import sys; assert sys.implementation.name == "micropython"'
|
||||||
|
else
|
||||||
|
python -c 'if True:
|
||||||
import os, sys, os.path
|
import os, sys, os.path
|
||||||
correct_dir = os.path.join(
|
correct_dir = os.path.join(
|
||||||
os.environ['PYENV_ROOT'],
|
os.environ["PYENV_ROOT"],
|
||||||
'versions',
|
"versions",
|
||||||
os.environ['EXPECTED_PYTHON'],
|
os.environ["EXPECTED_PYTHON"],
|
||||||
'bin')
|
"bin")
|
||||||
assert os.path.dirname(sys.executable) == correct_dir
|
assert os.path.dirname(sys.executable) == correct_dir'
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue