Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
40a3884
Add support for Python 3.14
tibdex Oct 7, 2025
a950e6b
fixup! Add support for Python 3.14
tibdex Oct 7, 2025
a97df9e
fixup! Add support for Python 3.14
tibdex Oct 7, 2025
490e5ac
fixup! Add support for Python 3.14
tibdex Oct 7, 2025
348e3cd
fixup! Add support for Python 3.14
tibdex Oct 7, 2025
d59cc43
fixup! Add support for Python 3.14
tibdex Oct 7, 2025
c9891c6
fixup! Add support for Python 3.14
tibdex Oct 9, 2025
faa1b50
fixup! Add support for Python 3.14
tibdex Oct 9, 2025
84bcd3b
fixup! Add support for Python 3.14
tibdex Oct 9, 2025
0e2865d
Try uv_build backend
tibdex Oct 9, 2025
9f533f0
fixup! Try uv_build backend
tibdex Oct 9, 2025
1b95919
fixup! Try uv_build backend
tibdex Oct 9, 2025
7b79230
fixup! Try uv_build backend
tibdex Oct 9, 2025
92fbfc1
fixup! Try uv_build backend
tibdex Oct 9, 2025
5bfbd73
fixup! Try uv_build backend
tibdex Oct 9, 2025
66fb47a
fixup! Try uv_build backend
tibdex Oct 10, 2025
a6aac64
fixup! Try uv_build backend
tibdex Oct 10, 2025
391967f
fixup! Try uv_build backend
tibdex Oct 10, 2025
1c0ac40
fixup! Try uv_build backend
tibdex Oct 10, 2025
77cb66e
fixup! Try uv_build backend
tibdex Oct 10, 2025
c1c0210
fixup! Try uv_build backend
tibdex Oct 10, 2025
04d8ea5
fixup! Try uv_build backend
tibdex Oct 10, 2025
b2a6dc9
fixup! Try uv_build backend
tibdex Oct 10, 2025
3fcc247
fixup! Try uv_build backend
tibdex Oct 10, 2025
6238a18
Fresh start
tibdex Oct 13, 2025
d8134f2
Switch to miniforge and upgrade conda-build
tibdex Oct 13, 2025
5e2b593
fixup! Switch to miniforge and upgrade conda-build
tibdex Oct 13, 2025
96f11be
Try old conda-build version
tibdex Oct 13, 2025
92a362c
fixup! Try old conda-build version
tibdex Oct 13, 2025
482d604
Try latest conda-build again
tibdex Oct 13, 2025
fa88ccd
Try to remove Windows fix
tibdex Oct 13, 2025
9f23de5
Update runners
tibdex Oct 13, 2025
fc7434e
Remove Conda warning
tibdex Oct 13, 2025
21f148c
Modernize
tibdex Oct 13, 2025
88adb8c
fixup! Modernize
tibdex Oct 13, 2025
9c01f8c
Try something else
tibdex Oct 13, 2025
878e75d
fixup! Try something else
tibdex Oct 14, 2025
63f474e
fixup! Try something else
tibdex Oct 14, 2025
93106a9
fixup! Try something else
tibdex Oct 14, 2025
2425bd2
fixup! Try something else
tibdex Oct 14, 2025
49a8a2c
Polish
tibdex Oct 14, 2025
1fd75a9
Try with fewer Python versions
tibdex Oct 14, 2025
5715370
fixup! Try with fewer Python versions
tibdex Oct 14, 2025
7935388
3.10
tibdex Oct 14, 2025
11b4439
3.14
tibdex Oct 14, 2025
72a59cf
3.13
tibdex Oct 14, 2025
8f3319b
3.12
tibdex Oct 14, 2025
c888098
3.11
tibdex Oct 14, 2025
66f69e2
3.10
tibdex Oct 14, 2025
3d66781
Try something else
tibdex Oct 14, 2025
aac315b
fixup! Try something else
tibdex Oct 14, 2025
34b78d3
fixup! Try something else
tibdex Oct 14, 2025
715c16d
fixup! Try something else
tibdex Oct 14, 2025
17c8a6b
fixup! Try something else
tibdex Oct 14, 2025
f19dcdc
fixup! Try something else
tibdex Oct 14, 2025
fc4a167
fixup! Try something else
tibdex Oct 14, 2025
2ecc419
fixup! Try something else
tibdex Oct 14, 2025
8223dd8
fixup! Try something else
tibdex Oct 14, 2025
612a936
fixup! Try something else
tibdex Oct 14, 2025
25beea5
fixup! Try something else
tibdex Oct 14, 2025
efec83d
fixup! Try something else
tibdex Oct 14, 2025
cf2ef60
fixup! Try something else
tibdex Oct 14, 2025
9040537
fixup! Try something else
tibdex Oct 14, 2025
693860d
fixup! Try something else
tibdex Oct 14, 2025
f0f5de8
fixup! Try something else
tibdex Oct 14, 2025
8fadf07
fixup! Try something else
tibdex Oct 14, 2025
6a94476
fixup! Try something else
tibdex Oct 14, 2025
e0b6223
fixup! Try something else
tibdex Oct 14, 2025
7acec0d
fixup! Try something else
tibdex Oct 14, 2025
832e50b
Reuse workflow
tibdex Oct 14, 2025
b14b327
fixup! Reuse workflow
tibdex Oct 14, 2025
c243dad
fixup! Reuse workflow
tibdex Oct 14, 2025
8fe9aa8
DRY
tibdex Oct 14, 2025
0a0a0d8
fixup! DRY
tibdex Oct 14, 2025
d4fd4b9
fixup! DRY
tibdex Oct 14, 2025
9e3a4b1
Finally!
tibdex Oct 14, 2025
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
21 changes: 13 additions & 8 deletions .github/actions/build-conda-packages/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ runs:
using: composite
steps:
- uses: conda-incubator/setup-miniconda@v3
# Adapted from https://github.com/conda-incubator/setup-miniconda/blob/v3.2.0/README.md#example-14-remove-defaults-channel.
with:
conda-build-version: "24.7.1"
channels: conda-forge
conda-build-version: "25.9.0"
conda-remove-defaults: "true"
miniforge-version: "25.3.1-0"

# See https://github.com/conda/conda/issues/12563#issuecomment-1494264704.
- if: ${{ runner.os == 'Windows' }}
run: echo "LIBARCHIVE=C:\\Miniconda\\Library\\bin\\archive.dll" >> "$GITHUB_ENV"
shell: bash -l {0}

- run: conda build --no-anaconda-upload --output-folder dist .
- run: conda build --output-folder dist .
# See https://github.com/conda-incubator/setup-miniconda/blame/059455a698430d8b68fa317268fa2e3da3492a98/README.md#L609-L610.
shell: bash -l {0}
shell: bash -el {0}

- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: jdk4py-${{ runner.os }}-${{ runner.arch }}-conda-packages
path: dist/*/jdk4py-*.conda
14 changes: 4 additions & 10 deletions .github/actions/build-java-runtime/action.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
name: Build Java runtime
description: Build the Java runtime after installing the required dependencies.
inputs:
python-version:
description: The version of Python to set up.
required: true
description: Build the Java runtime.
runs:
using: composite
steps:
- uses: astral-sh/setup-uv@v5
- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ inputs.python-version }}
version: "0.5.16" # Keep synced with same field in `deployment.yaml`.
version-file: pyproject.toml

- id: get-java-version
run: uv run python -c 'from jdk4py import JAVA_VERSION; print(f"""version={".".join(str(number) for number in JAVA_VERSION)}""")' >> "$GITHUB_OUTPUT"
shell: bash

- uses: actions/setup-java@v4
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ steps.get-java-version.outputs.version }}
Expand Down
20 changes: 20 additions & 0 deletions .github/actions/build-python-wheel/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Remove this action and inline the first step once https://github.com/astral-sh/uv/issues/14827 is closed.
name: Build Python wheel
description: Build platform-specific Python wheel
runs:
using: composite
steps:
- run: uv build --wheel
shell: bash

- run: uv run python -m wheel tags --platform-tag ${{ env.JDK4PY_PLATFORM_TAG }} --remove dist/*-py3-none-any.whl
env:
# Tag values taken from https://pypi.org/project/numpy/2.1.0/#files.
JDK4PY_PLATFORM_TAG: ${{ (runner.os == 'Linux' && runner.arch == 'ARM64' && 'manylinux_2_17_aarch64') || (runner.os == 'Linux' && runner.arch == 'X64' && 'manylinux_2_17_x86_64') || (runner.os == 'macOS' && runner.arch == 'ARM64' && 'macosx_11_0_arm64') || (runner.os == 'macOS' && runner.arch == 'X64' && 'macosx_10_9_x86_64') || (runner.os == 'Windows' && runner.arch == 'X64' && 'win_amd64') || '' }}
shell: bash

- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: jdk4py-${{ runner.os }}-${{ runner.arch }}-python-wheel
path: dist/jdk4py-*.whl
15 changes: 15 additions & 0 deletions .github/actions/install-java-runtime/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Install Java runtime
description: Download the Java runtime artifact and extract it.
runs:
using: composite
steps:
- uses: actions/download-artifact@v5
with:
name: java-runtime-${{ runner.os }}-${{ runner.arch }}

# See https://github.com/actions/upload-artifact/blob/v4.6.2/README.md#permission-loss.
- run: tar -xf artifact.tar
shell: bash

- run: rm artifact.tar
shell: bash
18 changes: 18 additions & 0 deletions .github/workflows/cross-platform-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Cross-platform build
on:
workflow_call

jobs:
build:
strategy:
fail-fast: false
matrix:
runner:
- macos-15-intel
- macos-26
- ubuntu-24.04
- ubuntu-24.04-arm64 # GitHub-hosted larger runner in the ActiveViam organization.
- windows-2025
uses: ./.github/workflows/platform-specific-build.yaml
with:
runner: ${{ matrix.runner }}
79 changes: 0 additions & 79 deletions .github/workflows/deployment.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/platform-specific-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Platform-specific build
on:
workflow_call:
inputs:
runner:
required: true
type: string

jobs:
build-conda-packages:
name: Build Conda packages on ${{ inputs.runner }}
needs: build-java-runtime
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-java-runtime
- uses: ./.github/actions/build-conda-packages

build-java-runtime:
name: Build Java runtime on ${{ inputs.runner }}
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v5

- uses: ./.github/actions/build-java-runtime

# See https://github.com/actions/upload-artifact/blob/v4.6.2/README.md#permission-loss.
- run: tar -cf artifact.tar src/jdk4py/java-runtime/
shell: bash

- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: java-runtime-${{ runner.os }}-${{ runner.arch }}
path: artifact.tar

- run: rm artifact.tar
shell: bash

build-python-wheel:
name: Build Python wheel on ${{ inputs.runner }}
needs: build-java-runtime
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-java-runtime
- uses: astral-sh/setup-uv@v6
with:
version-file: pyproject.toml
- uses: ./.github/actions/build-python-wheel
47 changes: 47 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Conda packages and Python wheels
on:
push:
branches:
- main

jobs:
build:
uses: ./.github/workflows/cross-platform-build.yaml

publish:
environment: deployment
name: Publish Conda packages and Python wheels
needs: build
runs-on: ubuntu-24.04
permissions:
# Required for trusted publishing.
id-token: write
steps:
- uses: actions/checkout@v5

- uses: astral-sh/setup-uv@v6
with:
version-file: pyproject.toml

- uses: actions/download-artifact@v5
with:
merge-multiple: true
path: dist/
pattern: jdk4py-*

- name: Publish Conda packages
env:
JDK4PY_CONDA_CHANNEL_TOKEN: ${{ secrets.CONDA_CHANNEL_TOKEN }}
JDK4PY_CONDA_CHANNEL_URL: ${{ vars.CONDA_CHANNEL_URL }}
JDK4PY_CONDA_CHANNEL_USERNAME: ${{ vars.CONDA_CHANNEL_USERNAME }}
run: |
cd dist/
ls */jdk4py-*.conda | \
while read filepath; do
echo Uploading ${filepath}
curl --fail --user "$JDK4PY_CONDA_CHANNEL_USERNAME":"$JDK4PY_CONDA_CHANNEL_TOKEN" --upload-file ${filepath} "$JDK4PY_CONDA_CHANNEL_URL/$(dirname $filepath)/"
done
shell: bash

- name: Publish Python wheels
run: uv publish
84 changes: 10 additions & 74 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,81 +4,17 @@ on:
types: [opened, synchronize]

jobs:
build:
uses: ./.github/workflows/cross-platform-build.yaml

test:
name: Test on ${{ matrix.runner }} with Python ${{ matrix.python }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- macos-13 # x64
- macos-14 # arm64
- ubuntu-24.04
- ubuntu-24.04-arm64 # GitHub-hosted larger runner in the ActiveViam organization.
- windows-2022
python:
- "3.10"
include:
- runner: ubuntu-24.04
python: "3.11"
- runner: ubuntu-24.04
python: "3.12"
- runner: ubuntu-24.04
python: "3.13"
fail-fast: false
name: Test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v5
- uses: ./.github/actions/build-java-runtime
with:
python-version: ${{ matrix.python}}

- run: uv build --wheel

# No need to test each platform and Python version.
- if: ${{ matrix.runner == 'ubuntu-24.04' && matrix.python == '3.10' }}
run: uv run ruff format --check

# No need to test each platform and Python version.
- if: ${{ matrix.runner == 'ubuntu-24.04' && matrix.python == '3.10' }}
run: uv run ruff check

# No need to test each platform and Python version.
- if: ${{ matrix.runner == 'ubuntu-24.04' && matrix.python == '3.10' }}
run: uv run mypy

- run: uv run ruff format --check
- run: uv run ruff check
- run: uv run ty check
# This is also tested on all supported OS/arch combinations by `conda build`.
- run: uv run pytest

# The Python wheels are not tied to a specific Python version.
- if: ${{ matrix.python == '3.10' }}
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: jdk4py-${{ matrix.runner }}-python-wheel
path: dist/jdk4py-*.whl

conda-package:
name: Test Conda packaging on ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- macos-13 # x64
- macos-14 # arm64
- ubuntu-24.04
- ubuntu-24.04-arm64 # GitHub-hosted larger runner in the ActiveViam organization.
- windows-2022
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/build-java-runtime
with:
# No need to test each Python version.
python-version: "3.10"

- uses: ./.github/actions/build-conda-packages

- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: jdk4py-${{ matrix.runner }}-conda-packages
path: dist/*/jdk4py-*.tar.bz2
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"recommendations": [
"astral-sh.ty",
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"ms-python.python",
"tamasfe.even-better-toml"
"tamasfe.even-better-toml",
]
}
Loading
Loading