Skip to content
Open
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: 3 additions & 1 deletion .github/workflows/build_and_publish_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.14t"]
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-14, windows-2022]
is-ci-tests:
- ${{ inputs.is_ci_tests }}
Expand All @@ -48,6 +48,8 @@ jobs:
os: windows-2022
- python-version: "3.14"
os: ubuntu-22.04-arm
- python-version: "3.14t"
os: ubuntu-22.04

env:
USE_BAZEL_VERSION: "7.2.1"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ changes. Best viewed [here](https://google-grain.readthedocs.io/en/latest/change
* New features:
* Adds automated batching into shared memory when multiprocess prefetch is
used to save one data copy.
* Add Python 3.14 free threaded build.

* Breaking changes:

Expand Down
3 changes: 2 additions & 1 deletion grain/oss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ FROM quay.io/pypa/${AUDITWHEEL_PLATFORM}
LABEL maintainer="Grain team <grain-dev@google.com>"

ARG PYTHON_VERSION
ARG PYTHON_BASE_VERSION
ARG BAZEL_VERSION

ENV DEBIAN_FRONTEND=noninteractive

RUN ulimit -n 1024 && yum install -y rsync

ENV PYTHON_BIN_PATH=/opt/python/cp${PYTHON_VERSION}-cp${PYTHON_VERSION}/bin
ENV PYTHON_BIN_PATH=/opt/python/cp${PYTHON_BASE_VERSION}-cp${PYTHON_VERSION}/bin
ENV PATH="${PYTHON_BIN_PATH}:${PATH}"

ENV PYTHON_BIN=${PYTHON_BIN_PATH}/python
Expand Down
14 changes: 12 additions & 2 deletions grain/oss/build_whl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@ main() {
write_to_bazelrc "build:macos --action_env=CC=clang"
write_to_bazelrc "build:macos --action_env=CXX=clang++"

write_to_bazelrc "build --@rules_python//python/config_settings:python_version=${PYTHON_VERSION}"
BAZEL_PYTHON_VERSION="${PYTHON_VERSION}"
case "${PYTHON_VERSION}" in
*t)
BAZEL_PYTHON_VERSION="${PYTHON_VERSION%t}"
write_to_bazelrc "build --@rules_python//python/config_settings:py_freethreaded=yes"
write_to_bazelrc "test --@rules_python//python/config_settings:py_freethreaded=yes"
write_to_bazelrc "test --test_env=PYTHON_GIL=0"
;;
esac

write_to_bazelrc "build --@rules_python//python/config_settings:python_version=${BAZEL_PYTHON_VERSION}"
# Set platform-wise file extension for extension modules.
case "$(uname)" in
CYGWIN*|MINGW*|MSYS_NT*)
Expand All @@ -47,7 +57,7 @@ main() {
;;
esac

write_to_bazelrc "test --@rules_python//python/config_settings:python_version=${PYTHON_VERSION}"
write_to_bazelrc "test --@rules_python//python/config_settings:python_version=${BAZEL_PYTHON_VERSION}"
write_to_bazelrc "test --action_env PYTHON_VERSION=${PYTHON_VERSION}"
write_to_bazelrc "test --test_timeout=300"

Expand Down
2 changes: 2 additions & 0 deletions grain/oss/runner_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ build_and_test_grain() {
AUDITWHEEL_PLATFORM='manylinux_2_28_'"$(uname -m)"
docker rmi -f grain:${PYTHON_VERSION}
docker rm -f grain
PYTHON_BASE_VERSION="${PYTHON_MAJOR_VERSION}${PYTHON_MINOR_VERSION%t}"
DOCKER_BUILDKIT=1 docker build --progress=plain --no-cache \
--build-arg AUDITWHEEL_PLATFORM="${AUDITWHEEL_PLATFORM}" \
--build-arg PYTHON_VERSION="${PYTHON_MAJOR_VERSION}""${PYTHON_MINOR_VERSION}" \
--build-arg PYTHON_BASE_VERSION="${PYTHON_BASE_VERSION}" \
--build-arg BAZEL_VERSION="${BAZEL_VERSION}" \
-t grain:"${PYTHON_VERSION}" "${SOURCE_DIR}"'/grain/oss'

Expand Down
Loading