Skip to content

Commit d67ee7d

Browse files
authored
deterministic wheel names (#201)
* add * fix * update
1 parent 998b7a9 commit d67ee7d

File tree

8 files changed

+2487
-100
lines changed

8 files changed

+2487
-100
lines changed

.github/workflows/CD.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ jobs:
4848
python-version: ['3_8', '3_9', '3_10', '3_11']
4949
steps:
5050
- uses: actions/checkout@v4
51+
# configuring python for bazel abi and platform repo rules
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: '3.11'
56+
- name: Python deps
57+
run: |
58+
python -m pip install --upgrade pip
59+
pip install --upgrade packaging
5160
- name: Run tests nix
5261
timeout-minutes: 30
5362
run: bazel test --test_output=all //private_set_intersection/python:test_${{ matrix.python-version }}
@@ -99,7 +108,7 @@ jobs:
99108
matrix:
100109
# Handling boundary conditions of: https://github.com/pypa/manylinux
101110
python-version: ['3.8.0', '3.8.4', '3.9.0']
102-
os: [ubuntu-20.04]
111+
os: [ubuntu-20.04, macos-12]
103112
steps:
104113
- uses: actions/checkout@v4
105114
- name: Set up Python
@@ -112,18 +121,17 @@ jobs:
112121
TWINE_PASSWORD: ${{ secrets.OM_PSI_PYPI_TOKEN }}
113122
run: |
114123
python -m pip install --upgrade pip
115-
pip install twine packaging
116-
bazel build -c opt //private_set_intersection/python:wheel
117-
python private_set_intersection/python/rename.py
118-
twine upload --skip-existing bazel-bin/private_set_intersection/python/openmined_psi-*
124+
pip install --upgrade packaging
125+
bazel run -c opt //private_set_intersection/python:wheel.publish -- --verbose --skip-existing
126+
119127
Publish-python:
120128
needs: [Core, JS, Go, Python, Rust]
121129
if: ${{ github.event_name == 'release' }}
122130
runs-on: ${{ matrix.os }}
123131
strategy:
124132
matrix:
125133
python-version: ['3.8', '3.9', '3.10', '3.11']
126-
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macos-14]
134+
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macos-14, macos-12]
127135
steps:
128136
- uses: actions/checkout@v4
129137
- name: Set up Python
@@ -136,7 +144,5 @@ jobs:
136144
TWINE_PASSWORD: ${{ secrets.OM_PSI_PYPI_TOKEN }}
137145
run: |
138146
python -m pip install --upgrade pip
139-
pip install twine packaging
140-
bazel build -c opt //private_set_intersection/python:wheel
141-
python private_set_intersection/python/rename.py
142-
twine upload --skip-existing bazel-bin/private_set_intersection/python/openmined_psi-*
147+
pip install --upgrade packaging
148+
bazel run -c opt //private_set_intersection/python:wheel.publish -- --verbose --skip-existing

.github/workflows/CI.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ jobs:
125125
python-version: ['3_8', '3_9', '3_10', '3_11']
126126
steps:
127127
- uses: actions/checkout@v4
128+
# configuring python for bazel abi and platform repo rules
129+
- name: Set up Python
130+
uses: actions/setup-python@v5
131+
with:
132+
python-version: '3.11'
133+
- name: Python deps
134+
run: |
135+
python -m pip install --upgrade pip
136+
pip install --upgrade packaging
128137
- name: Run tests nix
129138
timeout-minutes: 30
130139
run: bazel test --test_output=all //private_set_intersection/python:test_${{ matrix.python-version }}

MODULE.bazel

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@ use_repo(
7070
"python_versions",
7171
)
7272

73-
register_toolchains(
74-
"@python_3_8//:all",
75-
"@python_3_9//:all",
76-
"@python_3_10//:all",
77-
"@python_3_11//:all",
78-
"@python_3_12//:all",
79-
)
80-
8173
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
8274
use_repo(pip, "psi_deps")
8375
pip.parse(
@@ -106,6 +98,12 @@ pip.parse(
10698
requirements_lock = "//private_set_intersection/python/requirements:requirements_lock_3_12.txt",
10799
)
108100

101+
python_abi = use_extension("//private_set_intersection/python:extensions.bzl", "python_abi")
102+
use_repo(python_abi, "python_abi")
103+
104+
python_platform = use_extension("//private_set_intersection/python:extensions.bzl", "python_platform")
105+
use_repo(python_platform, "python_platform")
106+
109107
## Rust
110108
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
111109
rust.toolchain(

0 commit comments

Comments
 (0)