diff --git a/popgetter_py/.github/workflows/CI.yml b/.github/workflows/python.yml similarity index 65% rename from popgetter_py/.github/workflows/CI.yml rename to .github/workflows/python.yml index a213727..7bcbef8 100644 --- a/popgetter_py/.github/workflows/CI.yml +++ b/.github/workflows/python.yml @@ -3,13 +3,12 @@ # # maturin generate-ci github # -name: CI +name: Python on: push: branches: - main - - master tags: - '*' pull_request: @@ -18,22 +17,31 @@ on: permissions: contents: read +defaults: + run: + working-directory: popgetter_py + jobs: linux: runs-on: ubuntu-latest strategy: matrix: - target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] + target: [x86_64, x86, aarch64] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' + - name: Install OpenSSL (dev) + run: | + sudo apt-get update + sudo apt-get install pkg-config libssl-dev - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} args: --release --out dist --find-interpreter + working-directory: popgetter_py sccache: 'true' manylinux: auto - name: Upload wheels @@ -41,6 +49,7 @@ jobs: with: name: wheels-linux-${{ matrix.target }} path: dist + working-directory: popgetter_py windows: runs-on: windows-latest @@ -51,19 +60,21 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' architecture: ${{ matrix.target }} - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} args: --release --out dist --find-interpreter + working-directory: popgetter_py sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 with: name: wheels-windows-${{ matrix.target }} path: dist + working-directory: popgetter_py macos: runs-on: macos-latest @@ -74,18 +85,20 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} args: --release --out dist --find-interpreter + working-directory: popgetter_py sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 with: name: wheels-macos-${{ matrix.target }} path: dist + working-directory: popgetter_py sdist: runs-on: ubuntu-latest @@ -96,23 +109,26 @@ jobs: with: command: sdist args: --out dist + working-directory: popgetter_py - name: Upload sdist uses: actions/upload-artifact@v4 with: name: wheels-sdist path: dist + working-directory: popgetter_py - release: - name: Release - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - needs: [linux, windows, macos, sdist] - steps: - - 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 wheels-*/* + # TODO: uncomment for release to PyPI + # release: + # name: Release + # runs-on: ubuntu-latest + # if: startsWith(github.ref, 'refs/tags/') + # needs: [linux, windows, macos, sdist] + # steps: + # - 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 wheels-*/* diff --git a/Cargo.lock b/Cargo.lock index 9af1997..cbd5f09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2146,6 +2146,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.3.1+3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.102" @@ -2154,6 +2163,7 @@ checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -2859,6 +2869,7 @@ name = "popgetter_py" version = "0.1.0" dependencies = [ "anyhow", + "openssl", "polars", "popgetter", "pyo3", diff --git a/popgetter_py/Cargo.toml b/popgetter_py/Cargo.toml index e92a73e..006db75 100644 --- a/popgetter_py/Cargo.toml +++ b/popgetter_py/Cargo.toml @@ -10,6 +10,8 @@ crate-type = ["cdylib"] [dependencies] anyhow = { workspace = true } +# Added directly with "vendored" feature for maturin-action to work: https://github.com/PyO3/maturin-action/discussions/78 +openssl = { version = "0.10", features = ["vendored"] } polars = { workspace = true, features = ["lazy", "is_in", "http", "streaming", "parquet", "polars-io", "regex", "strings", "rows"] } popgetter = { path = "../popgetter" } pyo3 = { workspace = true, features = ["experimental-async"] }