Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python_info aspect to accommodate Python targets that only have rules_python providers #210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mnoah1
Copy link
Contributor

@mnoah1 mnoah1 commented Jan 22, 2025

As the Python rules are gradually phasing out use of the builtin PyInfo provider in favor of the ones from rules_python, there could be cases where a repository is on a Bazel version lower than 8, but the built in PyInfo is still missing from a given target.

In our repo's case, we are in the process of migrating to rules_py, which uses the rules_python providers only (aspect-build/rules_py#311), and not the built in ones.

This change now covers the following scenarios, allowing Bazel 7 repositories to have either the builtin or rules_python providers in their targets:

  • Bazel <7 - continue to use built in providers only [existing behavior]
    • rules_python won't always be available in Bazel <7 workspaces, so supporting this here would have added additional complexity for a relatively unlikely use case
  • Bazel 7 - if builtin providers are missing from a target, use rules_python providers
  • Bazel 8 - rules_python providers only [existing behavior]

@mnoah1 mnoah1 force-pushed the rules_python_providers branch from 91c7c77 to cbcfcbe Compare January 24, 2025 19:11
@mnoah1
Copy link
Contributor Author

mnoah1 commented Jan 24, 2025

It looks like all the e2e tests pass with this change, but I'm seeing a failure in the [analysis] Qodana android-forked-bazel-rules-project step with error: found 'project contains no modules' in the build log. I don't think it seems related to my change but I'm not quite sure - could you help me verify?

@mnoah1 mnoah1 requested a review from agluszak January 24, 2025 20:27
@mnoah1
Copy link
Contributor Author

mnoah1 commented Jan 31, 2025

Hi @agluszak - could you give this one another look when you have a chance? Thanks.

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.

2 participants