diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 848a2e63..fddcc94b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -202,12 +202,40 @@ jobs: name: wheels path: dist - pypy: - runs-on: ${{ matrix.os }} + pypy-linux: + runs-on: ubuntu-latest strategy: matrix: - python-version: [ pypy-3.6, pypy-3.7, pypy-3.8 ] - os: [ ubuntu-latest, macos-latest ] + python: [ + { version: pypy-3.7, abi: pp37-pypy37_pp73 }, + { version: pypy-3.8, abi: pp38-pypy38_pp73 }, + ] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python.version }} + - name: Build Wheels + uses: messense/maturin-action@v1 + with: + target: ${{ matrix.target }} + manylinux: auto + args: -i /opt/python/${{ matrix.python.abi }}/bin/pypy --release --out dist --no-sdist --cargo-extra-args="--no-default-features" --cargo-extra-args="--features=extension-module" # disable mimallocator + - name: Python UnitTest + run: | + pip install cramjam --no-index --find-links dist + pypy -c "import cramjam" + - name: Upload wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist + + pypy-macos: + runs-on: macos-latest + strategy: + matrix: + python-version: [ pypy-3.7, pypy-3.8 ] steps: - uses: actions/checkout@v2 - name: Install Rust toolchain @@ -216,10 +244,6 @@ jobs: toolchain: stable profile: minimal default: true - - name: Build - run: cargo build --release - - name: Tests - run: cargo test --no-default-features --release - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} @@ -243,7 +267,7 @@ jobs: name: Release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [ macos, windows, linux, linux-cross, pypy ] + needs: [ macos, windows, linux, linux-cross, pypy-linux, pypy-macos ] steps: - uses: actions/download-artifact@v2 with: diff --git a/Makefile b/Makefile index 34b27a7f..58c6fb9c 100644 --- a/Makefile +++ b/Makefile @@ -44,4 +44,3 @@ dev-install: pypy-build: maturin build -i $(shell which pypy) --release --out dist - pypy ./pypy_patch.py diff --git a/pypy_patch.py b/pypy_patch.py deleted file mode 100644 index 144935e6..00000000 --- a/pypy_patch.py +++ /dev/null @@ -1,27 +0,0 @@ -import sysconfig -import pathlib -import re -import sys - -""" -Hacky hack, not very good support with maturin for PyPy - -1. Doesn't work on Windows -2. The naming is wrong in resulting wheels in Linux & OSX - -This script patches the last issue; ran after normal maturin build for these -systems on PyPy builds. -""" - -abi = sysconfig.get_config_var("SOABI").replace("-", "_") -major, minor = sys.version_info.major, sys.version_info.minor - -regex = re.compile(r"(?Ppp3[py0-9_]+-pypy[3_p0-9]+)") - -for file in pathlib.Path("./dist").iterdir(): - if file.name.endswith(".whl"): - new_name = regex.sub(f"pp{major}{minor}-{abi}", file.name) - if "manylinux" not in new_name and "linux" in new_name: - new_name = new_name.replace("linux", "manylinux2010") - print(f"Renaming {file.name} -> {new_name}") - file.rename(file.parent.joinpath(new_name))