Skip to content

Commit

Permalink
Support new PEP 600 tagging for Python wheels (#150)
Browse files Browse the repository at this point in the history
* fix

* add ubuntu 20.04 to CD

* fix
  • Loading branch information
s0l0ist authored Jan 9, 2023
1 parent bba6389 commit ea464f5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
os: [ubuntu-22.04, macos-12]
os: [ubuntu-22.04, ubuntu-20.04, macos-12]
steps:
- uses: actions/checkout@v3
- name: Set up Python
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 1.0.3

Bugfix:

- The Python builds were using the older `manylinux2014` tagging convention which was causing issues on systems that expected a specific glibc version (Ubuntu 20.04 uses [2.31](https://launchpad.net/ubuntu/+source/glibc)). We now use the latest `manylinux_x_y` tagging convention to accomodate different glibc versions across linux when building wheels. This means we must support `python 3.8.10+, 3.9.5+, 3.10.0+` and `pip >= 20.3` in accordance with [PEP 600](https://github.com/pypa/manylinux)

# Version 1.0.2

Feat:
Expand Down
2 changes: 1 addition & 1 deletion 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": "1.0.2",
"version": "1.0.3",
"description": "Private Set Intersection for JavaScript",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions private_set_intersection/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ py_wheel(
"@bazel_tools//src/conditions:windows_arm64": "win_arm64",
"@bazel_tools//src/conditions:darwin_x86_64": "macosx_12_0_x86_64",
"@bazel_tools//src/conditions:darwin_arm64": "macosx_12_0_arm64",
"@bazel_tools//src/conditions:linux_x86_64": "manylinux2014_x86_64",
"@bazel_tools//src/conditions:linux_aarch64": "manylinux2014_aarch64",
"@bazel_tools//src/conditions:linux_x86_64": "manylinux_GLIBC_x86_64",
"@bazel_tools//src/conditions:linux_aarch64": "manylinux_GLIBC_aarch64",
}),
python_requires = ">=3.8",
python_requires = ">=3.8.10", # Required for linux's wheel naming convention
python_tag = "INTERPRETER",
requires = ["protobuf>=3.20"],
version = VERSION_LABEL,
Expand Down
9 changes: 8 additions & 1 deletion private_set_intersection/python/rename.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is used to rename the wheel generated via py_wheel with values
# determined at runtime
import sys, os, re
import sys, os, re, platform
from packaging import tags


Expand All @@ -21,6 +21,13 @@ def main():
# INTERPRETER and ABI should be the same value
outfile = re.sub(r"INTERPRETER", abi_tag, inputfile)
outfile = re.sub(r"ABI", abi_tag, outfile)
system = platform.system()

# Rename the wheel depending on the version of glibc
if system.lower() == "linux":
version = platform.libc_ver()[1]
glibc_version = version.replace(".", "_")
outfile = re.sub(r"GLIBC", glibc_version, outfile)

print("renaming ", inputfile, outfile)
os.rename(inputfile, outfile)
Expand Down
2 changes: 1 addition & 1 deletion tools/package.bzl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
""" Version of the current release """
VERSION_LABEL = "1.0.2"
VERSION_LABEL = "1.0.3"

0 comments on commit ea464f5

Please sign in to comment.