You are not logged in.

#1 2020-01-13 15:35:23

getzze
Member
Registered: 2015-04-08
Posts: 4

Python2 end of life

Python2 will not be receiving any bugfix since January 1st of 2020, so I was planning to remove as many core packages using python2 as possible.

I found some packages that use python2, sometimes without reason as they seam to work with python3:

graphviz (no reason not to use python3)
avahi (no reason not to use python3)
nmap (not even in dependency list... only for GUI zenmap, could be split package maybe)
ibus (no reason not to use python3)
gimp (through pygtk - https://bugzilla.redhat.com/show_bug.cgi?id=1737933)
calibre (almost ready https://github.com/kovidgoyal/calibre/pull/870)
inkscape (for the next version https://bugs.launchpad.net/inkscape/+bug/1735363)
scribus (for the next version https://bugs.scribus.net/view.php?id=15030)
terminator (in progress https://bugs.launchpad.net/terminator/+bug/1662544)
subversion (in progress https://subversion.apache.org/docs/rele … l#python3) [EDIT]

Any plan to move these packages to use python3 ?
Any other packages still using python2 ?

Last edited by getzze (2020-01-13 15:44:35)

Offline

#2 2020-01-13 15:38:19

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,670

Re: Python2 end of life

The Arch devs want this at least as much as you do: https://www.archlinux.org/todo/die-python2-die/

Online

#3 2020-01-13 15:42:31

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,042

Re: Python2 end of life

There was a long thread on this in the dev-public mailing lists.  Here is a link to the first email in the archive:
https://lists.archlinux.org/pipermail/a … 29787.html

To answer your questions: yes, yes.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2020-01-13 15:43:11

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,436

Re: Python2 end of life

There are a whole lot of packages using python 2.

How do you figure "no reason not to use python3"? I only checked the first 2, both are optional, and neither are compatible with python 3.

Edit: 3rd one on the list is also bogus, dep is listed and is also optional. This thread is looking more and more useless.

Last edited by Scimmia (2020-01-13 15:55:39)

Offline

#5 2020-01-13 15:53:17

getzze
Member
Registered: 2015-04-08
Posts: 4

Re: Python2 end of life

Thanks for the links, I didn't find anything on the forums so I decided to start this thread.

Some package use python2 optionally but require it as makedepends. That is the case for graphviz and (to confirm) for avahi and ibus.

Offline

#6 2020-01-13 16:07:24

getzze
Member
Registered: 2015-04-08
Posts: 4

Re: Python2 end of life

Scimmia wrote:

Edit: 3rd one on the list is also bogus, dep is listed and is also optional. This thread is looking more and more useless.

For nmap, python2 is not in the dependency list, neither optional, only indirectly through pygtk. And the last line of the PKGBUILD calls python2 explicitly.

Offline

#7 2020-01-13 16:09:50

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,436

Re: Python2 end of life

Deps that are in the chain are valid.

Offline

#8 2020-01-13 22:22:10

teckk
Member
Registered: 2013-02-21
Posts: 353

Re: Python2 end of life

nmap without python2, pygtk, zenmap

asp export nmap

Edit PKGBUILD

# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>

pkgname=nmap
pkgver=7.80
pkgrel=1
pkgdesc='Utility for network discovery and security auditing'
url='https://nmap.org/'
arch=('x86_64')
license=('GPL2')
#makedepends=('pygtk')
optdepends=('pygtk: zenmap'
            'sudo: privilege escalation for zenmap'
            'xterm: privilege escalation for zenmap'
            'kde-cli-tools: privilege escalation for zenmap')
depends=('pcre' 'openssl' 'lua')
validpgpkeys=('436D66AB9A798425FDA0E3F801AF9F036B9355D0')
source=("https://nmap.org/dist/${pkgname}-${pkgver}.tar.bz2"
        "https://nmap.org/dist/sigs/${pkgname}-${pkgver}.tar.bz2.asc")
sha256sums=('fcfa5a0e42099e12e4bf7a68ebe6fde05553383a682e816a7ec9256ab4773faa'
            'SKIP')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	#export PYTHON=python2
	./configure \
		--prefix=/usr \
		--libexecdir=/usr/lib \
		--mandir=/usr/share/man \
		--with-libpcap=included \
        --without-zenmap \

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	#rm "${pkgdir}"/usr/bin/uninstall_*
	install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	#python2 -m compileall "${pkgdir}"/usr/lib/python2.7/site-packages/zenmapCore
}
makepkg
pacman -U nmap..tar.xz

Offline

#9 2020-01-13 23:32:21

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,015

Re: Python2 end of life

getzze wrote:

Python2 will not be receiving any bugfix since January 1st of 2020, so I was planning to remove as many core packages using python2 as possible.

I found some packages that use python2, sometimes without reason as they seam to work with python3:

Exactly one of these packages you found can actually use python3, and that's the one that's already in the repos as python3.

graphviz (no reason not to use python3)

It doesn't work: https://gitlab.com/graphviz/graphviz/is … _242945293

avahi (no reason not to use python3)

python3 is an optdepends, for various things.

python2 is also an optdepends, because of the avahi-bookmarks program.

$ python3 /usr/bin/avahi-bookmarks 
  File "/usr/bin/avahi-bookmarks", line 25
    print "Sorry, to use this tool you need to install Avahi and python-dbus."
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Sorry, to use this tool you need to install Avahi and python-dbus.")?

Do you *really* think this *optional dependency* is incorrect?

nmap (not even in dependency list... only for GUI zenmap, could be split package maybe)

But it's already an optdepends, what additional advantage does a split package bring, for you getting rid of the python2 package?

ibus (no reason not to use python3)

The build system hardcodes python2 and provides no option to switch to python3, please explain your reasoning.

No kidding???

Upstream isn't ready to switch, this is scheduled for gimp 3 if I remember correctly.

pacman -S calibre-python3, unless you use plugins, which most calibre users do, in which case not many plugins actually work on python3. Also, there's occasional crashes, which is why python3 support is considered beta-level and the Arch package still defaults to python2.

We know: https://bugs.archlinux.org/task/62180

scribus (for the next version https://bugs.scribus.net/view.php?id=15030)

So obviously once again, we cannot switch if it is only supported in master.

It's marked here as "support in master": https://wiki.archlinux.org/index.php/Us … conversion

I'm curious what you think we're capable of doing, in these cases.

We could drop the package from the repos, due to its being dead upstream...

Again, what do you think we should do here? Drop the package once we drop python2, because we won't support python2 anymore? It's not even needed at runtime, though, so you personally don't need to worry as it won't install python2 on your machine...

Any plan to move these packages to use python3 ?

It is manifestly obvious that once upstream only supports python3, we will have no choice but to build these with python3.

Less obvious, but I hope a good-faith trust in the Developers and Trusted Users would make this at least somewhat obvious... we like new things, we like using new things, and when new things start being able to use the other new things, we make sure that all the new things throw a party and celebrate their newness together.
Yes, we configure things to use python3 when they can, even if it's theoretically possible to use them with python2. We have been doing so for years, you may recall that we even did this to /usr/bin/python 9 years ago: https://www.archlinux.org/news/python-is-now-python-3/

Any other packages still using python2 ?

Many. Anything that depends on python2, and anything that depends on something that depends on python2. pactree can help you list these.

getzze wrote:

Thanks for the links, I didn't find anything on the forums so I decided to start this thread.

Well, the *user support* forums are hardly the development channel, are they...


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#10 2020-01-14 03:01:59

loqs
Member
Registered: 2014-03-06
Posts: 9,773

Re: Python2 end of life

eschwartz wrote:

python3 is an optdepends, for various things.

python2 is also an optdepends, because of the avahi-bookmarks program.

$ python3 /usr/bin/avahi-bookmarks 
  File "/usr/bin/avahi-bookmarks", line 25
    print "Sorry, to use this tool you need to install Avahi and python-dbus."
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Sorry, to use this tool you need to install Avahi and python-dbus.")?

Do you *really* think this *optional dependency* is incorrect?

https://github.com/lathiat/avahi/pull/201

eschwartz wrote:

graphviz (no reason not to use python3)

It doesn't work: https://gitlab.com/graphviz/graphviz/is … _242945293

https://bugs.archlinux.org/task/65018 configure script issue can be worked around.


Edit:
The other todo list on the removal of python https://www.archlinux.org/todo/conversi … -python-3/

@eschwartz would you happen to know the status of python3 support of sagemath or sugar?

Last edited by loqs (2020-01-14 03:27:42)

Offline

#11 2020-01-14 04:11:10

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,015

Re: Python2 end of life

Looks pretty simple, shame that upstream seems to be dead. hmm

@eschwartz would you happen to know the status of python3 support of sagemath or sugar?

sagemath was switched 12 days ago, with the 9.0 release.

sugar 0.114 is currently packaged with python2, unstable version 0.116 supports python3, dunno about the ecosystem. https://github.com/sugarlabs/sugar/issues/787


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#12 2020-02-14 16:27:26

loqs
Member
Registered: 2014-03-06
Posts: 9,773

Re: Python2 end of life

eschwartz wrote:

Looks pretty simple, shame that upstream seems to be dead. hmm

No new release but PR has been merged.
https://github.com/lathiat/avahi/commit … e2dfdf37a8

It turned out graphviz does support python3 although you need to build python2 bindings at the same time for it to work https://bugs.archlinux.org/task/65018

Offline

Board footer

Powered by FluxBB