Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions python/private/pypi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//python:py_binary.bzl", "py_binary")
load("//python:py_library.bzl", "py_library")
load("//python/private:distribution_filegroup.bzl", "distribution_filegroup")
load("//python/private:py_interpreter_program.bzl", "py_interpreter_program")

package(default_visibility = ["//:__subpackages__"])

Expand All @@ -26,6 +27,28 @@ exports_files(
visibility = ["//visibility:public"],
)

filegroup(
name = "sdist_wheel_builder_helpers",
srcs = ["sdist_wheel_helpers.py"],
)

py_interpreter_program(
name = "sdist_wheel_builder",
interpreter_args = ["-B"],
main = "sdist_wheel_builder.py",
visibility = ["//visibility:public"],
)

py_library(
name = "sdist_wheel_builder_lib",
srcs = [
"sdist_wheel_builder.py",
"sdist_wheel_helpers.py",
],
imports = ["."],
visibility = ["//tests:__subpackages__"],
)

py_library(
name = "rewriters_lib",
srcs = [
Expand Down Expand Up @@ -715,6 +738,30 @@ bzl_library(
srcs = ["platform.bzl"],
)

bzl_library(
name = "py_built_wheel_info",
srcs = ["py_built_wheel_info.bzl"],
)

bzl_library(
name = "py_sdist_wheel",
srcs = ["py_sdist_wheel.bzl"],
deps = [
":py_built_wheel_info",
"//python/private:attr_builders",
"//python/private:attributes",
"//python/private:builders",
"//python/private:common",
"//python/private:normalize_name",
"//python/private:py_info",
"//python/private:py_interpreter_program",
"//python/private:reexports",
"//python/private:rule_builders",
"//python/private:toolchain_types",
"//python/private:version",
],
)

bzl_library(
name = "python_tag",
srcs = ["python_tag.bzl"],
Expand Down
28 changes: 28 additions & 0 deletions python/private/pypi/py_built_wheel_info.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Provider for a Python wheel built in a Bazel build action."""

PyBuiltWheelInfo = provider(
doc = """
Information about a wheel built in a build action.
:::{versionadded} VERSION_NEXT_FEATURE
:::
""",
fields = {
"directory": """
:type: File
The `.whldir` directory artifact (`TreeArtifact`) containing the built `.whl` file
with its canonical PEP 427 filename.
""",
"distribution": """
:type: str
The normalized Python distribution name (e.g. `foo_bar`).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this normalized to have underscores or dashes, I've seen both used in Python ecosystem in particular places. The canonical name for the distribution has - but filenames usually contain _ because - are already used as whl separators.

""",
"version": """
:type: str
The normalized PEP 440 version string (e.g. `1.2.3`).
""",
},
)
Loading
Loading