Skip to content

Commit 0310e9f

Browse files
committed
[python] Replace genrule with py_binary
1 parent 80347bf commit 0310e9f

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

py/BUILD.bazel

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ load("//py:defs.bzl", "generate_devtools", "py_test_suite")
1010
load("//py/private:browsers.bzl", "BROWSERS")
1111
load("//py/private:import.bzl", "py_import")
1212

13-
alias(
14-
name = "twine",
15-
actual = requirement("twine"),
16-
)
17-
18-
genrule(
13+
py_binary(
1914
name = "selenium-release",
2015
srcs = [
21-
":selenium-wheel",
16+
"release-selenium.py",
17+
],
18+
args = [
19+
"upload",
20+
"$(location :selenium-wheel)",
21+
"$(location :selenium-sdist)",
22+
],
23+
data = [
2224
":selenium-sdist",
25+
":selenium-wheel",
26+
],
27+
main = "release-selenium.py",
28+
deps = [
29+
requirement("twine"),
2330
],
24-
outs = ["pypi_upload_complete.txt"],
25-
cmd = "(twine upload $(location :selenium-wheel) $(location :selenium-sdist) && touch $@)",
26-
tools = [":twine"],
27-
tags = [
28-
"manual",
29-
"requires-network",
30-
]
3131
)
3232

3333
compile_pip_requirements(

py/release-selenium.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
from twine import cli
5+
6+
def main():
7+
cli.configure_output()
8+
return cli.dispatch(sys.argv[1:])
9+
10+
if __name__ == "__main__":
11+
sys.exit(main())

0 commit comments

Comments
 (0)