Skip to content

Commit d74db8a

Browse files
committed
[build] create selenium-release target for python
Avoids using system python as part of release
1 parent 5440d2b commit d74db8a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Rakefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,7 @@ namespace :py do
581581
desc 'Release Python wheel and sdist to pypi'
582582
task :release, [:args] do |_task, arguments|
583583
args = arguments[:args] || ['--stamp']
584-
Rake::Task['py:build'].invoke(args)
585-
sh "python3 -m twine upload bazel-bin/py/selenium-#{python_version}-py3-none-any.whl"
586-
sh "python3 -m twine upload bazel-bin/py/selenium-#{python_version}.tar.gz"
584+
Bazel.execute('run', args, '//py:selenium-release')
587585
end
588586

589587
desc 'generate and copy files required for local development'

py/BUILD.bazel

+16
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ 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(
19+
name = "selenium-release",
20+
srcs = [
21+
":selenium-wheel",
22+
":selenium-sdist",
23+
],
24+
outs = ["pypi_upload_complete.txt"],
25+
cmd = "(twine upload $(location :selenium-wheel) $(location :selenium-sdist) && touch $@)",
26+
tools = [":twine"],
27+
)
28+
1329
compile_pip_requirements(
1430
# base name for generated targets, typically "requirements"
1531
name = "requirements",

0 commit comments

Comments
 (0)