diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f74f07e6..41c86db8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 @@ -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 }} @@ -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: | @@ -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 @@ -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' @@ -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 @@ -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 diff --git a/Cargo.lock b/Cargo.lock index f0cdf655..65212ca0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ dependencies = [ [[package]] name = "cramjam-python" -version = "2.8.2" +version = "2.8.3" dependencies = [ "libcramjam 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "pyo3", @@ -725,6 +725,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deaa5745de3f5231ce10517a1f5dd97d53e5a2fd77aa6b5842292085831d48d7" dependencies = [ "once_cell", + "python3-dll-a", "target-lexicon 0.12.14", ] @@ -763,6 +764,15 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "python3-dll-a" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f07cd4412be8fa09a721d40007c483981bbe072cd6a21f2e83e04ec8f8343f" +dependencies = [ + "cc", +] + [[package]] name = "quote" version = "1.0.35" diff --git a/cramjam-python/Cargo.toml b/cramjam-python/Cargo.toml index ab075098..e4aedd31 100644 --- a/cramjam-python/Cargo.toml +++ b/cramjam-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cramjam-python" -version = "2.8.2" +version = "2.8.3" authors = ["Miles Granger "] edition = "2021" license = "MIT" @@ -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]