Merge pull request #744 from jellyfin/oddstr13-patch-4

Fix Python 2.7 workflows
This commit is contained in:
Odd Stråbø 2023-06-29 21:05:26 +02:00 committed by GitHub
commit d0f9e99aaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -29,11 +29,23 @@ jobs:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
queries: +security-and-quality queries: +security-and-quality
- name: Set up Python - name: Set up Python ${{ matrix.version }}
if: matrix.version != '2.7'
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.version }} python-version: ${{ matrix.version }}
- name: Set up Python 2.7
if: matrix.version == '2.7'
run: |
sudo apt-get update
sudo apt-get install -y \
python2.7 python2.7-dev python2-pip-whl
sudo ln -sf python2.7 /usr/bin/python
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
sudo chown -R $USER /usr/local/lib/python2.7
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v2 uses: github/codeql-action/autobuild@v2

View file

@ -23,10 +23,22 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py_version }} - name: Set up Python ${{ matrix.py_version }}
if: matrix.py_version != '2.7'
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.py_version }} python-version: ${{ matrix.py_version }}
- name: Set up Python 2.7
if: matrix.py_version == '2.7'
run: |
sudo apt-get update
sudo apt-get install -y \
python2.7 python2.7-dev python2-pip-whl
sudo ln -sf python2.7 /usr/bin/python
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
sudo chown -R $USER /usr/local/lib/python2.7
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip