Skip to content

Commit

Permalink
github-actions: Add pypy3.8, pypy3.9, pypy3.10, and pypy3.11 jobs
Browse files Browse the repository at this point in the history
Restrict max pypy heap size to 3GB.
Bump test timeout to 360 min.

Signed-off-by: Jan Vesely <[email protected]>
  • Loading branch information
jvesely committed Jan 7, 2025
1 parent 933c125 commit a465a84
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
15 changes: 11 additions & 4 deletions .github/actions/install-pnl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
run: |
case "$RUNNER_OS" in
macOS*) brew install graphviz ;;
Linux*) sudo apt-get update && sudo apt-get install -y --no-install-recommends graphviz ;;
Linux*) sudo apt-get update && sudo apt-get install -y --no-install-recommends graphviz build-essential pkg-config gfortran llvm${LLVM_SUFFIX}-dev libfreetype6-dev libjpeg-dev libopenblas-dev zlib1g-dev ;;
Windows*) choco install --no-progress -y graphviz --version=2.38.0.20190211 ;;
*) echo "Unsupported OS"; exit 1 ;;
esac
Expand All @@ -44,14 +44,15 @@ runs:
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "$PYTHON_LOC" >> $GITHUB_PATH
- name: Update pip and wheel
- name: Update pip, wheel, and cython
shell: bash
run: python -m pip install --upgrade pip wheel
run: python -m pip install --upgrade pip wheel 'cython<3'

- name: Drop pytorch on x86
shell: bash
run: |
echo > env_constraints.txt
# grpcio fails to build with cython >= 3
echo 'cython<3' > env_constraints.txt
if [ $(python -c 'import struct; print(struct.calcsize("P") * 8)') == 32 ]; then
sed -i /torch/d requirements.txt
sed -i /modeci_mdf/d requirements.txt
Expand All @@ -73,6 +74,9 @@ runs:
echo "llvmlite < 0.42.0" >> env_constraints.txt
# matplotlib >=3.8.0 doesn't provide win32 wheel
echo "matplotlib < 3.8.0" >> env_constraints.txt
# pywinpty needs extra libraries if built with cython available
pip uninstall cython -y
fi
- name: Install updated package
Expand Down Expand Up @@ -109,6 +113,9 @@ runs:
shell: bash
run: |
pip install ${{ steps.dist.outputs.wheel }}[${{ inputs.features }}] -c env_constraints.txt -c broken_trans_deps.txt
env:
LLVM_CONFIG: llvm-config${{ env.LLVM_SUFFIX }}
GRPC_PYTHON_BUILD_WITH_CYTHON: 1

- name: Cleanup old wheels
shell: bash
Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/pnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
- 'v**'
pull_request:

env:
# github linux/windows runners have 7GB RAM
PYPY_GC_MAX: 3GB

# run only the latest instance of this workflow job for the current branch/PR
# cancel older runs
# fall back to run id if not available (run id is unique -> no cancellations)
Expand Down Expand Up @@ -77,6 +81,34 @@ jobs:
os: macos
version-restrict: 'min'

# add pypy-3.8
- python-version: 'pypy-3.8'
python-architecture: 'x64'
os: ubuntu
extra-args: '--forked'
llvm-suffix: '-15'

# add pypy-3.9
- python-version: 'pypy-3.9'
python-architecture: 'x64'
os: ubuntu
extra-args: '--forked'
llvm-suffix: '-15'

# add pypy-3.10
- python-version: 'pypy-3.10'
python-architecture: 'x64'
os: ubuntu
extra-args: '--forked'
llvm-suffix: '-15'

# add pypy-3.11
- python-version: 'pypy-3.11'
python-architecture: 'x64'
os: ubuntu
extra-args: '--forked'
llvm-suffix: '-15'

exclude:
# 3.8/x64 python is broken on aarch64 macos runners
# https://github.com/actions/setup-python/issues/960
Expand Down Expand Up @@ -134,6 +166,8 @@ jobs:
id: install
with:
features: 'dev'
env:
LLVM_SUFFIX: ${{ matrix.llvm-suffix }}

- name: Lint with flake8
shell: bash
Expand All @@ -159,7 +193,7 @@ jobs:
esac
- name: Test with pytest
timeout-minutes: 180
timeout-minutes: 360
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n logical --capture=sys -o console_output_style=count ${{ matrix.extra-args }}

- name: Upload test results
Expand Down

0 comments on commit a465a84

Please sign in to comment.