diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a7bfefe1..f1af49d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,22 +22,36 @@ permissions: jobs: linux: - name: Build Linux-${{ matrix.target}} wheels for differt-core - runs-on: ubuntu-latest + name: Build linux-${{ matrix.platform.target}} wheels for differt-core + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + - runner: ubuntu-22.04 + target: s390x + - runner: ubuntu-22.04 + target: ppc64le steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Python uses: actions/setup-python@v5 + with: + python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 with: - target: ${{ matrix.target }} + target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: 'true' manylinux: auto @@ -46,15 +60,57 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: core-wheels-linux-${{ matrix.target }} + name: differt-core-wheels-linux-${{ matrix.platform.target }} + path: differt-core/dist + + musllinux: + name: Build musl-${{ matrix.platform.target}} wheels for differt-core + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + manylinux: musllinux_1_2 + working-directory: differt-core + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: differt-core-wheels-musllinux-${{ matrix.platform.target }} path: differt-core/dist windows: - name: Build Windows-${{ matrix.target}} wheels for differt-core - runs-on: windows-latest + name: Build windows-${{ matrix.platform.target}} wheels for differt-core + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x64, x86] + platform: + - runner: windows-latest + target: x64 + - runner: windows-latest + target: x86 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -62,12 +118,12 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - architecture: ${{ matrix.target }} + python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 with: - target: ${{ matrix.target }} + target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: 'true' working-directory: differt-core @@ -75,23 +131,32 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: core-wheels-windows-${{ matrix.target }} + name: differt-core-wheels-windows-${{ matrix.platform.target }} path: differt-core/dist macos: - name: Build macOS-${{ matrix.target }} wheels for differt-core - runs-on: macos-latest + name: Build macos-${{ matrix.platform.target}} wheels for differt-core + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x86_64, aarch64] + platform: + - runner: macos-13 + target: x86_64 + - runner: macos-14 + target: aarch64 steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels uses: PyO3/maturin-action@v1 with: - target: ${{ matrix.target }} + target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter sccache: 'true' working-directory: differt-core @@ -99,7 +164,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: core-wheels-macos-${{ matrix.target }} + name: differt-core-wheels-macos-${{ matrix.platform.target }} path: differt-core/dist sdist: @@ -119,17 +184,19 @@ jobs: - name: Upload sdist uses: actions/upload-artifact@v4 with: - name: core-wheels-sdist + name: differt-core-wheels-sdist path: differt-core/dist - release-core: + release-differt-core: + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event.inputs.publish-differt-core name: Release differt-core runs-on: ubuntu-latest - if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event.inputs.publish-differt-core - needs: [linux, windows, macos, sdist] + needs: [linux, musllinux, windows, macos, sdist] environment: release permissions: id-token: write + contents: write + attestations: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -137,22 +204,25 @@ jobs: - name: Download build wheels uses: actions/download-artifact@v4 with: - path: differt-core - pattern: core-wheels-* + path: differt-core/dist + pattern: differt-core-wheels-* + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-path: differt-core/dist/differt-core-wheels-* - name: Publish to PyPI uses: PyO3/maturin-action@v1 with: command: upload - args: --non-interactive --skip-existing core-wheels-*/* + args: --non-interactive --skip-existing dist/differt-core-wheels-*/* working-directory: differt-core - build-and-release: - name: Build and release differt + build-differt: + name: Build DiffeRT runs-on: ubuntu-latest environment: release - permissions: - id-token: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -162,18 +232,49 @@ jobs: with: enable-cache: true - - name: Install dependencies - run: uv sync - - name: Build package - run: uv build --package differt -o dist + run: uv build --package differt -o differt/dist - name: Upload sdist uses: actions/upload-artifact@v4 with: - name: differt-wheels-and-sdist - path: dist + name: differt-wheels-sdist + path: differt/dist/differt-*.tar.gz + + - name: Upload wheels any + uses: actions/upload-artifact@v4 + with: + name: differt-wheels-any + path: differt/dist/differt-*.whl + + release-differt: + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event.inputs.publish-differt + name: Release DiffeRT + runs-on: ubuntu-latest + needs: [build-differt] + environment: release + permissions: + id-token: write + contents: write + attestations: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download build wheels + uses: actions/download-artifact@v4 + with: + path: differt/dist + pattern: differt-wheels-* + merge-multiple: true + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-path: differt/dist/* - name: Publish to PyPI - if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event.inputs.publish-differt uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: differt/dist/ + skip-existing: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8d36b91..2571d383 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: run: uv run --python ${{ matrix.pyversion }} --frozen --no-dev --extra tests-extended pytest - name: Upload to codecov.io - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.DIFFERT_CODECOV_TOKEN }} fail_ci_if_error: true @@ -100,7 +100,7 @@ jobs: run: cargo tarpaulin --verbose --timeout 120 --out xml - name: Upload to codecov.io - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.DIFFERT_CODECOV_TOKEN }} fail_ci_if_error: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8483366a..01bb00b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: args: [--autofix, --trailing-commas] exclude: Cargo.lock - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.1 + rev: v0.8.2 hooks: - id: ruff args: [--fix] @@ -24,7 +24,7 @@ repos: - id: ruff-format types_or: [python, pyi, jupyter] - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.389 + rev: v1.1.390 hooks: - id: pyright - repo: https://github.com/doublify/pre-commit-rust diff --git a/CITATION.cff b/CITATION.cff index 08da29ab..1e9be7ce 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -22,4 +22,4 @@ keywords: - Radio Propagation - Modeling license: MIT -version: v0.0.27 +version: v0.0.29 diff --git a/Cargo.lock b/Cargo.lock index cfeeb09d..bcc0bcf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -146,18 +146,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstyle", "clap_lex", @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "criterion" @@ -238,7 +238,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "differt-core" -version = "0.0.27" +version = "0.0.29" dependencies = [ "criterion", "indexmap", @@ -289,9 +289,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "futures" @@ -424,9 +424,9 @@ checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -467,18 +467,19 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.167" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "linked-hash-map" @@ -762,9 +763,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54b3d09cbdd1f8c20650b28e7b09e338881482f4aa908a5f61a00c98fba2690" +checksum = "e484fd2c8b4cb67ab05a318f1fd6fa8f199fcc30819f08f07d200809dba26c15" dependencies = [ "cfg-if", "indexmap", @@ -781,9 +782,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3015cf985888fe66cfb63ce0e321c603706cd541b7aec7ddd35c281390af45d8" +checksum = "dc0e0469a84f208e20044b98965e1561028180219e35352a2afaf2b942beff3b" dependencies = [ "once_cell", "target-lexicon", @@ -791,9 +792,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fca7cd8fd809b5ac4eefb89c1f98f7a7651d3739dfb341ca6980090f554c270" +checksum = "eb1547a7f9966f6f1a0f0227564a9945fe36b90da5a93b3933fc3dc03fae372d" dependencies = [ "libc", "pyo3-build-config", @@ -812,9 +813,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34e657fa5379a79151b6ff5328d9216a84f55dc93b17b08e7c3609a969b73aa0" +checksum = "fdb6da8ec6fa5cedd1626c886fc8749bdcbb09424a86461eb8cdf096b7c33257" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -824,9 +825,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "295548d5ffd95fd1981d2d3cf4458831b21d60af046b729b6fd143b0ba7aee2f" +checksum = "38a385202ff5a92791168b1136afae5059d3ac118457bb7bc304c197c2d33e7d" dependencies = [ "heck", "proc-macro2", @@ -946,9 +947,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc_version" @@ -961,15 +962,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1076,9 +1077,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1165,9 +1166,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -1176,13 +1177,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn", @@ -1191,9 +1191,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1201,9 +1201,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -1214,15 +1214,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/differt-core/Cargo.toml b/differt-core/Cargo.toml index 0c14b3e3..bc8ee528 100644 --- a/differt-core/Cargo.toml +++ b/differt-core/Cargo.toml @@ -10,14 +10,14 @@ ndarray = {version = "0.16", features = ["rayon"]} numpy = "0.23" obj-rs = "0.7.1" ply-rs = "0.1.3" -pyo3 = {version = "0.23", features = ["indexmap"]} +pyo3 = {version = "0.23.3", features = ["abi3-py39", "indexmap"]} pyo3-log = "0.12" quick-xml = {version = "0.31.0", features = ["serialize"]} serde = {version = "1.0.197", features = ["derive"]} [dev-dependencies] criterion = "0.5.1" -pyo3 = {version = "0.23", features = ["auto-initialize"]} +pyo3 = {version = "0.23.3", features = ["auto-initialize"]} rstest = "0.18.2" testing_logger = "0.1.1" @@ -37,4 +37,4 @@ unexpected_cfgs = {level = "warn", check-cfg = ['cfg(tarpaulin_include)']} edition = "2021" name = "differt-core" rust-version = "1.78.0" -version = "0.0.27" +version = "0.0.29" diff --git a/differt-core/pyproject.toml b/differt-core/pyproject.toml index 6daea3b9..5f82d35a 100644 --- a/differt-core/pyproject.toml +++ b/differt-core/pyproject.toml @@ -30,5 +30,11 @@ requires-python = ">= 3.9" [tool.maturin] bindings = "pyo3" features = ["pyo3/extension-module"] +include = [ + {path = "src/**/*", format = "sdist"}, + {path = "LICENSE.md", format = "sdist"}, + {path = "README.md", format = "sdist"}, +] module-name = "differt_core._lowlevel" python-source = "python" +strip = true diff --git a/differt/pyproject.toml b/differt/pyproject.toml index 78445a58..cec1c7f5 100644 --- a/differt/pyproject.toml +++ b/differt/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ dependencies = [ "beartype>=0.19.0", "chex>=0.1.86", - "differt-core==0.0.27", + "differt-core==0.0.29", "equinox>=0.11.5", "filelock>=3.15.4", "jax>=0.4.32", @@ -69,6 +69,10 @@ exclude = [ "tests", ] +[tool.hatch.build.targets.sdist.force-include] +"../LICENSE.md" = "LICENSE.md" +"../README.md" = "README.md" + [tool.hatch.build.targets.wheel] exclude = [ "conftest.py", diff --git a/differt/tests/conftest.py b/differt/tests/conftest.py index dc663424..9db2ea18 100644 --- a/differt/tests/conftest.py +++ b/differt/tests/conftest.py @@ -55,13 +55,13 @@ def close_figure( monkeypatch: pytest.MonkeyPatch, request: pytest.FixtureRequest ) -> Iterator[None]: if "backend" in request.fixturenames: - _figure = plt.figure + figure_ = plt.figure fig = None @cache def figure() -> Figure: nonlocal fig - fig = _figure() + fig = figure_() return fig with monkeypatch.context() as m: diff --git a/pyproject.toml b/pyproject.toml index 8a2ecc0c..cbf690de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,7 @@ tests-extended = [ allow_dirty = false commit = true commit_args = "" -current_version = "0.0.27" +current_version = "0.0.29" ignore_missing_version = false message = "chore(deps): bump version from {current_version} to {new_version}" parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" diff --git a/uv.lock b/uv.lock index c56d5b89..68da32ea 100644 --- a/uv.lock +++ b/uv.lock @@ -859,7 +859,7 @@ wheels = [ [[package]] name = "differt" -version = "0.0.27" +version = "0.0.29" source = { editable = "differt" } dependencies = [ { name = "beartype" }, @@ -942,7 +942,7 @@ requires-dist = [ [[package]] name = "differt-core" -version = "0.0.27" +version = "0.0.29" source = { editable = "differt-core" } dependencies = [ { name = "numpy", version = "1.26.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" },