From 65381a76adb07c3a657f325bb7bfcd06f636b244 Mon Sep 17 00:00:00 2001 From: Gert Hulselmans Date: Mon, 8 Jul 2024 12:08:09 +0200 Subject: [PATCH 1/5] Fix Linux ppc64le build. Fix Linux ppc64le build. --- rust/Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 4aa6b97..4d11941 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -13,4 +13,8 @@ crate-type = ["cdylib"] bgzip = { git = "https://github.com/informationsea/bgzip-rs/", rev = "4492b5d6abb3e191c2eb007f148b704b654d528e", default-features = false, features = ["rust_backend", "rayon", "log"] } itertools = "0.12.1" pyo3 = { version = "0.20.2", features = ["abi3-py38", "extension-module"] } -rust-htslib = { version = "0.45.0", default-features = false, features = ["libdeflate"] } + +[target.'cfg(not(all(target_os = "linux", target_arch = "powerpc64")))'.dependencies] +rust-htslib = { version = "0.47.0", default-features = false, features = ["libdeflate"] } +[target.'cfg(all(target_os = "linux", target_arch = "powerpc64"))'.dependencies] +rust-htslib = { version = "0.47.0", default-features = false } From 98a55b0de121883fca3660a9128871b67e3deead Mon Sep 17 00:00:00 2001 From: Gert Hulselmans Date: Mon, 8 Jul 2024 12:09:08 +0200 Subject: [PATCH 2/5] Update pyo3 and itertools dependencies. Update pyo3 and itertools dependencies. --- rust/Cargo.toml | 4 ++-- rust/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 4d11941..8edd795 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -11,8 +11,8 @@ crate-type = ["cdylib"] [dependencies] bgzip = { git = "https://github.com/informationsea/bgzip-rs/", rev = "4492b5d6abb3e191c2eb007f148b704b654d528e", default-features = false, features = ["rust_backend", "rayon", "log"] } -itertools = "0.12.1" -pyo3 = { version = "0.20.2", features = ["abi3-py38", "extension-module"] } +itertools = "0.13.0" +pyo3 = { version = "0.22.1", features = ["abi3-py38", "extension-module"] } [target.'cfg(not(all(target_os = "linux", target_arch = "powerpc64")))'.dependencies] rust-htslib = { version = "0.47.0", default-features = false, features = ["libdeflate"] } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index cbbb309..2700e4d 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -105,7 +105,7 @@ fn merge_fragment_files( } #[pymodule] -fn _rust_scatac_fragment_tools(_py: Python<'_>, m: &PyModule) -> PyResult<()> { +fn _rust_scatac_fragment_tools(m: &Bound<'_, PyModule>) -> PyResult<()> { // set version dunder m.add("__version__", env!("CARGO_PKG_VERSION"))?; // add functions From e4640809e4beef23053c2dbc0898c239f02aeddf Mon Sep 17 00:00:00 2001 From: Gert Hulselmans Date: Mon, 8 Jul 2024 12:13:23 +0200 Subject: [PATCH 3/5] Update changelog. Update changelog. --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b5579..ac6592d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,16 @@ ### Updated -- **[27b3a059](https://github.com/aertslab/scatac_fragment_tools/commit/27b3a059c23462ebdb7240d10ce4be171cd67ce0)**: Update polars groupby syntax to group_by +- **[27b3a059](https://github.com/aertslab/scatac_fragment_tools/commit/27b3a059c23462ebdb7240d10ce4be171cd67ce0)**: Update Polars `groupby` syntax to `group_by`. +- **[98a55b0d](https://github.com/aertslab/scatac_fragment_tools/commit/98a55b0de121883fca3660a9128871b67e3deead)**: Update pyo3 and itertools dependencies. + +### Fixed + +- **[65381a76](https://github.com/aertslab/scatac_fragment_tools/commit/65381a76adb07c3a657f325bb7bfcd06f636b244)**: Fix building for Linux ppc64le. + ## v0.1.1 ### Added -- **[004a265](https://github.com/aertslab/scatac_fragment_tools/commit/004a2654ecd5ed0a33be78f6fa5789c0a41deafb)**: Allow barcodes to map to multiple cell types while splitting fragments by cell type. \ No newline at end of file +- **[004a265](https://github.com/aertslab/scatac_fragment_tools/commit/004a2654ecd5ed0a33be78f6fa5789c0a41deafb)**: Allow barcodes to map to multiple cell types while splitting fragments by cell type. From 7194973515f702f35c5266b392cb10c67373b1b7 Mon Sep 17 00:00:00 2001 From: Gert Hulselmans Date: Mon, 8 Jul 2024 13:01:37 +0200 Subject: [PATCH 4/5] Update CI runner config. Update CI runner config: maturin generate-ci github --zig --pytest --platform manylinux macos > .github/workflows/CI.yml and add "gcc" and "libc6-dev" to "apt-get install" so "pybigwig" can be installed from source. --- .github/workflows/CI.yml | 98 ++++++++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 30 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2445697..7515fa6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,7 +1,7 @@ -# This file is autogenerated by maturin v1.4.0 +# This file is autogenerated by maturin v1.7.0 # To update, run # -# maturin generate-ci github +# maturin generate-ci github --zig --pytest --platform manylinux macos # name: CI @@ -20,79 +20,117 @@ permissions: jobs: linux: - runs-on: ubuntu-latest + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x86_64, aarch64, ppc64le] + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: aarch64 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 with: - target: ${{ matrix.target }} - args: --release --out dist --zig --find-interpreter + target: ${{ matrix.platform.target }} + args: --release --out dist --zig sccache: 'true' manylinux: auto - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-linux-${{ matrix.platform.target }} path: dist + - name: pytest + if: ${{ startsWith(matrix.platform.target, 'x86_64') }} + shell: bash + run: | + set -e + python3 -m venv .venv + source .venv/bin/activate + pip install scatac_fragment_tools --find-links dist --force-reinstall + pip install pytest + pytest + - name: pytest + if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} + uses: uraimo/run-on-arch-action@v2 + with: + arch: ${{ matrix.platform.target }} + distro: ubuntu22.04 + githubToken: ${{ github.token }} + install: | + apt-get update + apt-get install -y --no-install-recommends python3 python3-pip gcc libc6-dev + pip3 install -U pip pytest + run: | + set -e + pip3 install scatac_fragment_tools --find-links dist --force-reinstall + pytest macos: - runs-on: macos-latest + runs-on: ${{ matrix.platform.runner }} strategy: matrix: - target: [x86_64, aarch64] + platform: + - runner: macos-12 + target: x86_64 + - runner: macos-14 + target: aarch64 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 with: - target: ${{ matrix.target }} - args: --release --out dist --find-interpreter + target: ${{ matrix.platform.target }} + args: --release --out dist sccache: 'true' - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-macos-${{ matrix.platform.target }} path: dist + - name: pytest + run: | + set -e + python3 -m venv .venv + source .venv/bin/activate + pip install scatac_fragment_tools --find-links dist --force-reinstall + pip install pytest + pytest sdist: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build sdist uses: PyO3/maturin-action@v1 with: command: sdist args: --out dist - name: Upload sdist - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-sdist path: dist release: name: Release - environment: release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" needs: [linux, macos, sdist] - permissions: - id-token: write steps: - - uses: actions/download-artifact@v3 - with: - name: wheels + - uses: actions/download-artifact@v4 - name: Publish to PyPI uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: command: upload - args: --non-interactive --skip-existing * + args: --non-interactive --skip-existing wheels-*/* From 472a3cfd9922c1086c002b39941472a295882322 Mon Sep 17 00:00:00 2001 From: Gert Hulselmans Date: Mon, 8 Jul 2024 16:30:26 +0200 Subject: [PATCH 5/5] Install python and zlib headers for testing in CI. Install python zlib headers for testing in CI. --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7515fa6..74bd22d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -64,7 +64,7 @@ jobs: githubToken: ${{ github.token }} install: | apt-get update - apt-get install -y --no-install-recommends python3 python3-pip gcc libc6-dev + apt-get install -y --no-install-recommends python3 python3-dev python3-pip gcc zlib1g-dev pip3 install -U pip pytest run: | set -e