Skip to content

Commit

Permalink
chore: add test python 3.13 for binding (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Dec 4, 2024
1 parent 057767a commit 517d1d9
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 44 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/bindings.nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ jobs:
include:
- { target: x86_64-unknown-linux-gnu, runner: ubuntu-20.04 }
- { target: aarch64-unknown-linux-gnu, runner: ubuntu-20.04 }
- { target: aarch64-unknown-linux-musl, runner: ubuntu-latest }
- { target: x86_64-unknown-linux-musl, runner: ubuntu-latest }
# FIXME: tmp disable for build issue
# - { target: x86_64-pc-windows-msvc, runner: windows-latest }
# - { target: aarch64-pc-windows-msvc, runner: windows-latest }
- { target: aarch64-unknown-linux-musl, runner: ubuntu-latest }
- { target: x86_64-pc-windows-msvc, runner: windows-latest }
- { target: aarch64-pc-windows-msvc, runner: windows-latest }
- { target: x86_64-apple-darwin, runner: macos-latest }
- { target: aarch64-apple-darwin, runner: macos-latest }
steps:
Expand Down Expand Up @@ -92,10 +91,11 @@ jobs:
NAPI_TARGET: ${{ matrix.target }}
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
pnpm run build:debug
pnpm napi build --platform --target=$NAPI_TARGET --js generated.js
else
pnpm run build
pnpm napi build --platform --target=$NAPI_TARGET --release --js generated.js
fi
pnpm node ./scripts/header.js
- name: strip for macos
if: endsWith(matrix.target, '-apple-darwin')
working-directory: bindings/nodejs
Expand All @@ -111,7 +111,6 @@ jobs:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment:
name: npmjs.com
Expand Down Expand Up @@ -145,9 +144,9 @@ jobs:
run: cp LICENSE ./bindings/nodejs
- name: Publish
working-directory: bindings/nodejs
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public --provenance
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public --provenance
8 changes: 4 additions & 4 deletions .github/workflows/bindings.python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install dependencies
working-directory: bindings/python
run: pip install ruff
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
Expand Down Expand Up @@ -135,7 +135,6 @@ jobs:
needs: [check, build, integration]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment:
name: pypi.org
Expand All @@ -147,7 +146,8 @@ jobs:
path: bindings/python/artifacts
pattern: bindings-python-*
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: bindings/python/artifacts
56 changes: 32 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ jobs:
strategy:
matrix:
include:
- { os: macos, target: aarch64-apple-darwin }
- { os: macos, target: x86_64-apple-darwin }
- { os: windows, target: aarch64-pc-windows-msvc }
- { os: windows, target: x86_64-pc-windows-msvc }
- os: macos
target: aarch64-apple-darwin
- os: macos
target: x86_64-apple-darwin
- os: windows
target: aarch64-pc-windows-msvc
- os: windows
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -103,32 +107,38 @@ jobs:
strategy:
matrix:
include:
- { packager: apk, arch: amd64, target: x86_64-unknown-linux-musl }
- { packager: apk, arch: arm64, target: aarch64-unknown-linux-musl }
- { packager: deb, arch: amd64, target: x86_64-unknown-linux-musl }
- { packager: deb, arch: arm64, target: aarch64-unknown-linux-musl }
- { packager: rpm, arch: amd64, target: x86_64-unknown-linux-musl }
- { packager: rpm, arch: arm64, target: aarch64-unknown-linux-musl }
- {
packager: archlinux,
arch: amd64,
target: x86_64-unknown-linux-gnu,
}
- {
packager: archlinux,
arch: arm64,
target: aarch64-unknown-linux-gnu,
}
- packager: apk
arch: amd64
target: x86_64-unknown-linux-musl
- packager: apk
arch: arm64
target: aarch64-unknown-linux-musl
- packager: deb
arch: amd64
target: x86_64-unknown-linux-musl
- packager: deb
arch: arm64
target: aarch64-unknown-linux-musl
- packager: rpm
arch: amd64
target: x86_64-unknown-linux-musl
- packager: rpm
arch: arm64
target: aarch64-unknown-linux-musl
- packager: archlinux
arch: amd64
target: x86_64-unknown-linux-gnu
- packager: archlinux
arch: arm64
target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4

- name: Setup nfpm
shell: bash
run: |
curl -sSfLo /tmp/nfpm.tar.gz https://github.com/goreleaser/nfpm/releases/download/v2.28.0/nfpm_2.28.0_Linux_x86_64.tar.gz
tar -xzf /tmp/nfpm.tar.gz -C /tmp
sudo mv /tmp/nfpm /usr/local/bin/nfpm
- name: Download
shell: bash
env:
Expand All @@ -137,14 +147,12 @@ jobs:
mkdir -p dist/pkg
gh release download ${{ github.ref_name }} --pattern "bendsql-${{ matrix.target }}.tar.gz" --dir dist/
tar -xzf dist/bendsql-${{ matrix.target }}.tar.gz -C dist/
- name: Package
shell: bash
run: |
arch=${{ matrix.arch }}
version=${{ github.ref_name }}
nfpm package --packager ${{ matrix.packager }} --target dist/pkg/ -f <(envsubst '${arch} ${version}' < nfpm.yaml)
- name: Publish
shell: bash
env:
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ behave = "*"
ruff = "*"

[requires]
python_version = "3.11"
python_version = "3.12"
6 changes: 2 additions & 4 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ description = "Databend Driver Python Binding"
license = { text = "Apache-2.0" }
name = "databend-driver"
readme = "README.md"
# PyO3 doesn't support python 3.13 yet.
# ref: https://github.com/apache/opendal/issues/4268
requires-python = ">=3.7, < 3.13"
requires-python = ">=3.7, < 3.14"

[project.optional-dependencies]
docs = ["pdoc"]
test = ["behave"]
lint = ["black", "flake8"]
lint = ["ruff"]

[project.urls]
Repository = "https://github.com/databendlabs/bendsql"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable-2024-11-28"
channel = "stable"
components = ["rustfmt", "clippy"]

0 comments on commit 517d1d9

Please sign in to comment.