Skip to content

Commit 8bb40c7

Browse files
committed
WIP: CI(GHActions): Debugging Python2.7 + 3.7
1 parent 649c051 commit 8bb40c7

File tree

1 file changed

+7
-145
lines changed

1 file changed

+7
-145
lines changed

.github/workflows/test-publish.yaml

+7-145
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,12 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest, macos-latest, windows-latest]
17-
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "=3.9[build=*_pypy]"]
18-
exclude:
19-
- os: windows-latest
20-
python-version: "2.7"
21-
- os: macos-latest
22-
python-version: "2.7"
23-
- os: macos-latest
24-
python-version: "3.5"
25-
- os: macos-latest
26-
python-version: "3.6"
27-
- os: macos-latest
28-
python-version: "3.7"
29-
- os: macos-latest
30-
python-version: "=3.9[build=*_pypy]"
31-
- os: windows-latest
32-
python-version: "=3.9[build=*_pypy]"
16+
os: [ubuntu-latest]
17+
python-version: ["2.7"]
3318
include:
3419
- os: ubuntu-latest
3520
os-name: Linux
3621
pip-cache-path: ~/.cache/pip
37-
- os: macos-latest
38-
os-name: MacOS
39-
pip-cache-path: ~/Library/Caches/pip
40-
- os: windows-latest
41-
os-name: w32
42-
pip-cache-path: ~\AppData\Local\pip\Cache
4322

4423
name: Python ${{ matrix.python-version }} @ ${{ matrix.os-name }}
4524
runs-on: ${{ matrix.os }}
@@ -57,128 +36,11 @@ jobs:
5736
- name: Install additional Python 3.7
5837
run: |
5938
conda create -n py37 --yes python=3.7
60-
py37_prefix="`echo $CONDA_PREFIX | sed 's/__setup_conda/py37/'`"
61-
ln -s "$py37_prefix/bin/python" "$CONDA_PREFIX/bin/python3.7"
62-
ln -s "$py37_prefix/bin/pip" "$CONDA_PREFIX/bin/pip3.7"
39+
ln -s "$CONDA/envs/py37/bin/python" "$CONDA/envs/test/bin/python3.7"
40+
ln -s "$CONDA/envs/py37/bin/pip" "$CONDA/envs/test/bin/pip3.7"
41+
echo $PATH
42+
ls -l "$CONDA/envs/py37/bin/python" "$CONDA/envs/test/bin/python3.7" "$CONDA/envs/py37/bin/pip" "$CONDA/envs/test/bin/pip3.7"
6343
python3.7 --version
6444
pip3.7 --version
6545
shell: bash
66-
if: ${{ matrix.python-version == '2.7' && runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }}
67-
- uses: actions/setup-python@v4
68-
with:
69-
python-version: ${{ matrix.python-version }}
70-
if: ${{ contains(fromJSON(env.not_in_conda), matrix.python-version) }}
71-
- uses: actions/cache@v3
72-
with:
73-
path: ~/conda_pkgs_dir
74-
key: ${{ runner.os }}-conda
75-
- name: Cache pip
76-
uses: actions/cache@v3
77-
with:
78-
path: ${{ matrix.pip-cache-path }}
79-
key: ${{ runner.os }}-pip
80-
# Setup tox
81-
- name: Install dependencies
82-
run: |
83-
python --version
84-
python -m pip || python -m ensurepip --default-pip --upgrade
85-
python -m pip install --upgrade pip setuptools wheel
86-
pip --version
87-
pip install --upgrade virtualenv "tox >= 3.15, < 4"
88-
shell: bash -el {0}
89-
- name: Set TOXENV
90-
run: |
91-
python -c "
92-
import os, sys
93-
ld_library_path = None
94-
if hasattr(sys, 'pypy_version_info'):
95-
toxenv = 'pypy3'
96-
else:
97-
pyver = '%d%d' % tuple(sys.version_info[:2])
98-
if (pyver == '27') and (os.name == 'posix'): # Python 2.7 on Linux requires `$LD_LIBRARY_PATH`
99-
ld_library_path = os.path.join(
100-
os.path.dirname(os.path.dirname(sys.executable)), 'lib')
101-
toxenv = 'py%s' % pyver
102-
if os.name == 'posix':
103-
toxenv += ',py%s-flake8' % pyver
104-
with open(os.environ['GITHUB_ENV'], 'a') as f:
105-
if ld_library_path:
106-
f.write('LD_LIBRARY_PATH=' + ld_library_path + '\n')
107-
f.write('TOXENV=' + toxenv + '\n')
108-
"
109-
shell: bash -el {0}
110-
111-
- name: Run tox
112-
run: |
113-
python -c "import os; print(os.environ['TOXENV'])"
114-
tox --version
115-
tox
116-
shell: bash -el {0}
117-
118-
- name: Build and publish sdist and wheel on Unix
119-
run: |
120-
pip install -U --ignore-installed certifi # Replace conda-installed
121-
devscripts/CI/ghactions-release
122-
env:
123-
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
124-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
125-
if: ${{ !startsWith(matrix.python-version, 'pypy') && runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }}
126-
- name: Build and publish wheel on w32
127-
run: |
128-
pip install -U pip setuptools twine wheel
129-
python setup.py bdist_wheel
130-
twine upload --disable-progress-bar --skip-existing dist\*
131-
if: ${{ !startsWith(matrix.python-version, 'pypy') && runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/') }}
132-
env:
133-
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
134-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
135-
- name: Build and publish wheel on Linux/aarch64
136-
uses: uraimo/run-on-arch-action@v2
137-
with:
138-
arch: aarch64
139-
distro: ubuntu22.04
140-
env: |
141-
PY_VER: "${{ matrix.python-version }}"
142-
RUNNER_OS: ${{ runner.os }}
143-
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
144-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
145-
install: |
146-
set -ex
147-
apt-get update -q -y
148-
apt-get install -q -y curl gcc patchelf
149-
run: |
150-
set -ex
151-
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
152-
bash Miniforge3-$(uname)-$(uname -m).sh -b -u -p "$HOME"/miniforge3
153-
source "$HOME"/miniforge3/etc/profile.d/conda.sh
154-
#conda update -n base -c conda-forge --yes conda
155-
pyv="`echo $PY_VER | sed 's/\.//'`"
156-
conda create -n py$pyv --yes python=$PY_VER
157-
conda activate py$pyv
158-
python --version
159-
python -m pip || python -m ensurepip --default-pip --upgrade
160-
python -m pip install --upgrade pip setuptools wheel
161-
pip --version
162-
if [ $PY_VER = 2.7 ]; then
163-
conda create -n py37 --yes python=3.7
164-
ln -s "$HOME"/miniforge3/envs/py37/bin/python "$HOME"/miniforge3/envs/py27/bin/python3.7
165-
ln -s "$HOME"/miniforge3/envs/py37/bin/pip "$HOME"/miniforge3/envs/py27/bin/pip3.7
166-
python3.7 --version
167-
pip3.7 --version
168-
fi
169-
exec devscripts/CI/ghactions-release
170-
if: ${{ !contains(fromJSON(env.not_in_aarch64), matrix.python-version) && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') }}
171-
- name: Publish wheel to Releases
172-
uses: ncipollo/release-action@v1
173-
with:
174-
artifacts: "dist/*"
175-
allowUpdates: true
176-
bodyFile: "LATEST-CHANGES.rst"
177-
omitBodyDuringUpdate: true
178-
omitNameDuringUpdate: true
179-
omitPrereleaseDuringUpdate: true
180-
prerelease: true
181-
replacesArtifacts: false
182-
skipIfReleaseExists: false
183-
updateOnlyUnreleased: false
184-
if: ${{ !startsWith(matrix.python-version, 'pypy') && startsWith(github.ref, 'refs/tags/') }}
46+
if: ${{ matrix.python-version == '2.7' }}

0 commit comments

Comments
 (0)