FS#62180 - [inkscape] support for python3
Attached to Project:
Arch Linux
Opened by Adam Fontenot (amfontenot) - Friday, 29 March 2019, 03:01 GMT
Last edited by Gaetan Bisson (vesath) - Tuesday, 16 April 2019, 23:26 GMT
Opened by Adam Fontenot (amfontenot) - Friday, 29 March 2019, 03:01 GMT
Last edited by Gaetan Bisson (vesath) - Tuesday, 16 April 2019, 23:26 GMT
|
Details
Description:
This package as of 0.92.4-4 currently requires python2, which I've just purged from my system. I'm slowly adding back some of the stuff I removed in the process to see what actually requires it. From what I have been able to determine, Inkscape does not require Python 2 to run. At one point, its extensions did, but this seems to have changed: their extensions repository now claims to support Python 3 including full test coverage. https://gitlab.com/inkscape/extensions/blob/master/README.md In light of this, the patching in the inkscape PKGBUILD to make it run on Python 2 seems now to be undesirable. Either the package should be rebuilt to use Python 3, or a patch to fall back to Python 3 in case Python 2 is not available should be used instead. It would be great if python2 could be moved to optdepends. Thanks! |
This task depends upon
$ grep python2 `pacman -Qlq inkscape` 2>/dev/null | wc -l
168
So quite a few things apparently still rely on python2. Cheers.
If you grep for python2 in the 0.92.4 source code, you only find Python 2 for macOS and Windows / part of buildsystem (?) - and that's probably optional. If you grep in the share/ folder for inkscape, there's not a single mention of python2. All scripts use a `#!/usr/bin/env python` shebang, which implies Python 3 support.
(Edit: This paragraph is wrong! python implies python2, not python3)
However, according to the wiki, extensions using a certain file were still broken: inkex.py (Also see: http://wiki.inkscape.org/wiki/index.php/Extension_Interpreters#Selecting_a_specific_interpreter_version_.28via_preferences_file.29 ). That was only fixed 1 month ago (See https://gitlab.com/inkscape/inkscape/merge_requests/568 ), and is not fixed in the current stable version.
The extensions repo linked above appears to be used for future major versions (and is also Python 3 compatible).
So on the next update (either 1.0 or 0.92.5) this package can probably be (safely) migrated to Python 3.
Even now, it could probably be migrated to Python 3, with optional Python 2 for certain extensions.
that leaves 108 of the 188 .py files shipped by inkscape affected.
Edit:
https://www.python.org/dev/peps/pep-0394/ covers the interpretation of /usr/bin/env python
I remember introducing those sed lines in the PKGBUILD because, as you point out, many scripts using `#!/usr/bin/env python` expect python2. I'm glad to hear those scripts have since been ported to python3 upstream and look forward to deprecating python2 as soon as an upstream release supports it. For now I think having python3 for most scripts and python2 in optdepends would introduce too much additional complexity for too little gain. Cheers.
My understanding is that while only a minority of extensions were modified in that diff, those that were not were already compatible with Python 3. I could be wrong about this but we could always check with upstream about the status of their Python 3 conversion before making any changes here. If I'm correct about this, we should be good to go as soon as a release with #568 lands. (When I posted this bug report, I mistakenly believed it had already landed since Arch has a release of Inkscape that postdates its merge into the 0.92.x branch.)