Kévin Le Gouguec wrote:
> >> So if Python 3.7 is acceptable as a minimum version (it seems available
> >> in the distro releases you mention), you would be able to start using
> >> this union syntax.
> >
> > I remember having to use the __future__ import. I guess I no longer
> > have to now that Debian Stable has Python 3.11.
> >
> > Do you happen to know if 'from __future__ import annotations' allows
> > for the use of 'TypeX | TypeY' union syntax with Python 3.7?
>
> Yes, 'TypeX | TypeY' was what I was referring to above with "syntax
> sophistications brought by newer Pythons".
Last time [1] we decided that a Python version >= 3.6 can be assumed.
Can this requirement be lifted to Python >= 3.7 ?
I would say yes, because
- Essentially the latest distro which has only Python 3.6.x is
RHEL / CentOS 7. [2]
- This distro is out-of-service in four months. [3][4]
- By the time gnulib-tool.py is ready for general use, this time point
will be reached.
[1] https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00192.html
[2] https://repology.org/project/python/versions
[3]
https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux#Version_history_and_timeline
[4]
https://git.savannah.gnu.org/gitweb/?p=gnulib/maint-tools.git;a=blob;f=end-of-life.txt;h=ab966afdc18b06ce10c4ed416139f232c4d8401d;hb=HEAD
So, I'm applying this patch:
2024-03-01 Bruno Haible <[email protected]>
gnulib-tool.py: Clarify minimum supported Python version.
* pygnulib/main.py: Add comment regarding the Python version.
diff --git a/pygnulib/main.py b/pygnulib/main.py
index 93fd637f24..f99062089b 100644
--- a/pygnulib/main.py
+++ b/pygnulib/main.py
@@ -17,6 +17,8 @@
# This program is meant for authors or maintainers which want to import
# modules from gnulib into their packages.
+# This program assumes a Python version >= 3.7.
+
# CODING STYLE for this file and its companions:
# Like PEP 8 <https://peps.python.org/pep-0008/>, except
# - Line length is not limited to 79 characters.