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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ jobs:
run: make python-docs-build

go-sdk:
# The fork consumes only the Rust crate and Python package.
if: github.repository == 'tobilg/polyglot'
needs: rust-test
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -188,6 +190,8 @@ jobs:
run: cd packages/go && POLYGLOT_SQL_FFI_PATH="../../target/ffi_release/libpolyglot_sql_ffi.so" go test ./...

sdk-build:
# The fork consumes only the Rust crate and Python package.
if: github.repository == 'tobilg/polyglot'
needs: rust-test
runs-on: ubuntu-latest
env:
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/python-fork-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name: Python fork release
on:
push:
tags: ['python-v*']
# Build and smoke-test every wheel without publishing.
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/python-fork-release.yml'
- 'crates/polyglot-sql-python/Cargo.toml'
- 'crates/polyglot-sql-python/pyproject.toml'

permissions:
contents: read
Expand Down Expand Up @@ -30,19 +37,23 @@ jobs:
steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Build wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: '2014'
args: --profile python_release --out dist --find-interpreter --manifest-path crates/polyglot-sql-python/Cargo.toml
args: --profile python_release --out dist --features abi3 --manifest-path crates/polyglot-sql-python/Cargo.toml
sccache: true

- name: Smoke test wheel
if: matrix.target == 'x86_64'
run: |
version="${GITHUB_REF_NAME#python-v}"
python -m pip install --no-index --find-links dist "polyglot-sql-chio==${version}"
ls dist/*-abi3-*.whl
python -m pip install --no-index --find-links dist polyglot-sql-chio
python -c "import polyglot_sql; assert polyglot_sql.parse_one('SELECT 1', dialect='postgres')"

- name: Upload wheel
Expand All @@ -65,17 +76,21 @@ jobs:
steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Build wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --profile python_release --out dist --find-interpreter --manifest-path crates/polyglot-sql-python/Cargo.toml
args: --profile python_release --out dist --features abi3 --manifest-path crates/polyglot-sql-python/Cargo.toml
sccache: true

- name: Smoke test wheel
run: |
version="${GITHUB_REF_NAME#python-v}"
python -m pip install --no-index --find-links dist "polyglot-sql-chio==${version}"
ls dist/*-abi3-*.whl
python -m pip install --no-index --find-links dist polyglot-sql-chio
python -c "import polyglot_sql; assert polyglot_sql.parse_one('SELECT 1', dialect='postgres')"

- name: Upload wheel
Expand All @@ -90,20 +105,23 @@ jobs:
steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Build wheel
uses: PyO3/maturin-action@v1
env:
SCCACHE_IGNORE_SERVER_IO_ERROR: '1'
with:
target: x86_64-pc-windows-msvc
args: --profile python_release --out dist --find-interpreter --manifest-path crates/polyglot-sql-python/Cargo.toml
args: --profile python_release --out dist --features abi3 --manifest-path crates/polyglot-sql-python/Cargo.toml
sccache: true

- name: Smoke test wheel
shell: pwsh
run: |
$version = $env:GITHUB_REF_NAME.Substring('python-v'.Length)
python -m pip install --no-index --find-links dist "polyglot-sql-chio==$version"
python -m pip install --no-index --find-links dist polyglot-sql-chio
python -c "import polyglot_sql; assert polyglot_sql.parse_one('SELECT 1', dialect='postgres')"

- name: Upload wheel
Expand Down Expand Up @@ -131,6 +149,7 @@ jobs:
path: dist

publish:
if: github.event_name == 'push'
needs: [wheels-linux, wheels-macos, wheels-windows, sdist]
runs-on: ubuntu-latest
permissions:
Expand Down
1 change: 1 addition & 0 deletions crates/polyglot-sql-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ default = []
function-catalog-clickhouse = ["polyglot-sql/function-catalog-clickhouse"]
function-catalog-duckdb = ["polyglot-sql/function-catalog-duckdb"]
function-catalog-all-dialects = ["polyglot-sql/function-catalog-all-dialects"]
abi3 = ["pyo3/abi3-py312"]

[dependencies]
polyglot-sql = { path = "../polyglot-sql" }
Expand Down
5 changes: 1 addition & 4 deletions crates/polyglot-sql-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ["version"]
description = "Rust-powered SQL transpiler for more than 30 SQL dialects. Parse, generate, transpile, format, and validate SQL."
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.9"
requires-python = ">=3.12"
keywords = ["sql", "transpiler", "parser", "dialect", "database"]
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -17,9 +17,6 @@ classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Database",
Expand Down
Loading