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 Windows PyPy #145

Merged
merged 12 commits into from
Mar 3, 2024
Merged
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
43 changes: 23 additions & 20 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust toolchain
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
Expand All @@ -119,10 +119,9 @@ jobs:
- name: Install built wheel
run: |
pip install cramjam-cli --no-index --find-links dist --force-reinstall
pip install cramjam --no-index --find-links dist --force-reinstall
pip install cramjam[dev] --find-links dist --force-reinstall
- name: Python UnitTest - cramjam-python
run: |
pip install pytest numpy hypothesis
python -m pytest cramjam-python -vs --ignore cramjam-python\benchmarks
- name: Python UnitTest - cramjam-cli
run: |
Expand Down Expand Up @@ -156,7 +155,7 @@ jobs:
run: cargo build --release
- name: Tests
run: cargo test --no-default-features --release --features capi
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Audit
Expand All @@ -176,8 +175,7 @@ jobs:
- name: Python UnitTest - cramjam-python
if: matrix.target == 'x86_64'
run: |
pip install pytest numpy hypothesis
pip install cramjam --no-index --find-links dist --force-reinstall
pip install cramjam[dev] --find-links dist --force-reinstall
python -m pytest cramjam-python -vs --ignore **/benchmarks
- name: Python UnitTest - cramjam-cli
if: matrix.target == 'x86_64'
Expand Down Expand Up @@ -263,14 +261,17 @@ jobs:
path: dist

pypy:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
# - windows-latest # TODO: fails w/ LINK : fatal error LNK1181: cannot open input file 'python39.lib'
platform:
- os: ubuntu-latest
flags: ''
- os: macos-latest
flags: ''
- os: windows-latest
flags: '--features generate-import-lib'
python:
- pypy-3.9
- pypy-3.10
Expand All @@ -285,30 +286,32 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{matrix.python}}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Build Wheels - cramjam-python
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-python/Cargo.toml
args: -i ${{ matrix.python }} --release ${{ matrix.platform.flags }} --out dist --manifest-path cramjam-python/Cargo.toml
- name: Build Wheels - cramjam-cli
if: ${{ matrix.platform.os != 'windows-latest' }}
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-cli/Cargo.toml
args: -i ${{ matrix.python }} --release ${{ matrix.platform.flags }} --out dist --manifest-path cramjam-cli/Cargo.toml
- name: cramjam test
# TODO: I'm not sure but the actual collection of tests on windows using pypy3.10 takes forever and/or fails
if: ${{ matrix.python != 'pypy-3.10' && matrix.platform.os != 'windows-latest' }}
run: |
pip install cramjam --no-index --find-links dist
pip install cramjam[dev] --find-links dist --force-reinstall
cd cramjam-python
pip install .[dev]
python -m pytest tests -v
- name: cramjam-cli test
if: ${{ matrix.platform.os != 'windows-latest' }}
run: |
pip install cramjam-cli --no-index --find-links dist
pip install cramjam-cli --no-index --find-links dist --force-reinstall
cd cramjam-cli
cramjam-cli --help
- name: Upload wheels
uses: actions/upload-artifact@v3
Expand Down
12 changes: 11 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cramjam-python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cramjam-python"
version = "2.8.2"
version = "2.8.3"
authors = ["Miles Granger <[email protected]>"]
edition = "2021"
license = "MIT"
Expand All @@ -15,6 +15,7 @@ crate-type = ["cdylib"]
[features]
default = ["extension-module"]
extension-module = ["pyo3/extension-module"]
generate-import-lib = ["pyo3/generate-import-lib"] # needed for Windows PyPy builds


[dependencies]
Expand Down
Loading