Skip to content

Commit

Permalink
Add license file to pypi wheels.
Browse files Browse the repository at this point in the history
Addresses protocolbuffers/protobuf#10936.

This requires updating to the newest version of rules_python to use the new py_wheel API that includes a parameter for extra distinfo files

PiperOrigin-RevId: 490350846
  • Loading branch information
deannagarcia authored and copybara-github committed Dec 1, 2022
1 parent e66e69d commit 36da7fb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ system_python(
load("@system_python//:register.bzl", "register_system_python")
register_system_python()

load("@fuzzing_py_deps//:requirements.bzl", fuzzing_py_install_deps = "install_deps")

fuzzing_py_install_deps()

load("@system_python//:pip.bzl", "pip_install")
pip_install(
name="pip_deps",
Expand Down
4 changes: 2 additions & 2 deletions bazel/workspace_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ def upb_deps():
patches = ["@upb//bazel:protobuf.patch"],
)

rules_python_version = "0.12.0" # Latest @ August 31, 2022
rules_python_version = "0.14.0" # Latest @ November 20, 2022

maybe(
http_archive,
name = "rules_python",
strip_prefix = "rules_python-{}".format(rules_python_version),
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{}.tar.gz".format(rules_python_version),
sha256 = "b593d13bb43c94ce94b483c2858e53a9b811f6f10e1e0eedc61073bd90e58d9c",
sha256 = "a868059c8c6dd6ad45a205cca04084c652cfe1852e6df2d5aca036f6e5438380",
)

maybe(
Expand Down
5 changes: 4 additions & 1 deletion cmake/make_cmakelists.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def upb_deps(self):
def protobuf_deps(self):
pass

def pip_install(self, **kwargs):
def pip_parse(self, **kwargs):
pass

def rules_fuzzing_dependencies(self):
Expand All @@ -251,6 +251,9 @@ def python_source_archive(self, **kwargs):
def python_nuget_package(self, **kwargs):
pass

def install_deps(self):
pass


class Converter(object):
def __init__(self):
Expand Down
9 changes: 9 additions & 0 deletions python/dist/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ py_wheel(
"Programming Language :: Python :: 3.10",
],
distribution = "protobuf",
extra_distinfo_files = {
"//:LICENSE": "LICENSE",
},
homepage = "https://developers.google.com/protocol-buffers/",
license = "3-Clause BSD License",
platform = select({
Expand Down Expand Up @@ -256,6 +259,9 @@ py_wheel(
"Programming Language :: Python :: 3.10",
],
distribution = "protobuf",
extra_distinfo_files = {
"//:LICENSE": "LICENSE",
},
homepage = "https://developers.google.com/protocol-buffers/",
license = "3-Clause BSD License",
platform = "any",
Expand All @@ -281,6 +287,9 @@ py_wheel(
testonly = True,
abi = "none",
distribution = "protobuftests",
extra_distinfo_files = {
"//:LICENSE": "LICENSE",
},
platform = "any",
python_tag = "py3",
strip_path_prefixes = [
Expand Down

0 comments on commit 36da7fb

Please sign in to comment.