Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pypy to ci checks #505

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,45 @@ jobs:
else
python -m tox run -e py311-${{ matrix.toxenv }}
fi
tox-pypy:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['pypy3.9', 'pypy3.10']
toxenv: [core, wheel]
fail-fast: false
steps:
- env:
python: ${{ matrix.python }}
toxenv: ${{ matrix.toxenv }}
run: |
echo "TOXENV=${python}-${toxenv}" | tr -d '.' | tee -a $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install --no-binary :all: cffi

# - run: |
# python -m tox run -r
- run: |
# Write sitecustomize.py that patches _cffi_backend
mkdir -p .ci-pypy-patch
cat <<EOF > .ci-pypy-patch/sitecustomize.py
import sys
try:
import _cffi_backend
if not hasattr(_cffi_backend, '__file__'):
_cffi_backend.__file__ = "/usr/lib/libcffi.so" # dummy fallback path
except (ImportError, AttributeError):
pass
EOF

# Set PYTHONPATH to load the patch
export PYTHONPATH="$PWD/.ci-pypy-patch"

# Run tox
python -m tox run -r
1 change: 1 addition & 0 deletions newsfragments/505.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds ``pypy3.9`` and ``pypy3.10`` to CI checks.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: PyPy :: 3.9",
"Programming Language :: Python :: Implementation :: PyPy :: 3.10",
],
platforms=["unix", "linux", "osx", "win32"],
entry_points={
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[tox]
envlist=
py{39,310,311,312,313}-core
pypy{39,310}-core
py{39,310,311,312,313}-lint
py{39,310,311,312,313}-wheel
pypy{39,310}-wheel
py{39,310,311,312,313}-interop
windows-wheel
docs
Expand Down Expand Up @@ -31,6 +33,8 @@ basepython=
py311: python3.11
py312: python3.12
py313: python3.13
pypy39: pypy3.9
pypy310: pypy3.10
extras=
test
docs
Expand All @@ -44,7 +48,7 @@ commands=
pre-commit install
pre-commit run --all-files --show-diff-on-failure

[testenv:py{39,310,311,312,313}-wheel]
[testenv:py{39,310,311,312,313,py39,py310}-wheel]
deps=
wheel
build[virtualenv]
Expand Down
Loading