From 085e141d19c28786438ed8c6ed50421e2797cccf Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Mon, 5 Dec 2022 20:49:02 +0000 Subject: [PATCH] Revert "Add license file to pypi wheels.", PR coming This reverts commit 77c43aa3b4f9730339d9fe9c407171c24918a0d1. --- WORKSPACE | 24 ---------------- bazel/system_python.bzl | 59 ---------------------------------------- bazel/workspace_deps.bzl | 4 +-- cmake/make_cmakelists.py | 14 +--------- python/dist/BUILD.bazel | 9 ------ 5 files changed, 3 insertions(+), 107 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 03f142322f..2748b3285f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -56,27 +56,3 @@ rules_fuzzing_dependencies() load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init") rules_fuzzing_init() - -load("//bazel:system_python.bzl", "system_python") -system_python( - name = "system_python", - minimum_python_version = "3.7", -) - -load("@system_python//:register.bzl", "register_system_python") -register_system_python() - -load("@system_python//:pip.bzl", "pip_parse", "fuzzing_py_install_deps") - -pip_parse( - name="pip_deps", - requirements = "//python:requirements.txt", - requirements_overrides = { - "3.11": "//python:requirements_311.txt", - }, -) - -load("@pip_deps//:requirements.bzl", "install_deps") -install_deps() - -fuzzing_py_install_deps() diff --git a/bazel/system_python.bzl b/bazel/system_python.bzl index 50a3a8ab56..7e2dac92b4 100644 --- a/bazel/system_python.bzl +++ b/bazel/system_python.bzl @@ -25,65 +25,6 @@ """Repository rule for using Python 3.x headers from the system.""" -# Mock out rules_python's pip.bzl for cases where no system python is found. -_mock_pip = """ -def fuzzing_py_install_deps(): - print("WARNING: could not install fuzzing_py dependencies") - -def _pip_install_impl(repository_ctx): - repository_ctx.file("BUILD.bazel", ''' -py_library( - name = "noop", - visibility = ["//visibility:public"], -) -''') - repository_ctx.file("requirements.bzl", ''' -def install_deps(*args, **kwargs): - print("WARNING: could not install pip dependencies") - -def requirement(*args, **kwargs): - return "@{}//:noop" -'''.format(repository_ctx.attr.name)) -pip_install = repository_rule( - implementation = _pip_install_impl, - attrs = { - "requirements": attr.string(), - "requirements_overrides": attr.string_dict(), - "python_interpreter_target": attr.string(), - }, -) -pip_parse = pip_install -""" - -# Alias rules_python's pip.bzl for cases where a system python is found. -_alias_pip = """ -load("@rules_python//python:pip.bzl", _pip_install = "pip_install", _pip_parse = "pip_parse") -load("@fuzzing_py_deps//:requirements.bzl", _fuzzing_py_install_deps = "install_deps") - -def _get_requirements(requirements, requirements_overrides): - for version, override in requirements_overrides.items(): - if version in "{python_version}": - requirements = override - break - return requirements - -def pip_install(requirements, requirements_overrides={{}}, **kwargs): - _pip_install( - python_interpreter_target = "@{repo}//:interpreter", - requirements = _get_requirements(requirements, requirements_overrides), - **kwargs, - ) -def pip_parse(requirements, requirements_overrides={{}}, **kwargs): - _pip_parse( - python_interpreter_target = "@{repo}//:interpreter", - requirements = _get_requirements(requirements, requirements_overrides), - **kwargs, - ) - -def fuzzing_py_install_deps(): - _fuzzing_py_install_deps() -""" - _build_file = """ load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair") diff --git a/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl index 5840cfd208..28f96aa859 100644 --- a/bazel/workspace_deps.bzl +++ b/bazel/workspace_deps.bzl @@ -29,14 +29,14 @@ def upb_deps(): sha256 = "328bc917118da38656be0cdeb49b261adc133628f5f114ee287a1d31dc33cfc1", ) - rules_python_version = "0.14.0" # Latest @ November 20, 2022 + rules_python_version = "0.12.0" # Latest @ August 31, 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 = "a868059c8c6dd6ad45a205cca04084c652cfe1852e6df2d5aca036f6e5438380", + sha256 = "b593d13bb43c94ce94b483c2858e53a9b811f6f10e1e0eedc61073bd90e58d9c", ) maybe( diff --git a/cmake/make_cmakelists.py b/cmake/make_cmakelists.py index cd984e9f1e..d64c14f6f3 100755 --- a/cmake/make_cmakelists.py +++ b/cmake/make_cmakelists.py @@ -200,7 +200,7 @@ class WorkspaceFileFunctions(object): def __init__(self, converter): self.converter = converter - def load(self, *args, **kwargs): + def load(self, *args): pass def workspace(self, **kwargs): @@ -225,12 +225,6 @@ def upb_deps(self): def protobuf_deps(self): pass - def utf8_range_deps(self): - pass - - def pip_parse(self, **kwargs): - pass - def rules_fuzzing_dependencies(self): pass @@ -249,12 +243,6 @@ def python_source_archive(self, **kwargs): def python_nuget_package(self, **kwargs): pass - def install_deps(self): - pass - - def fuzzing_py_install_deps(self): - pass - class Converter(object): def __init__(self): diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index 41a20e1e14..36e5f009ec 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -110,9 +110,6 @@ 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({ @@ -157,9 +154,6 @@ 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", @@ -179,9 +173,6 @@ py_wheel( name = "test_wheel", abi = "none", distribution = "protobuftests", - extra_distinfo_files = { - "//:LICENSE": "LICENSE", - }, platform = "any", python_tag = "py3", strip_path_prefixes = ["python/"],