Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 #206

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
matrix:
os: [ubuntu-24.04, macos-14]
# Bazel uses hermetic python, these are just placeholders
python-version: ['3_8', '3_9', '3_10', '3_11', '3_12']
python-version: ['3_8', '3_9', '3_10', '3_11', '3_12', '3_13']
steps:
- uses: actions/checkout@v4
# configuring python for bazel abi and platform repo rules
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Python deps
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macos-14]
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ jobs:
os:
[ubuntu-24.04, macos-14]
# Bazel uses hermetic python, these are just placeholders
python-version: ['3_8', '3_9', '3_10', '3_11', '3_12']
python-version: ['3_8', '3_9', '3_10', '3_11', '3_12', '3_13']
steps:
- uses: actions/checkout@v4
# configuring python for bazel abi and platform repo rules
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Python deps
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Version 2.0.6

Feat:

- Add support for Python 3.13

# Version 2.0.5

Feat:
Expand Down
27 changes: 18 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
module(
name = "org_openmined_psi",
version = "2.0.5",
version = "2.0.6",
)

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Core Bazel dependencies from Bazel Central Repository
bazel_dep(name = "abseil-cpp", version = "20240722.0")
bazel_dep(name = "apple_support", version = "1.17.0")
bazel_dep(name = "apple_support", version = "1.17.1")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "boringssl", version = "0.20240913.0")
bazel_dep(name = "gazelle", version = "0.39.0")
bazel_dep(name = "gazelle", version = "0.39.1")
bazel_dep(name = "glog", version = "0.7.1")
bazel_dep(name = "google_benchmark", version = "1.8.5")
bazel_dep(name = "googletest", version = "1.15.2")
bazel_dep(name = "grpc", version = "1.66.0.bcr.2", repo_name = "com_github_grpc_grpc") # aliased for PCJ
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "protobuf", version = "28.2")
bazel_dep(name = "pybind11_bazel", version = "2.12.0")
bazel_dep(name = "rules_apple", version = "3.9.2")
bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "protobuf", version = "28.3")
bazel_dep(name = "pybind11_bazel", version = "2.13.6")
bazel_dep(name = "rules_apple", version = "3.11.2")
bazel_dep(name = "rules_cc", version = "0.0.13")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_java", version = "7.12.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_proto_grpc", version = "5.0.0")
bazel_dep(name = "rules_proto_grpc_cpp", version = "5.0.0")
bazel_dep(name = "rules_proto_grpc_go", version = "5.0.0")
bazel_dep(name = "rules_proto_grpc_python", version = "5.0.0")
bazel_dep(name = "rules_python", version = "0.36.0")
bazel_dep(name = "rules_rust", version = "0.51.0")
bazel_dep(name = "rules_python", version = "0.37.2")
bazel_dep(name = "rules_rust", version = "0.53.0")

## PCJ
http_archive(
Expand All @@ -55,6 +55,9 @@ python.toolchain(
python.toolchain(
python_version = "3.12",
)
python.toolchain(
python_version = "3.13",
)

use_repo(
python,
Expand All @@ -64,6 +67,7 @@ use_repo(
"python_3_10",
"python_3_11",
"python_3_12",
"python_3_13",
# Handy helper for all
"python_versions",
)
Expand Down Expand Up @@ -95,6 +99,11 @@ pip.parse(
python_version = "3.12",
requirements_lock = "//private_set_intersection/python/requirements:requirements_lock_3_12.txt",
)
pip.parse(
hub_name = "psi_deps",
python_version = "3.13",
requirements_lock = "//private_set_intersection/python/requirements:requirements_lock_3_13.txt",
)

python_abi = use_extension("//private_set_intersection/python:extensions.bzl", "python_abi")
use_repo(python_abi, "python_abi")
Expand Down
242 changes: 112 additions & 130 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmined/psi.js",
"version": "2.0.5",
"version": "2.0.6",
"description": "Private Set Intersection for JavaScript",
"repository": {
"type": "git",
Expand Down
26 changes: 26 additions & 0 deletions private_set_intersection/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ load("@python_platform//:platform.bzl", "python_platform")
load("@python_versions//3.10:defs.bzl", py_binary_3_10 = "py_binary", py_test_3_10 = "py_test")
load("@python_versions//3.11:defs.bzl", py_binary_3_11 = "py_binary", py_test_3_11 = "py_test")
load("@python_versions//3.12:defs.bzl", py_binary_3_12 = "py_binary", py_test_3_12 = "py_test")
load("@python_versions//3.13:defs.bzl", py_binary_3_13 = "py_binary", py_test_3_13 = "py_test")
load("@python_versions//3.8:defs.bzl", py_binary_3_8 = "py_binary", py_test_3_8 = "py_test")
load("@python_versions//3.9:defs.bzl", py_binary_3_9 = "py_binary", py_test_3_9 = "py_test")
load("@rules_python//python:packaging.bzl", "py_package", "py_wheel")
Expand Down Expand Up @@ -100,6 +101,18 @@ py_test_3_12(
],
)

py_test_3_13(
name = "test_3_13",
srcs = ["tests.py"],
legacy_create_init = False,
main = "tests.py",
srcs_version = "PY3",
deps = [
":openmined_psi",
requirement("pytest"),
],
)

py_binary_3_8(
name = "benchmark_3_8",
srcs = ["benchmarks.py"],
Expand Down Expand Up @@ -165,6 +178,19 @@ py_binary_3_12(
],
)

py_binary_3_13(
name = "benchmark_3_13",
srcs = ["benchmarks.py"],
legacy_create_init = False,
main = "benchmarks.py",
srcs_version = "PY3",
deps = [
":openmined_psi",
requirement("pytest-benchmark"),
requirement("pytest"),
],
)

py_package(
name = "openmined_psi_pkg",
visibility = ["//visibility:private"],
Expand Down
3 changes: 3 additions & 0 deletions private_set_intersection/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ bazel test --test_output=all //private_set_intersection/python:test_3_9
bazel test --test_output=all //private_set_intersection/python:test_3_10
bazel test --test_output=all //private_set_intersection/python:test_3_11
bazel test --test_output=all //private_set_intersection/python:test_3_12
bazel test --test_output=all //private_set_intersection/python:test_3_13
...
```

Expand All @@ -30,6 +31,7 @@ bazel run -c opt --test_output=all //private_set_intersection/python:benchmark_3
bazel run -c opt --test_output=all //private_set_intersection/python:benchmark_3_10
bazel run -c opt --test_output=all //private_set_intersection/python:benchmark_3_11
bazel run -c opt --test_output=all //private_set_intersection/python:benchmark_3_12
bazel run -c opt --test_output=all //private_set_intersection/python:benchmark_3_13
...
```

Expand All @@ -43,6 +45,7 @@ bazel run //private_set_intersection/python/requirements:requirements_3_9.update
bazel run //private_set_intersection/python/requirements:requirements_3_10.update
bazel run //private_set_intersection/python/requirements:requirements_3_11.update
bazel run //private_set_intersection/python/requirements:requirements_3_12.update
bazel run //private_set_intersection/python/requirements:requirements_3_13.update
...
```

Expand Down
1 change: 1 addition & 0 deletions private_set_intersection/python/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class ABIVersion(Enum):
#
# NOTE: Order matters
python_versions = {
version.parse("3.13.0"): ABIVersion.MANY_LINUX_X_Y,
version.parse("3.12.0"): ABIVersion.MANY_LINUX_X_Y,
version.parse("3.11.0"): ABIVersion.MANY_LINUX_X_Y,
version.parse("3.10.0"): ABIVersion.MANY_LINUX_X_Y,
Expand Down
6 changes: 6 additions & 0 deletions private_set_intersection/python/requirements/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@python_versions//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
load("@python_versions//3.11:defs.bzl", compile_pip_requirements_3_11 = "compile_pip_requirements")
load("@python_versions//3.12:defs.bzl", compile_pip_requirements_3_12 = "compile_pip_requirements")
load("@python_versions//3.13:defs.bzl", compile_pip_requirements_3_13 = "compile_pip_requirements")
load("@python_versions//3.8:defs.bzl", compile_pip_requirements_3_8 = "compile_pip_requirements")
load("@python_versions//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")

Expand Down Expand Up @@ -34,3 +35,8 @@ compile_pip_requirements_3_12(
requirements_txt = "requirements_lock_3_12.txt",
)

compile_pip_requirements_3_13(
name = "requirements_3_13",
src = "requirements.in",
requirements_txt = "requirements_lock_3_13.txt",
)
Loading
Loading