diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index e436b4ca..8f691e32 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -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 < .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 diff --git a/newsfragments/505.internal.rst b/newsfragments/505.internal.rst new file mode 100644 index 00000000..4a8a3bbf --- /dev/null +++ b/newsfragments/505.internal.rst @@ -0,0 +1 @@ +Adds ``pypy3.9`` and ``pypy3.10`` to CI checks. diff --git a/setup.py b/setup.py index 85a4b302..b1811130 100644 --- a/setup.py +++ b/setup.py @@ -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={ diff --git a/tox.ini b/tox.ini index 983c3ee4..33940671 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -31,6 +33,8 @@ basepython= py311: python3.11 py312: python3.12 py313: python3.13 + pypy39: pypy3.9 + pypy310: pypy3.10 extras= test docs @@ -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]