Skip to content

Allow for custom python versions in python_register_toolchains - #657

Merged
f0rmiga merged 1 commit into
bazel-contrib:mainfrom
UebelAndre:version
Mar 15, 2022
Merged

Allow for custom python versions in python_register_toolchains#657
f0rmiga merged 1 commit into
bazel-contrib:mainfrom
UebelAndre:version

Conversation

@UebelAndre

@UebelAndre UebelAndre commented Mar 15, 2022

Copy link
Copy Markdown
Contributor

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?

  • 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?

If you define your own python_register_toolchains.tool_versions for a version that is not a built in version, then the repository rule rejects it.

Issue Number: N/A

What is the new behavior?

This change allows users to define custom python versions that are not already registered in @rules_python//python:versions.bzl.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@UebelAndre
UebelAndre marked this pull request as ready for review March 15, 2022 22:22
@f0rmiga
f0rmiga merged commit 5d734c8 into bazel-contrib:main Mar 15, 2022
@UebelAndre
UebelAndre deleted the version branch March 15, 2022 22:35
Comment thread python/repositories.bzl
"python_version": attr.string(
doc = "The Python version.",
mandatory = True,
values = TOOL_VERSIONS.keys() + MINOR_MAPPING.keys(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there should still be some validation here, but instead now in the macro. Can this be added in a follow up diff?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants