Skip to content

fix(pypi) backport python_full_version fix to Python #2833

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

Merged
merged 2 commits into from
Apr 28, 2025

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Apr 27, 2025

Handling of python_full_version correctly has been fixed in the Starlark
implementation in #2793 and in this PR I am backporting the changes to handle
the full python version target platform strings so that we can have the same
behaviour for now.

At the same time I have simplified and got rid of the specialization handling
in the Python algorithm just like I did in the starlark, which simplifies the
tests and makes the algorithm more correct.

Summary:

  • Handle cp3x.y_os_arch strings in the platform.py
  • Produce correct strings when the micro_version is unset. Note, that we use version 0 in evaluating but we use the default version in the config setting. This is to keep compatibility with the current behaviour when the target platform is not fully specified (which would be the case for WORKSPACE users).
  • Adjust the tests and the code to be more similar to the starlark impl.

Work towards #2830

This has been fixed in the Starlark implementation in bazel-contrib#2793 and in this
PR I am backporting the changes to handle the full python version
target platform strings so that we can have the same behaviour for now.

At the same time I have simplified and got rid of the specialization
handling in the Python algorithm just like I did in the starlark, which
simplifies the tests and makes the algorithm more correct.

Work towards bazel-contrib#2830
@aignas aignas requested review from rickeylev and groodt as code owners April 27, 2025 15:21
@aignas aignas enabled auto-merge April 28, 2025 09:24
@aignas aignas added this pull request to the merge queue Apr 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 28, 2025
@aignas aignas added this pull request to the merge queue Apr 28, 2025
Merged via the queue into bazel-contrib:main with commit 9e613d5 Apr 28, 2025
3 checks passed
@aignas aignas deleted the backout-pep508-star-2 branch April 28, 2025 14:57
aignas added a commit that referenced this pull request Apr 29, 2025
Handling of `python_full_version` correctly has been fixed in the
Starlark
implementation in #2793 and in this PR I am backporting the changes to
handle
the full python version target platform strings so that we can have the
same
behaviour for now.

At the same time I have simplified and got rid of the specialization
handling
in the Python algorithm just like I did in the starlark, which
simplifies the
tests and makes the algorithm more correct.

Summary:
* Handle `cp3x.y_os_arch` strings in the `platform.py`
* Produce correct strings when the `micro_version` is unset. Note, that
we use version `0` in evaluating but we use the default version in the
config setting. This is to keep compatibility with the current behaviour
when the target platform is not fully specified (which would be the case
for WORKSPACE users).
* Adjust the tests and the code to be more similar to the starlark impl.

Work towards #2830

(cherry picked from commit 9e613d5)
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