antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
17.04k stars 3.27k forks source link

Clarify supported Python runtime language version #4610

Open gricey432 opened 4 months ago

gricey432 commented 4 months ago

Just after some clarification on what the supported Python versions are.

The docs specify Python 3.6 or higher, however the readme says Python 3.4 or higher

Python 3.4 went end of life in early 2019, 3.5 in late 2020, and 3.6 in late 2021

I'm happy to submit a PR either removing the 3.4 & 3.5 support code or updating the docs to say 3.4, just need some guidance on the project's status / goals here.

kaby76 commented 4 months ago

It is unclear what it could be because the tester uses the latest available. https://github.com/antlr/antlr4/blob/380ce4b8b1658df16ada45e1d56d5aa476052376/.github/workflows/hosted.yml#L247 The plugin itself recommends setting an explicit version: (we recommend always setting Python version explicitly using the python-version or python-version-file inputs). In addition, to properly qualify a version range, you need to test each and every version in a range of versions in a test matrix in Github Actions workflow. In grammars-g4, I set the version explicitly to 3.10 because I had problems with version 3.8. https://github.com/antlr/grammars-v4/blob/153d66809d26425e5ac49cec77294f034d99eb0b/.github/workflows/main.yml#L113 However, that may be because some of the grammars have base class support code that relies on 3.10, and not with the generated parsers themselves. I don't test a range because it takes a long time to do this testing with each PR. And it can be expensive.

gricey432 commented 4 months ago

Thanks for the response @kaby76, it's raised some further questions.

The plugin itself recommends setting an explicit version: (we recommend always setting Python version explicitly using the python-version or python-version-file inputs).

Where'd you find that line? The readme for the Python target doesn't seem to have that text in it and I'm unsure what a 'plugin' is in the ANTLR ecosystem. Also don't get any code matches on a Github search.

In addition, to properly qualify a version range, you need to test each and every version in a range of versions in a test matrix in Github Actions workflow. ... I don't test a range because it takes a long time to do this testing with each PR. And it can be expensive.

Hmm yeah having a look at the GitHub actions it looks like this repo is using one giant sequential job for the bulk of the Workflow. I feel like there'd be huge benefit in making a larger number of small jobs, but that's probably a different ticket.

The kind of code I'm proposing removal of (if 3.6 is minimum supported) is blocks like https://github.com/antlr/antlr4/blob/380ce4b8b1658df16ada45e1d56d5aa476052376/runtime/Python3/src/antlr4/Parser.py#L6

kaby76 commented 4 months ago

Where'd you find that line?

Sorry, it is from https://github.com/actions/setup-python , the first big paragraph under "Basic usage".

Yes, validating the supported versions of a runtime environment is another problem. The change in the Antlr source code is also something that needs to be fixed with the correct value or removed.

gricey432 commented 4 months ago

Sorry, it is from https://github.com/actions/setup-python , the first big paragraph under "Basic usage".

Ah I misunderstood; thought you were talking about ANTLR suggesting pinning Python.

ericvergnaud commented 2 months ago

@gricey432 Thanks for this, please submit a PR

gricey432 commented 2 months ago

@gricey432 Thanks for this, please submit a PR

Happy to do so, but I don't think there's been any feedback on which direction the PR should go. Which place is the source of truth?

ericvergnaud commented 2 months ago

Let’s refer to whichever version is LTS ?Envoyé de mon iPhoneLe 27 juil. 2024 à 05:19, Mitchell Grice @.***> a écrit :

@gricey432 Thanks for this, please submit a PR

Happy to do so, but I don't think there's been any feedback on which direction the PR should go. Which place is the source of truth?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

gricey432 commented 2 months ago

Let’s refer to whichever version is LTS ?

Unlike Java, Python doesn't have LTS versions https://devguide.python.org/versions/

They just continuously roll through

ericvergnaud commented 2 months ago

That would be 3.8 thenEnvoyé de mon iPhoneLe 28 juil. 2024 à 03:33, Mitchell Grice @.***> a écrit :

Let’s refer to whichever version is LTS ?

Unlike Java, Python doesn't have LTS versions https://devguide.python.org/versions/ They just continuously roll through

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>