From 4ea4d66260fb6474451dec37aef42c929a169003 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 30 Sep 2024 22:42:51 +0800 Subject: [PATCH] Rename python package to `openmined_psi` (#200) * fix * update --- .github/workflows/CD.yml | 2 +- CHANGES.md | 5 +++++ private_set_intersection/python/BUILD | 4 ++-- private_set_intersection/python/README.md | 16 ++++++++++++---- private_set_intersection/python/rename.py | 3 +-- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 8f5568ba..95dd5591 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -57,7 +57,7 @@ jobs: strategy: matrix: os: [ubuntu-24.04, macos-14] - golang-version: ['1.21'] + golang-version: ['1.23'] steps: - name: Set up Golang ${{ matrix.golang-version }} uses: actions/setup-go@v5 diff --git a/CHANGES.md b/CHANGES.md index 5c510d38..faec2975 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,11 @@ Chore: - 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. +Breaking: + +- The **python** package has been renamed to `openmined_psi` to comply with the + bazel toolchain naming conventions. + # Version 2.0.2 Chore: diff --git a/private_set_intersection/python/BUILD b/private_set_intersection/python/BUILD index 42b726c7..910b4ef6 100644 --- a/private_set_intersection/python/BUILD +++ b/private_set_intersection/python/BUILD @@ -174,7 +174,7 @@ py_package( # This rule builds the wheel, but we need to change the name of the .whl before # we publish to PyPI using a separate publish script outside of bazel. The # output that gets generated looks like the following: -# openmined.psi-1.0.0-INTERPRETER-ABI-PLATFORM.whl +# openmined_psi-1.0.0-INTERPRETER-ABI-PLATFORM.whl # # This rule also bundles protobuf, but it resides in an incorrect directy and # there doesn't seem to be a way to prevent it getting added to the wheel. @@ -188,7 +188,7 @@ py_wheel( "Topic :: Security :: Cryptography", ], description_file = "DESCRIPTION.md", - distribution = "openmined.psi", + distribution = "openmined_psi", extra_distinfo_files = { "//:LICENSE": "LICENSE", "//private_set_intersection/python:README.md": "README", diff --git a/private_set_intersection/python/README.md b/private_set_intersection/python/README.md index 7624f1fe..5b64f5e2 100644 --- a/private_set_intersection/python/README.md +++ b/private_set_intersection/python/README.md @@ -3,7 +3,15 @@ Private Set Intersection protocol based on ECDH, Bloom Filters, and Golomb Compressed Sets. -## Tests +## Installation + +```bash +pip install openmined_psi +``` + +## Developing + +### Tests ```bash bazel test --test_output=all //private_set_intersection/python:test_3_8 @@ -13,7 +21,7 @@ bazel test --test_output=all //private_set_intersection/python:test_3_11 ... ``` -## Benchmarks +### Benchmarks ```bash bazel run -c opt --test_output=all //private_set_intersection/python:benchmark_3_8 @@ -23,7 +31,7 @@ bazel run -c opt --test_output=all //private_set_intersection/python:benchmark_3 ... ``` -## Updating dependencies +### Updating dependencies Add any dependencies to `requirements.in`, then run: @@ -35,7 +43,7 @@ bazel run //private_set_intersection/python/requirements:requirements_3_11.updat ... ``` -## Publishing +### Publishing We first build the wheel diff --git a/private_set_intersection/python/rename.py b/private_set_intersection/python/rename.py index 19b3267e..b8341d99 100644 --- a/private_set_intersection/python/rename.py +++ b/private_set_intersection/python/rename.py @@ -48,11 +48,10 @@ def main(): interpreter_version = tags.interpreter_version() abi_tag = interpreter_name + interpreter_version - # openmined.psi-1.0.0-INTERPRETER-ABI-PLATFORM-ARCH.whl + # openmined_psi-1.0.0-INTERPRETER-ABI-PLATFORM-ARCH.whl # INTERPRETER and ABI should be the same value outfile = re.sub(r"INTERPRETER", abi_tag, inputfile) outfile = re.sub(r"ABI", abi_tag, outfile) - outfile = re.sub(r"openmined_psi", "openmined.psi", outfile) system = platform.system() # We rename the wheel depending on the version of python and glibc