Discussion:
pygnulib: Portability fixes
(too old to reply)
Mathieu Lirzin
2017-09-25 19:52:06 UTC
Permalink
Raw Message
Hello,

I have checked the "python" branch.

Here is a patch that removes the use of 'enum.Flags' that didn't exist
until python 3.6. It seems that 'enum' classes are not well supported
with older version too. So it seems more reasonable to not use them at
all.
Dmitry Selyutin
2017-09-25 20:30:41 UTC
Permalink
Raw Message
Hi Mathieu,

thank you for submitting it.
Post by Mathieu Lirzin
Here is a patch that removes the use of 'enum.Flags' that didn't exist
until python 3.6. It seems that 'enum' classes are not well supported
with older version too. So it seems more reasonable to not use them at
all.
Wow, that's a surprise. Sure, we must support all Python 3 versions. Thank
you, I've applied it. Please check if everything is OK, I'm not a Git guru:
since parser and config were a bit ahead, I did the same as you did,
committed, then exported a patch via $(git format-patch HEAD~1), then put the
original author and text (only lowercasing a one letter). Please let me know
if you know a better way, I don't use Git intensively.
Post by Mathieu Lirzin
I suppose that in the context of Gnulib it is important to be compatible
with Python 2?
It is not. :-) Even in 2012 when I started the original work, Bruno wanted to
stick to Python 3, but I still did everything in a crazy mix of both versions.
Now the support for Python 2 seems to be redundant; hopefully most Unices
either have Python 3 by default or at least have it in repositories, ports,
etc. The cost of maintaining the script for both versions is really huge, I
really think that Bruno was right from the very beginning.
--
With best regards,
Dmitry Selyutin
Mathieu Lirzin
2017-09-25 21:12:23 UTC
Permalink
Raw Message
Post by Dmitry Selyutin
Wow, that's a surprise. Sure, we must support all Python 3 versions. Thank
since parser and config were a bit ahead, I did the same as you did,
committed, then exported a patch via $(git format-patch HEAD~1), then put the
original author and text (only lowercasing a one letter). Please let me know
if you know a better way, I don't use Git intensively.
The usual process depends on your email client. Basically you have to
save the attached patch to a file in Gnulib Git repository. Then from
that directory the command 'git am 0001-blablaba.patch' will apply that
patch.

If your are comfortable with Emacs I recommend using Magit which is a
nice UI that can help becoming a "Git guru".
Post by Dmitry Selyutin
Post by Mathieu Lirzin
I suppose that in the context of Gnulib it is important to be compatible
with Python 2?
It is not. :-) Even in 2012 when I started the original work, Bruno wanted to
stick to Python 3, but I still did everything in a crazy mix of both versions.
Now the support for Python 2 seems to be redundant; hopefully most Unices
either have Python 3 by default or at least have it in repositories, ports,
etc. The cost of maintaining the script for both versions is really huge, I
really think that Bruno was right from the very beginning.
That's fine with me. :-)

Thanks.
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37
Bruno Haible
2017-09-25 21:50:20 UTC
Permalink
Raw Message
Post by Dmitry Selyutin
hopefully most Unices
either have Python 3 by default or at least have it in repositories, ports,
etc.
Yes, they do. You can assume Python >= 3.2 nowadays when you invoke 'python3'.
[1]

'python2' is also widely deployed [2]; I assume that's because of backward
compatibility for old but valuable scripts.

Bruno

[1] https://repology.org/metapackage/python3/versions
[2] https://repology.org/metapackage/python2/versions

Loading...