Skip to content

Smoke tester requiring Python 3.12+ #14556

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

Open
stefanvodita opened this issue Apr 25, 2025 · 3 comments
Open

Smoke tester requiring Python 3.12+ #14556

stefanvodita opened this issue Apr 25, 2025 · 3 comments

Comments

@stefanvodita
Copy link
Contributor

#14326 added a line in scriptutil that imports override from typing, which was introduced in Python 3.12.

Running the smoke tester with 3.11, errors out like so:

Traceback (most recent call last):
  File "/local/home/voditas/ws/open/lucene/dev-tools/scripts/smokeTestRelease.py", line 40, in <module>
    import scriptutil
  File "/local/home/voditas/ws/open/lucene/dev-tools/scripts/scriptutil.py", line 26, in <module>
    from typing import Self, override
ImportError: cannot import name 'override' from 'typing' (/usr/local/lib/python3.11/typing.py)

Maybe we can make it clearer what version Python is required?

@rmuir
Copy link
Member

rmuir commented Apr 25, 2025

@stefanvodita whatever version we want to target, we should configure in the pyproject.toml. I don't know what that is :)

python 3.12 is indeed required for the @override. But this also has the same benefits as it does in java, in detecting breakages across libraries etc. So I think it is worth it, but we can lower the version if needed.

FYI Both python 3.11 and 3.12 are no longer receiving updates except security fixes. Only 3.13 sees bugfixes.

@stefanvodita
Copy link
Contributor Author

I see we have 3.12 configured and at least for me that's alright. But do we have a way to warn users of the scripts that they need 3.12?

@rmuir
Copy link
Member

rmuir commented Apr 25, 2025

I think there is a way, there is even some existing logic to do it (I suspect it has the wrong version set). Additionally, I know existing logic uses an outdated method to check the python version: because I disabled the linter violation around that.

I've also a concern that for an old python it may just fail at pip install phase, and never hit such a custom check. All it takes is for a library to drop support, and culturally it seems python devs are fairly aggressive on that.

We should definitely improve here though!

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

No branches or pull requests

2 participants