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

Python support 3.11 #199

Merged
merged 22 commits into from
Sep 30, 2024
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
5 changes: 4 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# There are many warnings that lead to errors on Clang and GCC (maybe even MSVC)
# because of the compiler and version disparity, we're opting to eat the risk and silence all warnings
build --cxxopt="-std=c++17" --copt="-w"
build --cxxopt="-std=c++17" --copt="-w" --experimental_isolated_extension_usages

build:wasm --incompatible_enable_cc_toolchain_resolution=false
build:wasm --platforms=@emsdk//:platform_wasm
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.0
7.3.1
55 changes: 19 additions & 36 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,23 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-24.04, macos-14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 60
run: .github/workflows/scripts/run_tests_core.sh
- name: Linters
run: .github/workflows/scripts/lint_cpp.sh
if: ${{ matrix.os == 'ubuntu-22.04' }}
if: ${{ matrix.os == 'ubuntu-24.04' }}

JS:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-24.04, macos-14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 60
run: .github/workflows/scripts/run_tests_js.sh
Expand All @@ -49,26 +43,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
python-version: ['3.8', '3.9', '3.10']
os: [ubuntu-24.04, macos-14]
# Bazel uses hermetic python, these are just placeholders
python-version: ['3_8', '3_9', '3_10', '3_11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 30
run: .github/workflows/scripts/run_tests_python.sh
- name: Python linters
run: .github/workflows/scripts/lint_python.sh
run: bazel test --test_output=all //private_set_intersection/python:test_${{ matrix.python-version }}

Go:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
golang-version: ['1.19', '1.20', '1.21']
os: [ubuntu-24.04, macos-14]
golang-version: ['1.21']
steps:
- name: Set up Golang ${{ matrix.golang-version }}
uses: actions/setup-go@v5
Expand All @@ -77,10 +66,7 @@ jobs:
id: go
- name: Install Go dependencies
run: go install golang.org/x/lint/golint@latest
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 30
run: .github/workflows/scripts/run_tests_go.sh
Expand All @@ -91,17 +77,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-24.04, macos-14]
steps:
- name: Install toolchains
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 30
run: .github/workflows/scripts/run_tests_rust.sh
Expand All @@ -118,7 +101,7 @@ jobs:
python-version: ['3.8.0', '3.8.4', '3.9.0']
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -139,10 +122,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
os: [ubuntu-22.04, ubuntu-20.04, macos-12]
python-version: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macos-14, macos-14-large]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
58 changes: 25 additions & 33 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
python: ${{ steps.filter.outputs.python }}
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
Expand All @@ -48,6 +48,8 @@ jobs:
- '.clang-format'
- '.bazelrc'
- '.bazelversion'
- 'MODULE.bazel'
- 'MODULE.bazel.lock'
- 'WORKSPACE'
go:
- 'private_set_intersection/go/**'
Expand All @@ -62,51 +64,51 @@ jobs:
- '.eslint*'
- '.bazelrc'
- '.bazelversion'
- 'MODULE.bazel'
- 'MODULE.bazel.lock'
- 'WORKSPACE'
python:
- 'private_set_intersection/python/**'
- '.flake8'
- '.pyproject.toml'
- '.bazelrc'
- '.bazelversion'
- 'MODULE.bazel'
- 'MODULE.bazel.lock'
- 'WORKSPACE'
rust:
- 'private_set_intersection/rust/**'
- 'third_party/**'
- '.bazelrc'
- '.bazelversion'
- 'MODULE.bazel'
- 'MODULE.bazel.lock'
- 'WORKSPACE'
Core:
needs: changes
if: ${{ needs.changes.outputs.core == 'true' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-24.04, macos-14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 60
run: .github/workflows/scripts/run_tests_core.sh
- name: Linters
run: .github/workflows/scripts/lint_cpp.sh
if: ${{ matrix.os == 'ubuntu-22.04' }}
if: ${{ matrix.os == 'ubuntu-24.04' }}

JS:
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.javascript == 'true' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-24.04, macos-14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 60
run: .github/workflows/scripts/run_tests_js.sh
Expand All @@ -117,28 +119,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
python-version: ['3.8', '3.9', '3.10']
os:
[ubuntu-24.04, macos-14]
# Bazel uses hermetic python, these are just placeholders
python-version: ['3_8', '3_9', '3_10', '3_11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 30
run: .github/workflows/scripts/run_tests_python.sh
- name: Python linters
run: .github/workflows/scripts/lint_python.sh
run: bazel test --test_output=all //private_set_intersection/python:test_${{ matrix.python-version }}

Go:
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.go == 'true' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
golang-version: ['1.19', '1.20', '1.21']
os: [ubuntu-24.04, macos-14]
golang-version: ['1.23']
steps:
- name: Set up Golang ${{ matrix.golang-version }}
uses: actions/setup-go@v5
Expand All @@ -147,10 +145,7 @@ jobs:
id: go
- name: Install Go dependencies
run: go install golang.org/x/lint/golint@latest
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 30
run: .github/workflows/scripts/run_tests_go.sh
Expand All @@ -163,17 +158,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-24.04, macos-14]
steps:
- name: Install toolchains
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
- name: Run tests nix
timeout-minutes: 30
run: .github/workflows/scripts/run_tests_rust.sh
13 changes: 0 additions & 13 deletions .github/workflows/scripts/lint_python.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/scripts/run_tests_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

# C++
bazel test -c opt --test_output=all //private_set_intersection/cpp/...
bazel test --test_output=all //private_set_intersection/cpp/...

# C
bazel test -c opt --test_output=all //private_set_intersection/c/...
bazel test --test_output=all //private_set_intersection/c/...
2 changes: 1 addition & 1 deletion .github/workflows/scripts/run_tests_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e

# Go
bazel test -c opt --test_output=all //private_set_intersection/go/...
bazel test --test_output=all //private_set_intersection/go/...
6 changes: 1 addition & 5 deletions .github/workflows/scripts/run_tests_js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ set -e
# JavaScript
npm install

bazel build -c opt //private_set_intersection/javascript/cpp:psi_wasm_node.js
bazel build -c opt //private_set_intersection/javascript/cpp:psi_wasm_web.js
bazel build -c opt //private_set_intersection/javascript/cpp:psi_wasm_worker.js

npm run build:copy
npm run build
npm run build:proto
npm run compile
npm run test
7 changes: 0 additions & 7 deletions .github/workflows/scripts/run_tests_python.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/scripts/run_tests_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e

# Rust
bazel test -c opt --test_output=all //private_set_intersection/rust/...
bazel test --test_output=all //private_set_intersection/rust/...
19 changes: 19 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Version 2.0.3

Feat:

- Add support for python 3.11
- Add support for Mac ARM64 builds

Chore:

- Use Bazel 7.3.1 with `bzlmod`
- Updated all Bazel dependencies for all languages.
- Updated the fork of private_join_and_compute (PCJ) to use Bazel 7+
with`bzlmod` and updated all dependencies.
- Refactored CI/CD scripts to remove explicit python version in CI/CD as Bazel
can pick up the local python within the runner. Tests on Python are hermetic
so the local version is only important when publishing wheels.
- Minor fixes that the cpp linter was reporting and a fix in the python cpp
bindings to use absl::MakeSpan instead of passing a std::vector.

# Version 2.0.2

Chore:
Expand Down
Loading
Loading