Skip to content

fix: Fix Python 3.4.x compatibilty with bootstrap (#2709) #2714

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

Conversation

armandomontanez
Copy link
Contributor

Fixes some f-strings, trailing commas, and out-of-order argument unpacking in the bootstrap template to restore compatibility with Python 3.4.x.

Fixes some f-strings, trailing commas, and out-of-order argument
unpacking to restore compatibility with Python 3.4.x.
@groodt
Copy link
Collaborator

groodt commented Mar 31, 2025

Is there a reason this can't be carried by a patch at the install site? Bazel has first-class support for patching rules.

We support current Python versions via https://devguide.python.org/versions/

3.4 is EOL and there are likely to be other things that won't work beyond the bootstrap. It's a maintenance burden too. Much easier to decline fixes that are to support old language features than it is to try wind back code to support something beyond its useful shelf life.

@armandomontanez
Copy link
Contributor Author

I was under the impression the bootstrap script specifically was intended to work as far back as Python 2.7.

The project itself is configured to use Python 3.11.

@groodt
Copy link
Collaborator

groodt commented Mar 31, 2025

We deprecated PY2 a while ago now and probably didn't clean up that comment. Or we should have reframed it as best effort.

Can you link to the project? Can you include your patch where the rules are installed, or indeed store a bootstrap template in your repo?

@armandomontanez
Copy link
Contributor Author

I can work around locally, I only sent out this PR as a courtesy since it seemed like an unintentional regression.

@groodt
Copy link
Collaborator

groodt commented Mar 31, 2025

Thanks! Yes, we may indeed end up using it. But one thing is for sure, we probably need to more clearly document supported python versions.

@aignas
Copy link
Collaborator

aignas commented Mar 31, 2025

Thank you for the contribution. Since we are testing in CI only against supported Python versions, these regressions are somewhat inevitable, I guess. Most of the codebase used to work with Python 2.7 but retaining that compatibility cannot be guaranteed even within the same major semver, because we are not going to have tests for it. I am happy to merge this though and I am happy to accept future contributions to help us maintain that compatibility if it breaks again in the future.

It's like tier1 and tier2 python version system. Tier1 are the versions that we have in CI, Tier2 - all the rest. Maybe we should write that in our docs.

@aignas aignas added this pull request to the merge queue Apr 1, 2025
Merged via the queue into bazel-contrib:main with commit 481db13 Apr 1, 2025
3 checks passed
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