-
Notifications
You must be signed in to change notification settings - Fork 23
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
“Annotation” feature drops compatibility with Python 3.6 #42
Comments
An alternative would be to require https://pypi.org/project/future-annotations/ for Python 3.6 |
In order to use `from __future__ import annotations` on Python 3.6 we need to install the future-annotations package. Fix sphinx-contrib#42
In order to use `from __future__ import annotations` on Python 3.6 we need to install the future-annotations package. Fix sphinx-contrib#42 Signed-off-by: Elyézer Rezende <[email protected]>
In order to use `from __future__ import annotations` on Python 3.6 we need to install the future-annotations package. Fix sphinx-contrib#42 Signed-off-by: Elyézer Rezende <[email protected]>
Not sure if we can get this to work on Python 3.6+ https://github.com/sphinx-contrib/autoprogram/pull/43/files#r574630429 With the current annotations usage it seems not to be possible to work with python 3.6 |
3.6 is EOL at the end of the year so maybe it's fair to just move on? I've given #48 to do that. |
Thanks for the issue @latk, I've made #51 to focus on the more general part of your question around "intention". My current leaning is that it's not super important for this tool to support every Python version - it doesn't need to match the Python version that a given project actually runs on. That said, I'm very open to feedback on this and not committed to that conclusion. |
Thanks, that is great to hear!
Yes it does, within reason. Whatever Python version is used, it must be able to run both Autoprogram and the target program, since Autoprogram must execute the target program to get at the ArgumentParser object. In practice this is not a big deal because Python has decent backwards compatibility, but the PEP-387 backwards compatibility policy allows breaking changes after two versions with deprecation warnings. This means code could run without warnings in 3.6, warn in 3.7 and 3.8, and stop working in 3.9. (Of course in practice, the issue with upgrading a project to a newer Python isn't the language but availability of wheels for dependencies). Importing from In light of this, I would humbly suggest that Autoprogram adopt a policy such as:
|
Right, I was being a bit short here but my understanding matches yours - it's probably okay if Autoprogram requires a newer version of Python, so long as that version is backwards compatible (i.e., within two versions).
Thanks for the suggestions! What do you think about this proposal: Autoprogram must run on a version of Python that is guaranteed to be backwards-compatible with the oldest Python release that is still receiving security updates. According to PEP 387, this essentially means one that isn't more than two releases ahead of the oldest maintained version. I think this strikes a nice balance between not requiring Autoprogram to run on really old Python versions while retaining the ability for users' projects to be written for such old versions. |
Recently, the following line was added to autoprogram.py:
However, the annotations feature was only added in Python 3.7 per PEP 563. This breaks autoprogram on Python 3.6, which still has upstream support until the end of the year.
We encountered this problem on our CI builds for the gcovr project, which we run on 3.6 to ensure compatibility. I note that autoprogram uses 3.7 as the oldest version.
What is the intention here?
annotations
feature be made unnecessary? The annotations feature is not necessary for type annotations, but merely changes the evaluation order in order to directly support forward references.In any case, it may be time to update the classifiers in setup.py – they claim support for Python 3.3 and Stackless Python, both of which seem like untested claims :)
The text was updated successfully, but these errors were encountered: