Skip to content

Commit

Permalink
[python] Replace genrule with py_binary
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Mar 21, 2024
1 parent 80347bf commit 0310e9f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
28 changes: 14 additions & 14 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ load("//py:defs.bzl", "generate_devtools", "py_test_suite")
load("//py/private:browsers.bzl", "BROWSERS")
load("//py/private:import.bzl", "py_import")

alias(
name = "twine",
actual = requirement("twine"),
)

genrule(
py_binary(
name = "selenium-release",
srcs = [
":selenium-wheel",
"release-selenium.py",
],
args = [
"upload",
"$(location :selenium-wheel)",
"$(location :selenium-sdist)",
],
data = [
":selenium-sdist",
":selenium-wheel",
],
main = "release-selenium.py",
deps = [
requirement("twine"),
],
outs = ["pypi_upload_complete.txt"],
cmd = "(twine upload $(location :selenium-wheel) $(location :selenium-sdist) && touch $@)",
tools = [":twine"],
tags = [
"manual",
"requires-network",
]
)

compile_pip_requirements(
Expand Down
11 changes: 11 additions & 0 deletions py/release-selenium.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python3

import sys
from twine import cli

def main():
cli.configure_output()
return cli.dispatch(sys.argv[1:])

if __name__ == "__main__":
sys.exit(main())

0 comments on commit 0310e9f

Please sign in to comment.