Skip to content
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
81 changes: 24 additions & 57 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
name: Publish to PyPI

on:
workflow_dispatch:
workflow_dispatch:

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_python }} on ${{ matrix.cibw_arch }}
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
cibw_arch: ["x86_64", "aarch64"]
os: [ubuntu-latest, ubuntu-24.04-arm]
env:
CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y"
CIBW_BUILD_VERBOSITY: "1"
Expand All @@ -19,68 +19,35 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
if: matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64'
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v3.0
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: ${{ matrix.cibw_python }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_TEST_SKIP: "*universal2:arm64"
CIBW_BUILD: "cp313-*"
with:
package-dir: ./python
output-dir: ./python/wheelhouse
package-dir: python
output-dir: python/wheelhouse

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./python/wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: cibw-wheels-${{ matrix.os }}
path: python/wheelhouse/*.whl

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.12"

- name: Build sdist
run: |
python -m pip install setuptools-rust setuptools wheel
cd python/
python setup.py sdist

- uses: actions/upload-artifact@v2
with:
name: dist
path: python/dist/*.tar.*

release:
needs: [build_wheels, build_sdist]
needs: [build_wheels]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sqlite-zstd
permissions:
id-token: write
if: github.event_name == 'push' && github.ref_type == 'tag'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: python/dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@v1.8.10
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://pypi.org/project/sqlite-zstd-build
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: python/dist
packages-dir: dist
6 changes: 6 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ Depending on the data, this can reduce the size of the database by 80% while kee
Note that a compression VFS such as https://github.com/mlin/sqlite_zstd_vfs might be suited better depending on the use case. That has very different tradeoffs and capabilities, but the end result is similar.

## Install

From PyPI (if published):
```bash
pip install sqlite-zstd
```
Local:
```bash
pip install .
```

## Usage
```python
Expand Down
11 changes: 10 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.2", "setuptools_scm>=6.2", "setuptools_rust"]
requires = ["setuptools>=64", "setuptools-scm>=8", "setuptools-rust"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -19,3 +19,12 @@ sqlite_zstd = "lib"

[tool.setuptools_scm]
root = ".."

[[tool.setuptools-rust.ext-modules]]
target = "sqlite_zstd.libsqlite_zstd"
path = "../Cargo.toml"
binding = "NoBinding"
features = ["build_extension"]

[tool.distutils.bdist_wheel]
py_limited_api = "cp39"
11 changes: 0 additions & 11 deletions python/setup.py

This file was deleted.

Loading