You've already forked SeleniumHQ.selenium.py
[py] Add PKG-INFO to sdist (#11379)
Co-authored-by: David Burns <david.burns@theautomatedtester.co.uk> NOKEYCHECK=True GitOrigin-RevId: 4f218e0439d4163fadcc6392a953fc6adc9fa745
This commit is contained in:

committed by
Copybara-Service

parent
9e9a5391a2
commit
1e505fe689
14
BUILD.bazel
14
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 = [
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user