Skip to content

Revert the starlark PEP508 evalutaion #2830

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

Closed
4 tasks done
aignas opened this issue Apr 27, 2025 · 2 comments · Fixed by #2834
Closed
4 tasks done

Revert the starlark PEP508 evalutaion #2830

aignas opened this issue Apr 27, 2025 · 2 comments · Fixed by #2834
Milestone

Comments

@aignas
Copy link
Collaborator

aignas commented Apr 27, 2025

This is just to track progress on reverting this for the 1.4.0 release as it was a source of issues.

The list of PRs/things to do are:

I will be working on this one piece at a time to have steady progress.

aignas added a commit to aignas/rules_python that referenced this issue Apr 27, 2025
This just adds the code back at the original state before the following
PRs have been made to remove them: bazel-contrib#2629, bazel-contrib#2781. This has not been
hooked up yet in `evaluate_markers` and `whl_library` yet and I'll need
extra PRs to do that.

No CHANGELOG entries for now, will be done once the integration is back.

Work towards bazel-contrib#2830
@aignas aignas added this to the v1.4 milestone Apr 27, 2025
github-merge-queue bot pushed a commit that referenced this issue Apr 27, 2025
This just adds the code back at the original state before the following
PRs have been made to remove them: #2629, #2781. This has not been
hooked up yet in `evaluate_markers` and `whl_library` yet and I'll need
extra PRs to do that.

No CHANGELOG entries for now, will be done once the integration is back.

Work towards #2830
aignas added a commit to aignas/rules_python that referenced this issue Apr 27, 2025
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
Copy link
Collaborator Author

aignas commented Apr 27, 2025

Reopened #2423 as a feature request that was open to remove Python code that is being added back in here.

github-merge-queue bot pushed a commit that referenced this issue Apr 28, 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
aignas added a commit to aignas/rules_python that referenced this issue Apr 28, 2025
Summary:
- Revert to using Python for marker evaluation during parsing of
  requirements (partial revert of bazel-contrib#2692).
- Use Python to parse whl METADATA.

Fixes bazel-contrib#2830
github-merge-queue bot pushed a commit that referenced this issue Apr 28, 2025
Summary:
- Revert to using Python for marker evaluation during parsing of
  requirements (partial revert of #2692).
- Use Python to parse whl METADATA.
- Bugfix the new simpler algorithm and add a new unit test.

Fixes #2830
@aignas aignas marked this as a duplicate of #2835 Apr 29, 2025
aignas added a commit that referenced this issue Apr 29, 2025
This just adds the code back at the original state before the following
PRs have been made to remove them: #2629, #2781. This has not been
hooked up yet in `evaluate_markers` and `whl_library` yet and I'll need
extra PRs to do that.

No CHANGELOG entries for now, will be done once the integration is back.

Work towards #2830

(cherry picked from commit 61c91fe)
aignas added a commit that referenced this issue 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)
aignas added a commit that referenced this issue Apr 29, 2025
Summary:
- Revert to using Python for marker evaluation during parsing of
  requirements (partial revert of #2692).
- Use Python to parse whl METADATA.
- Bugfix the new simpler algorithm and add a new unit test.

Fixes #2830

(cherry picked from commit 5b9d545)
@aignas
Copy link
Collaborator Author

aignas commented Apr 29, 2025

A release has been cut: bazelbuild/bazel-central-registry#4459

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 a pull request may close this issue.

1 participant