diff --git a/py/BUILD.bazel b/py/BUILD.bazel index f7777b5d9fbad..42242625fb920 100644 --- a/py/BUILD.bazel +++ b/py/BUILD.bazel @@ -6,6 +6,7 @@ load("@py_dev_requirements//:requirements.bzl", "requirement") load("//common:defs.bzl", "copy_file") load("//py:defs.bzl", "py_test_suite") load("//py/private:browsers.bzl", "BROWSERS") +load("//py/private:import.bzl", "py_import") load("@rules_python//python:pip.bzl", "compile_pip_requirements") compile_pip_requirements( @@ -164,6 +165,7 @@ pkg_files( "README.rst", "setup.py", ":selenium-pkg", + ":selenium-pkginfo", ], strip_prefix = strip_prefix.from_pkg(), ) @@ -176,6 +178,18 @@ pkg_tar( package_file_name = "selenium-%s.tar.gz" % SE_VERSION, ) +genrule( + name = "selenium-pkginfo", + srcs = [":selenium-wheel-lib"], + cmd = "cp $(location :selenium-wheel-lib)/selenium-%s.dist-info/METADATA $@" % SE_VERSION, + outs = ["PKG-INFO"], +) + +py_import( + name = "selenium-wheel-lib", + wheel = ":selenium-wheel", +) + py_wheel( name = "selenium-wheel", classifiers = [ diff --git a/py/private/import.bzl b/py/private/import.bzl index fa827d8e55e22..ee1e5bd17d2f6 100644 --- a/py/private/import.bzl +++ b/py/private/import.bzl @@ -35,13 +35,13 @@ def _py_import_impl(ctx): runfiles = runfiles.merge(dep[DefaultInfo].default_runfiles) imports = depset( - items = [ + [ "%s/%s/%s-pyroot" % (ctx.workspace_name, ctx.label.package, ctx.label.name), ], transitive = [dep[PyInfo].imports for dep in ctx.attr.deps], ) transitive_sources = depset( - items = [], + [], transitive = [dep[PyInfo].transitive_sources for dep in ctx.attr.deps], ) @@ -57,7 +57,7 @@ def _py_import_impl(ctx): return [ DefaultInfo( - files = depset(items = [root]), + files = depset([root]), default_runfiles = runfiles, ), info,