Skip to content

Commit

Permalink
Rollforward of af004d1: Remove Python native rule classes and py_runtime
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 682927198
Change-Id: If1b8e67dc72becdd703a8cfd911d543cc4095879
  • Loading branch information
comius authored and copybara-github committed Oct 6, 2024
1 parent 678b01a commit 97ddb4b
Show file tree
Hide file tree
Showing 28 changed files with 227 additions and 1,105 deletions.
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ genrule(
"//third_party/protobuf:BUILD",
"//third_party/protobuf:proto_info_bzl_deps.patch",
"//third_party/protobuf:remove_rules_rust.patch",
"//third_party/protobuf:add_python_loads.patch",
],
outs = ["MODULE.bazel.lock.dist"],
cmd = " && ".join([
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ archive_override(
patches = [
"//third_party/protobuf:proto_info_bzl_deps.patch",
"//third_party/protobuf:remove_rules_rust.patch",
"//third_party/protobuf:add_python_loads.patch",
],
strip_prefix = "protobuf-3b62052186d39775090fb074adcba078ea622f54",
urls = ["https://github.com/protocolbuffers/protobuf/archive/3b62052186d39775090fb074adcba078ea622f54.zip"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.actions.ActionEnvironment;
import com.google.devtools.build.lib.analysis.BaseRuleClasses;
import com.google.devtools.build.lib.analysis.BaseRuleClasses.EmptyRule;
import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider;
import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider.RuleSet;
import com.google.devtools.build.lib.analysis.PackageSpecificationProvider;
Expand All @@ -36,10 +35,7 @@
import com.google.devtools.build.lib.analysis.config.RequiresOptions;
import com.google.devtools.build.lib.bazel.BazelConfiguration;
import com.google.devtools.build.lib.bazel.repository.LocalConfigPlatformRule;
import com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryRule;
import com.google.devtools.build.lib.bazel.rules.python.BazelPyBuiltins;
import com.google.devtools.build.lib.bazel.rules.python.BazelPyRuleClasses;
import com.google.devtools.build.lib.bazel.rules.python.BazelPyTestRule;
import com.google.devtools.build.lib.bazel.rules.python.BazelPythonConfiguration;
import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.packages.PackageCallable;
Expand Down Expand Up @@ -316,11 +312,6 @@ public void init(ConfiguredRuleClassProvider.Builder builder) {
builder.addConfigurationFragment(PythonConfiguration.class);
builder.addConfigurationFragment(BazelPythonConfiguration.class);

builder.addRuleDefinition(new BazelPyRuleClasses.PyBaseRule());
builder.addRuleDefinition(new BazelPyRuleClasses.PyBinaryBaseRule());
builder.addRuleDefinition(new EmptyRule("py_library") {});
builder.addRuleDefinition(new BazelPyBinaryRule());
builder.addRuleDefinition(new BazelPyTestRule());
builder.addRuleDefinition(new PyRuntimeRule());

// This symbol is overridden by exports.bzl
Expand All @@ -333,7 +324,8 @@ public void init(ConfiguredRuleClassProvider.Builder builder) {

try {
builder.addWorkspaceFileSuffix(
ResourceFileLoader.loadResource(BazelPyBinaryRule.class, "python.WORKSPACE"));
ResourceFileLoader.loadResource(
BazelPythonConfiguration.class, "python.WORKSPACE"));
} catch (IOException e) {
throw new IllegalStateException(e);
}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 97ddb4b

Please sign in to comment.