Skip to content
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

fix #905 - correct version file template for older python versions #907

Conversation

RonnyPfannschmidt
Copy link
Contributor

closes #905

testing/test_basic_api.py Outdated Show resolved Hide resolved
@andrewmwilson
Copy link

Thanks for the quick fix!

Co-authored-by: Jonathan de Bruin <jonathandebruinos@gmail.com>
@RonnyPfannschmidt RonnyPfannschmidt merged commit 06958fb into pypa:main Sep 20, 2023
16 checks passed
@RonnyPfannschmidt
Copy link
Contributor Author

i have a pending fix for #906 as well then i will release 8.0.1

@RonnyPfannschmidt RonnyPfannschmidt deleted the fix-905-version-file-syntax-compat branch September 20, 2023 11:46
@maxnoe
Copy link

maxnoe commented Sep 20, 2023

Having two type annotations in the same line is not even valid syntax in python 3.11.

So this fix is not only for "older python versions":

❯ cat test_annotations.py
__version__ : str = version : str = "foo"
❯ python --version
Python 3.11.4
❯ python test_annotations.py
  File "/home/maxnoe/Uni/CTA/ctapipe/test_annotations.py", line 1
    __version__ : str = version : str = "foo"
                                ^
SyntaxError: invalid syntax

Valid syntax would be to split the annotated variables into one instruction per line:

version: str = "foo"
__version__ : str = version

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.

generated _version.py breaks on python <3.8
4 participants