Skip to content

Commit 1567357

Browse files
authored
refactor(twine): use py_binary for publishing in WORKSPACE (#3734)
Remove the reliance on defunct entry point code. Work towards #3642.
1 parent b81b287 commit 1567357

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

python/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ bzl_library(
8888
name = "packaging_bzl",
8989
srcs = ["packaging.bzl"],
9090
deps = [
91-
":py_binary_bzl",
91+
"//python/entry_points:py_console_script_binary_bzl",
9292
"//python/private:bzlmod_enabled_bzl",
9393
"//python/private:py_package_bzl",
9494
"//python/private:py_wheel_bzl",

python/packaging.bzl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,12 @@ def py_wheel(
216216
**copy_propagating_kwargs(kwargs)
217217
)
218218
elif twine:
219-
if not twine.endswith(":pkg"):
220-
fail("twine label should look like @my_twine_repo//:pkg")
221-
222-
twine_main = twine.replace(":pkg", ":rules_python_wheel_entry_point_twine.py")
223-
224219
py_binary(
225220
name = "{}.publish".format(name),
226-
srcs = [twine_main],
221+
deps = [twine],
227222
args = twine_args,
228223
data = [dist_target],
229-
imports = ["."],
230-
main = twine_main,
231-
deps = [twine],
224+
main_module = "twine",
232225
tags = manual_tags,
233226
visibility = kwargs.get("visibility"),
234227
**copy_propagating_kwargs(kwargs)

0 commit comments

Comments
 (0)