Skip to content

Commit

Permalink
[build] create selenium-release target for python
Browse files Browse the repository at this point in the history
Avoids using system python as part of release
  • Loading branch information
titusfortner committed Jan 23, 2024
1 parent 5440d2b commit d74db8a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,7 @@ namespace :py do
desc 'Release Python wheel and sdist to pypi'
task :release, [:args] do |_task, arguments|
args = arguments[:args] || ['--stamp']
Rake::Task['py:build'].invoke(args)
sh "python3 -m twine upload bazel-bin/py/selenium-#{python_version}-py3-none-any.whl"
sh "python3 -m twine upload bazel-bin/py/selenium-#{python_version}.tar.gz"
Bazel.execute('run', args, '//py:selenium-release')
end

desc 'generate and copy files required for local development'
Expand Down
16 changes: 16 additions & 0 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ 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(
name = "selenium-release",
srcs = [
":selenium-wheel",
":selenium-sdist",
],
outs = ["pypi_upload_complete.txt"],
cmd = "(twine upload $(location :selenium-wheel) $(location :selenium-sdist) && touch $@)",
tools = [":twine"],
)

compile_pip_requirements(
# base name for generated targets, typically "requirements"
name = "requirements",
Expand Down

0 comments on commit d74db8a

Please sign in to comment.