From ea464f576dcf631a37fb496dc7408d5f41aa5e2d Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Sun, 8 Jan 2023 19:07:02 -0600 Subject: [PATCH] Support new PEP 600 tagging for Python wheels (#150) * fix * add ubuntu 20.04 to CD * fix --- .github/workflows/CD.yml | 2 +- CHANGES.md | 6 ++++++ package-lock.json | 2 +- package.json | 2 +- private_set_intersection/python/BUILD | 6 +++--- private_set_intersection/python/rename.py | 9 ++++++++- tools/package.bzl | 2 +- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 8c4ca1cc..aa508331 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -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 diff --git a/CHANGES.md b/CHANGES.md index 1c5caed2..6e184d6e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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: diff --git a/package-lock.json b/package-lock.json index 495adf57..266caf31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@openmined/psi.js", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index d3fc40e8..97ac6beb 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/private_set_intersection/python/BUILD b/private_set_intersection/python/BUILD index b210a5cc..68732354 100644 --- a/private_set_intersection/python/BUILD +++ b/private_set_intersection/python/BUILD @@ -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, diff --git a/private_set_intersection/python/rename.py b/private_set_intersection/python/rename.py index 5de5bdfc..adb856e7 100644 --- a/private_set_intersection/python/rename.py +++ b/private_set_intersection/python/rename.py @@ -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 @@ -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) diff --git a/tools/package.bzl b/tools/package.bzl index 703a8c49..b56f0541 100644 --- a/tools/package.bzl +++ b/tools/package.bzl @@ -1,2 +1,2 @@ """ Version of the current release """ -VERSION_LABEL = "1.0.2" +VERSION_LABEL = "1.0.3"