Friday, 4 March 2016

Re: Knocking Python 2 off the desktop iso

On 03/04/2016 04:27 PM, Barry Warsaw wrote:
> A long standing goal for Ubuntu has been the demotion of Python 2 off of the
> default installation images[1]. This is something many folks have been
> working on for quite a few cycles, and it's finally within our reach for
> desktop (server and touch already have no Python 2 on it). Of course this is
> within the context of a much longer term, cross distro effort to port the
> entire world to Python 3 <wink>.
> We have one last thing holding Python 2 on the desktop image, and it's a
> problematic one: system-config-printer. Actually s-c-p is already itself
> ported to Python 3, but it transitively depends on Python 2 through the chain
> of python3-smbc -> libsmbclient -> samba-libs -> libpython2.7. So the real
> problem is fully porting Samba to Python 3. Ubuntu is not the only distro
> converging on this bottleneck.
> Clearly, we won't have an untangled the Samba stack in time for 16.04. I'm
> proposing instead to demote python3-smbc to a Suggests[2] for
> system-config-printer, which should drop it from the desktop image, thus
> allowing us to purge libpython2.7, python2.7, and python.
> The downside of course is that you won't be able to automatically detect
> Windows printers after a default install. For users who don't have network
> attached (e.g. IPP) printers, that's a hardship. The question is whether
> there are enough users who fall into that category to outweigh keeping the
> full Python 2 stack on the image.
> There's a middle way perhaps. It's not fantastic, but there is precedence.
> In a similar situation, deja-dup depends on duplicity which has not yet been
> ported, so in order to do backups, deja-dup exposes a button to install some
> additional packages. That of course pulls Python 2 back in, but it does at
> least keep the desktop iso smaller and doesn't affect anybody who doesn't want
> to do backups[3].
> In a similar way, we could do a runtime check in system-config-printer to see
> if the python3-smbc library is available, and if not, expose a button to
> install the necessary package if the user wants to search for a Windows
> printer. There are already places in the code that catch ImportErrors if the
> Samba-requiring bits aren't available, so s-c-p should continue to work
> without it. That would allow us to knock Python 2 off of desktop, and users
> without Windows printers could ignore the reduction in functionality, while
> users with Windows printers would at least have a discoverable path to adding
> that functionality back.
> Given how close we are to completing this long-term effort, I'd vote for just
> the Suggests demotion or adding the button. But I'm admittedly biased. :)

See also
Demote python3-smbc to a Suggests

I am already investigating. I will in any case demote python3-smbc to
Suggests, but I am also looking for whether there is a way to let the
package being installed (with user confirmation) when he clicks "Browse"
or "Verify" on the panel for finding Windows (SMB) network printers.
This is the only place where s-c-p uses python3-smbc.

I am trying with the functionality in
/usr/share/system-config-printer/ which is used at
another place in /usr/share/system-config-printer/ to
install the package, but the problem here is that the call of
self.iface.InstallPackageNames() already exits after the user has
entered his password, and does not wait until the package is installed.
It also does not tell me whether the user has actually opted for
installing the package or cancelled, so I do not even know whether to
wait or not. Jiri, could you help here?


ubuntu-devel mailing list
Modify settings or unsubscribe at: