Skip to content

Commit 6177760

Browse files
committed
add notes
1 parent 2049afc commit 6177760

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

python/private/pypi/whl_library.bzl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,25 +364,43 @@ def _whl_library_impl(rctx):
364364
name = metadata["name"],
365365
requires_dist = metadata["requires_dist"],
366366
# target the host platform if the target platform is not specified in the rule.
367+
# TODO @aignas 2025-03-23: we should materialize this inside the
368+
# hub_repository `requirements.bzl` file as `TARGET_PLATFORMS` with a
369+
# note, that this is internal and will be only for usage of the
370+
# `whl_library`
367371
platforms = target_platforms or [
368372
"{}_{}".format(metadata["abi"], host_platform(rctx)),
369373
],
374+
# TODO @aignas 2025-03-23: we should expose the requested extras via a
375+
# dict in `requirements.bzl` `EXTRAS` where the key is the package name
376+
# and the value is the list of requested extras. like the above, for
377+
# internal usage only.
370378
extras = metadata["extras"],
379+
# TODO @aignas 2025-03-23: we should expose full python version via the
380+
# TARGET_PYTHON_VERSIONS list so that we can correctly calculate the
381+
# deps. This would be again, internal only stuff.
382+
host_python_version = metadata["python_version"],
371383
)
372384

373385
build_file_contents = generate_whl_library_build_bazel(
374386
name = whl_path.basename,
387+
# TODO @aignas 2025-03-23: load the dep_template from the hub repository
375388
dep_template = rctx.attr.dep_template or "@{}{{name}}//:{{target}}".format(rctx.attr.repo_prefix),
389+
# TODO @aignas 2025-03-23: replace `dependencies` and
390+
# `dependencies_by_platform` with `requires_dist`.
376391
dependencies = package_deps.deps,
377392
dependencies_by_platform = package_deps.deps_select,
393+
# TODO @aignas 2025-03-23: store the `group_name` per package in the hub repo
378394
group_name = rctx.attr.group_name,
379395
group_deps = rctx.attr.group_deps,
396+
# TODO @aignas 2025-03-23: store the pip_data_exclude in the hub repo.
380397
data_exclude = rctx.attr.pip_data_exclude,
381398
tags = [
382399
"pypi_name=" + metadata["name"],
383400
"pypi_version=" + metadata["version"],
384401
],
385402
entry_points = entry_points,
403+
# TODO @aignas 2025-03-23: store the annotation in the hub repo.
386404
annotation = None if not rctx.attr.annotation else struct(**json.decode(rctx.read(rctx.attr.annotation))),
387405
)
388406
rctx.file("BUILD.bazel", build_file_contents)

python/private/pypi/whl_library_targets.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ def whl_library_targets(
9090
native: {type}`native` The native struct for overriding in tests.
9191
rules: {type}`struct` A struct with references to rules for creating targets.
9292
"""
93-
_ = name # buildifier: @unused
94-
9593
dependencies = sorted([normalize_name(d) for d in dependencies])
9694
dependencies_by_platform = {
9795
platform: sorted([normalize_name(d) for d in deps])

0 commit comments

Comments
 (0)