Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazel-contrib/rules_python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.19.0
Choose a base ref
...
head repository: bazel-contrib/rules_python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.20.0
Choose a head ref
  • 19 commits
  • 48 files changed
  • 8 contributors

Commits on Mar 5, 2023

  1. chore: fix some lingering GH archive URLs (#1108)

    This was pointed out in a thread on bazel-discuss@googlegroups.com
    alexeagle authored Mar 5, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    51458e8 View commit details

Commits on Mar 6, 2023

  1. feat: add bzlmod support for gazelle plugin (#1077)

    * feat: add optional pkg alias generation to pip_repository
    
    * feat: support using aliases in gazelle
    
    * doc: migrate gazelle example to use user friendly aliases
    
    * feat: gazelle supports bzlmod
    
    * chore: update gazelle plugin deps
    
    * chore: bazel run //:gazelle
    
    * fix: remove deps that are imported as bazel deps
    
    See: bazel-contrib/bazel-gazelle#1403
    
    * ci: add build_file_generation to show that we support bzlmod
    aignas authored Mar 6, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7d82f06 View commit details
  2. docs: Simplify pull request template (#1100)

    The existing template is very verbose with many of the lines not being
    applicable to any given PR. This also makes the PR description poorly
    suitable for a commit description.
    
    By having a cleaner PR description that is commit message friendly,
    whoever merges the PR can more easily create a meaningful commit
    message. It also allows other maintainer's to clean up the description
    prior to it being merged.
    rickeylev authored Mar 6, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    de8f428 View commit details
  3. chore: fix syntax that stardoc misunderstands as HTML (#1110)

    Update requirements.bzl
    alexeagle authored Mar 6, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c73dc0c View commit details

Commits on Mar 7, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    244c606 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0ba98a6 View commit details

Commits on Mar 8, 2023

  1. feat: add bzl_library for defs.bzl and its dependencies (#1115)

    This is so that the transitive dependencies of defs.bzl can be easily
    found and validated; some Google internal tooling does this validation.
    
    The old comment indicated bzl_library wasn't used to avoid a dependency
    on skylib, however, we've since added a dependency on skylib.
    
    Work towards #1069
    rickeylev authored Mar 8, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7ffe2f7 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8400610 View commit details
  3. fix: generation of toolchain aliases //:defs.bzl file. (#1088)

    ## PR Checklist
    
    Please check if your PR fulfills the following requirements:
    
    - [ ] Tests for the changes have been added (for bug fixes / features)
    - [ ] Docs have been added / updated (for bug fixes / features)
    
    
    ## PR Type
    
    What kind of change does this PR introduce?
    
    <!-- Please check the one that applies to this PR using "x". -->
    
    - [X] Bugfix
    - [ ] Feature (please, look at the "Scope of the project" section in the
    README.md file)
    - [ ] Code style update (formatting, local variables)
    - [ ] Refactoring (no functional changes, no api changes)
    - [ ] Build related changes
    - [ ] CI related changes
    - [ ] Documentation content changes
    - [ ] Other... Please describe:
    
    
    ## What is the current behavior?
    <!-- Please describe the current behavior that you are modifying, or
    link to a relevant issue. -->
    
    With `common --experimental_enable_bzlmod` option defs.bzl is generated
    as
    ```
    load("@rules_python~override//python/config_settings:transition.bzl", _py_binary = "py_binary", _py_test = "py_test")
    load("@rules_python~override//python:pip.bzl", _compile_pip_requirements = "compile_pip_requirements")
    ```
    and these lines cause a problem at
    ```
    load("@python3_9//:defs.bzl", "interpreter")
    ```
    as
    ```
    
    ERROR: .../BUILD:25:11: error loading package 'src': at .../external/rules_python~override~python~python3_9/defs.bzl:4:6: Unable to find package for @[unknown repo 'rules_python~override' requested from @rules_python~override~python~python3_9]//python:pip.bzl: The repository '@[unknown repo 'rules_python~override' requested from @rules_python~override~python~python3_9]' could not be resolved: No repository visible as '@rules_python~override' from repository '@rules_python~override~python~python3_9'. and referenced by '...'
    ```
    
    
    Issue Number: N/A
    
    
    ## What is the new behavior?
    
    Generated load statements
    ```
    load("@@rules_python~override//python/config_settings:transition.bzl", _py_binary = "py_binary", _py_test = "py_test")
    load("@@rules_python~override//python:pip.bzl", _compile_pip_requirements = "compile_pip_requirements")
    ```
    
    ## Does this PR introduce a breaking change?
    
    - [ ] Yes
    - [X] No
    
    
    <!-- If this PR contains a breaking change, please describe the impact
    and migration path for existing applications below. -->
    
    
    ## Other information
    oxidase authored Mar 8, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5ff514a View commit details

Commits on Mar 9, 2023

  1. feat: make variable substitution for py_wheel abi, python_tag args (#…

    …1113)
    
    Expands make variables in to `abi` and `python_tag` attributes
    
    ---------
    
    Co-authored-by: Richard Levasseur <richardlev@gmail.com>
    stonier and rickeylev authored Mar 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1c5b92b View commit details
  2. feat: add bzl_library for proto.bzl (#1116)

    This is mostly so Google internal tooling can find the complete deps,
    but also as a best practice for consumption by other rules and tools.
    rickeylev authored Mar 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3aa221f View commit details
  3. cleanup: Remove license comment in proto build file (#1118)

    The license comments aren't necessary anymore.
    rickeylev authored Mar 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    25e4175 View commit details
  4. fix: restrict proto package visibility to private (#1117)

    This is to prevent accidentally leaking targets that shouldn't be
    accessible. The `:python_toolchain` target is public because it's an
    implicit dependency of `py_proto_library`.
    rickeylev authored Mar 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9ef11b9 View commit details
  5. cleanup: rename proto BUILD -> BUILD.bazel (#1119)

    The rest of the project uses BUILD.bazel
    rickeylev authored Mar 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    31d0efd View commit details
  6. feat: bzl file per rule/provider (#1122)

    This is basically a performance optimization. Bazel can only see that a
    bzl file changed, not the particular contents. This means that any
    downstream bzl file loading it is invalidated, even if it doesn't load
    any of the affected code. As an example, if a package only loads
    `py_library.bzl`, then changing `py_test.bzl` doesn't need to invalidate
    all libraries.
    
    * Also removes some more extraneous license comments
    
    Work towards #1069
    rickeylev authored Mar 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    756264a View commit details

Commits on Mar 11, 2023

  1. cleanup: fix typo: libraries, not libaries (#1127)

    Silent r's are tricky.
    rickeylev authored Mar 11, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c0c08a3 View commit details
  2. feat: add public entry point for PyCcLinkParamsInfo (#1128)

    This provides a public entry point for loading the underlying
    `PyCcLinkParamsProvider` provider that is built into Bazel. This
    provider isn't yet usable from Bazel, but adding a loadable way for it
    to migrate off the built-in rules is the first step.
    
    Work towards #1069
    rickeylev authored Mar 11, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4e3d01c View commit details

Commits on Mar 13, 2023

  1. cleanup: reformat defs.bzl doc string. (#1126)

    The extraneous newlines were bothering me.
    rickeylev authored Mar 13, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    31bc04b View commit details

Commits on Mar 16, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c394c46 View commit details
Showing with 799 additions and 290 deletions.
  1. +34 −0 .bazelci/presubmit.yml
  2. +11 −44 .github/PULL_REQUEST_TEMPLATE.md
  3. +7 −0 .github/workflows/create_archive_and_notes.sh
  4. +2 −1 README.md
  5. +5 −1 docs/BUILD.bazel
  6. +2 −2 docs/pip.md
  7. +8 −5 docs/pip_repository.md
  8. +0 −2 docs/python.md
  9. +4 −1 examples/build_file_generation/BUILD.bazel
  10. +43 −0 examples/build_file_generation/MODULE.bazel
  11. +6 −33 examples/build_file_generation/WORKSPACE
  12. +2 −1 examples/build_file_generation/gazelle_python.yaml
  13. +8 −0 examples/bzlmod/BUILD.bazel
  14. +1 −0 examples/bzlmod/MODULE.bazel
  15. +24 −1 examples/wheel/BUILD.bazel
  16. +17 −0 examples/wheel/private/wheel_utils.bzl
  17. +20 −0 gazelle/MODULE.bazel
  18. +2 −17 gazelle/README.md
  19. +13 −44 gazelle/deps.bzl
  20. +0 −2 gazelle/go.mod
  21. +10 −1 gazelle/manifest/defs.bzl
  22. +16 −7 gazelle/manifest/generate/generate.go
  23. +3 −0 gazelle/manifest/manifest.go
  24. +0 −1 gazelle/python/BUILD.bazel
  25. +1 −1 gazelle/python/parse.py
  26. +7 −1 gazelle/pythonconfig/BUILD.bazel
  27. +17 −4 gazelle/pythonconfig/pythonconfig.go
  28. +28 −0 gazelle/pythonconfig/pythonconfig_test.go
  29. +91 −3 python/BUILD.bazel
  30. +58 −0 python/current_py_toolchain.bzl
  31. +5 −95 python/defs.bzl
  32. +7 −0 python/extensions.bzl
  33. +67 −5 python/pip_install/pip_repository.bzl
  34. +2 −2 python/pip_install/requirements.bzl
  35. +22 −1 python/private/BUILD.bazel
  36. +16 −2 python/private/proto/{BUILD → BUILD.bazel}
  37. +7 −4 python/private/py_wheel.bzl
  38. +9 −8 python/private/toolchains_repo.bzl
  39. +19 −0 python/py_binary.bzl
  40. +3 −0 python/py_cc_link_params_info.bzl
  41. +67 −0 python/py_import.bzl
  42. +19 −0 python/py_info.bzl
  43. +19 −0 python/py_library.bzl
  44. +19 −0 python/py_runtime.bzl
  45. +19 −0 python/py_runtime_info.bzl
  46. +19 −0 python/py_runtime_pair.bzl
  47. +19 −0 python/py_test.bzl
  48. +21 −1 tests/BUILD.bazel
34 changes: 34 additions & 0 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -73,6 +73,14 @@ tasks:
build_targets: ["//..."]
test_targets: ["//..."]
working_directory: gazelle
gazelle_extension_bzlmod:
<<: *common_bzlmod_flags
name: Test the Gazelle extension under bzlmod
platform: ubuntu2004
build_targets: ["//..."]
test_targets: ["//..."]
working_directory: gazelle

ubuntu_min:
<<: *minimum_supported_version
<<: *reusable_config
@@ -138,6 +146,32 @@ tasks:
working_directory: examples/build_file_generation
platform: windows

integration_test_build_file_generation_bzlmod_ubuntu:
<<: *minimum_supported_bzlmod_version
<<: *common_bzlmod_flags
<<: *reusable_build_test_all
name: build_file_generation_bzlmod integration tests on Ubuntu
working_directory: examples/build_file_generation
platform: ubuntu2004
integration_test_build_file_generation_bzlmod_debian:
<<: *common_bzlmod_flags
<<: *reusable_build_test_all
name: build_file_generation_bzlmod integration tests on Debian
working_directory: examples/build_file_generation
platform: debian11
integration_test_build_file_generation_bzlmod_macos:
<<: *common_bzlmod_flags
<<: *reusable_build_test_all
name: build_file_generation_bzlmod integration tests on macOS
working_directory: examples/build_file_generation
platform: macos
integration_test_build_file_generation_bzlmod_windows:
<<: *common_bzlmod_flags
<<: *reusable_build_test_all
name: build_file_generation_bzlmod integration tests on Windows
working_directory: examples/build_file_generation
platform: windows

integration_test_bzlmod_ubuntu_min:
<<: *minimum_supported_bzlmod_version
<<: *reusable_build_test_all
55 changes: 11 additions & 44 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)


## PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

- [ ] Bugfix
- [ ] Feature (please, look at the "Scope of the project" section in the README.md file)
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A


## What is the new behavior?


## Does this PR introduce a breaking change?

- [ ] Yes
- [ ] No


<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->


## Other information

PR Instructions/requirements
* Title uses `type: description` format. See CONTRIBUTING.md for types.
* Common types are: build, docs, feat, fix, refactor, revert, test
* Breaking changes include "!" after the type and a "BREAKING CHANGES:"
section at the bottom.
* Body text describes:
* Why this change is being made, briefly.
* Before and after behavior, as applicable
* References issue number, as applicable
* Update docs and tests, as applicable
* Delete these instructions prior to sending the PR
7 changes: 7 additions & 0 deletions .github/workflows/create_archive_and_notes.sh
Original file line number Diff line number Diff line change
@@ -87,5 +87,12 @@ http_archive(
strip_prefix = "${PREFIX}/gazelle",
url = "https://github.com/bazelbuild/rules_python/releases/download/${TAG}/rules_python-${TAG}.tar.gz",
)
# To compile the rules_python gazelle extension from source,
# we must fetch some third-party go dependencies that it uses.
load("@rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps")
_py_gazelle_deps()
\`\`\`
EOF
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -46,7 +46,8 @@ rules_python_version = "740825b7f74930c62f44af95c9a4c1bd428d2c53" # Latest @ 202

http_archive(
name = "rules_python",
sha256 = "3474c5815da4cb003ff22811a36a11894927eda1c2e64bf2dac63e914bfdf30f",
# Bazel will print the proper value to add here during the first build.
# sha256 = "FIXME",
strip_prefix = "rules_python-{}".format(rules_python_version),
url = "https://github.com/bazelbuild/rules_python/archive/{}.zip".format(rules_python_version),
)
6 changes: 5 additions & 1 deletion docs/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -56,7 +56,11 @@ bzl_library(
"//python:defs.bzl",
"//python/private:reexports.bzl",
],
deps = [":bazel_python_tools"],
deps = [
":bazel_python_tools",
"//python:defs_bzl",
"//python/private:reexports_bzl",
],
)

bzl_library(
4 changes: 2 additions & 2 deletions docs/pip.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions docs/pip_repository.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions docs/python.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion examples/build_file_generation/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -43,6 +43,9 @@ gazelle_python_manifest(
modules_mapping = ":modules_map",
pip_repository_name = "pip",
requirements = "//:requirements_lock.txt",
# NOTE: we can use this flag in order to make our setup compatible with
# bzlmod.
use_pip_repository_aliases = True,
)

# Our gazelle target points to the python gazelle binary.
@@ -65,7 +68,7 @@ py_library(
visibility = ["//:__subpackages__"],
deps = [
"//random_number_generator",
"@pip_flask//:pkg",
"@pip//flask",
],
)

43 changes: 43 additions & 0 deletions examples/build_file_generation/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module(
name = "example_bzlmod",
version = "0.0.0",
compatibility_level = 1,
)

bazel_dep(name = "rules_python", version = "0.19.0")
bazel_dep(name = "rules_python_gazelle_plugin", version = "0.19.0")
bazel_dep(name = "gazelle", version = "0.29.0", repo_name = "bazel_gazelle")

# local overrides for the packages for CI purposes.
# for usual setups you should remove this block.
local_path_override(
module_name = "rules_python",
path = "../..",
)

local_path_override(
module_name = "rules_python_gazelle_plugin",
path = "../../gazelle",
)

# Register python toolchain
python = use_extension("@rules_python//python:extensions.bzl", "python")
python.toolchain(
name = "python3_9",
python_version = "3.9",
)
use_repo(python, "python3_9_toolchains")

register_toolchains(
"@python3_9_toolchains//:all",
)

pip = use_extension("@rules_python//python:extensions.bzl", "pip")
pip.parse(
name = "pip",
# Generate user friendly alias labels for each dependency that we have.
incompatible_generate_aliases = True,
requirements_lock = "//:requirements_lock.txt",
requirements_windows = "//:requirements_windows.txt",
)
use_repo(pip, "pip")
39 changes: 6 additions & 33 deletions examples/build_file_generation/WORKSPACE
Original file line number Diff line number Diff line change
@@ -55,49 +55,20 @@ gazelle_dependencies()

# Remaining setup is for rules_python.

# You do not want to use the following command when you are using a WORKSPACE file
# that is outside of rules_python repository.
# This command allows targets from a local directory to be bound.
# Which allows bazel to use targets defined in base rules_python directory.
# If you are using this example outside of the rules_python git repo,
# use the http_archive command that is commented out below.
# https://bazel.build/reference/be/workspace#local_repository
# DON'T COPY_PASTE THIS.
# Our example uses `local_repository` to point to the HEAD version of rules_python.
# Users should instead use the installation instructions from the release they use.
# See https://github.com/bazelbuild/rules_python/releases
local_repository(
name = "rules_python",
path = "../..",
)

# When not using this example in the rules_python git repo you would load the python
# ruleset using the following StarLark.
# See https://github.com/bazelbuild/rules_python#getting-started for the latest
# ruleset version.
#
# The following StarLark would replace the `local_repository` rule mentioned above.
#
# load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# http_archive(
# name = "rules_python",
# sha256 = "497ca47374f48c8b067d786b512ac10a276211810f4a580178ee9b9ad139323a",
# strip_prefix = "rules_python-0.16.1",
# url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.16.1.tar.gz",
# )

# We import the repository-local rules_python_gazelle_plugin version in order to
# be able to test development changes to the plugin.
local_repository(
name = "rules_python_gazelle_plugin",
path = "../../gazelle",
)

# When loading the gazelle plugin outside this repo, use the http_archive rule as follows:
#
#http_archive(
# name = "rules_python_gazelle_plugin",
# sha256 = "497ca47374f48c8b067d786b512ac10a276211810f4a580178ee9b9ad139323a",
# strip_prefix = "rules_python-0.16.1/gazelle",
# url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.16.1.tar.gz",
#)

# Next we load the toolchain from rules_python.
load("@rules_python//python:repositories.bzl", "python_register_toolchains")

@@ -119,6 +90,8 @@ load("@rules_python//python:pip.bzl", "pip_parse")
# You can instead check this `requirements.bzl` file into your repo.
pip_parse(
name = "pip",
# Generate user friendly alias labels for each dependency that we have.
incompatible_generate_aliases = True,
# (Optional) You can provide a python_interpreter (path) or a python_interpreter_target (a Bazel target, that
# acts as an executable). The latter can be anything that could be used as Python interpreter. E.g.:
# 1. Python interpreter that you compile in the build file.
3 changes: 2 additions & 1 deletion examples/build_file_generation/gazelle_python.yaml
Original file line number Diff line number Diff line change
@@ -114,4 +114,5 @@ manifest:
zipp.py310compat: zipp
pip_repository:
name: pip
integrity: 2c84a3cabeaff134a1d045e5a173a3178086f236ab20f895ffbd7f3b7a6e5bb0
use_pip_repository_aliases: true
integrity: 85f073e37e31339508aaaf5e0d5472adae5148fd5f054e9cc586343c026660e1
8 changes: 8 additions & 0 deletions examples/bzlmod/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@pip//:requirements.bzl", "requirement")
load("@python3_9//:defs.bzl", py_test_with_transition = "py_test")
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

@@ -35,3 +36,10 @@ py_test(
srcs = ["test.py"],
deps = [":lib"],
)

py_test_with_transition(
name = "test_with_transition",
srcs = ["test.py"],
main = "test.py",
deps = [":lib"],
)
1 change: 1 addition & 0 deletions examples/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ python.toolchain(
configure_coverage_tool = True,
python_version = "3.9",
)
use_repo(python, "python3_9")
use_repo(python, "python3_9_toolchains")

register_toolchains(
25 changes: 24 additions & 1 deletion examples/wheel/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
# limitations under the License.

load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("//examples/wheel/private:wheel_utils.bzl", "directory_writer")
load("//examples/wheel/private:wheel_utils.bzl", "directory_writer", "make_variable_tags")
load("//python:defs.bzl", "py_library", "py_test")
load("//python:packaging.bzl", "py_package", "py_wheel")
load("//python:versions.bzl", "gen_python_config_settings")
@@ -62,6 +62,29 @@ py_wheel(
],
)

# Populate a rule with "Make Variable" arguments for
# abi, python_tag and version. You might want to do this
# for the following use cases:
# - abi, python_tag: introspect a toolchain to map to appropriate cpython tags
# - version: populate given this or a dependent module's version
make_variable_tags(
name = "make_variable_tags",
)

py_wheel(
name = "minimal_with_py_library_with_make_variables",
testonly = True,
abi = "$(ABI)",
distribution = "example_minimal_library",
python_tag = "$(PYTHON_TAG)",
toolchains = ["//examples/wheel:make_variable_tags"],
version = "$(VERSION)",
deps = [
"//examples/wheel/lib:module_with_data",
"//examples/wheel/lib:simple_module",
],
)

build_test(
name = "dist_build_tests",
targets = [":minimal_with_py_library.dist"],
Loading