Skip to content

Conversation

@dotoleeoak
Copy link
Contributor

Closes #2921

For a single pypi repo with multiple python versions, all_requirements fail when a pypi package supports Python version A but not version B. In this case, the pypi package would be included only in requirements lock file for version A, not in one for version B. However, the failure occurs since the package is included in all_requirements even for Python version B.
(Minimal reproduction: https://github.com/dotoleeoak/rules-python-2921-repro)

This happens since packages parameter for hub_repository targets are including all packages across all requirement lock files. Instead of union of packages, intersection of packages for requirement files should be passed to packages and exposed to all_requirements macro, so that those packages are compatible with all Python versions.

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

Logic LGTM, but it would be also good to add a line in CHANGELOG in the Fixed section to ensure that users get informed about the change.

@dotoleeoak dotoleeoak changed the title fix: expose pypi packages only common to all python versions fix(pypi): expose pypi packages only common to all python versions Jul 21, 2025
@dotoleeoak dotoleeoak requested a review from aignas July 21, 2025 08:36
@dotoleeoak
Copy link
Contributor Author

It seems the current CI failures come from GitHub's partial outage
https://www.githubstatus.com/

@aignas aignas enabled auto-merge July 21, 2025 13:54
@aignas aignas added this pull request to the merge queue Jul 21, 2025
Merged via the queue into bazel-contrib:main with commit aa60229 Jul 21, 2025
2 checks passed
@dotoleeoak dotoleeoak deleted the drop-uncommon-pkgs-to-all-versions branch July 22, 2025 04:10
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.

all_requirements fails for multiple python versions

2 participants