Mailinglist Archive: opensuse-factory (914 mails)

< Previous Next >
Re: [opensuse-factory] Switching default python to Python 3
On 26.6.2017 15:44, Aleksa Sarai wrote:
Is there a plan for python-* packages and how they are going to relate to the
python3-* set of
packages? By which I mean, if I want to install python-numpy will that
install the py3 or py2
version? Or is that all handled by singlespec?

singlespec generates python2-numpy and python3-numpy, so the version is
explicit. Today you
shouldn't have "python-numpy" on your system.

As part of the switch, the "python-numpy" symbol will be provided by
"python3-numpy" instead of python2.

If you now have "python2-numpy", nothing special will happen to replace that
with "python3-numpy".
(at least no plan to do so at the moment)
But a package requiring "python-numpy" will pull in "python3-numpy" instead.


As an aside, when is the plan to merge the two wiki pages[1,2] for Python
packaging? I ask because I
remember trying to package Python a while ago and I don't remember the tiny
mention of single-spec
in the main page.

there is a plan, yes :) but no roadmap. Basically when I have the time, or when
someone else does it.


* note that if a script is using "/usr/bin/python" as shebang (or worse,
"/usr/bin/env python"),
it's already wrong. The shebang must be versioned, unless the script
actually works
with an arbitrary python version

Quick question, is "#!/usr/bin/python3" better or worse than "#!/usr/bin/env
python3"? I've always
used the latter in my own projects because it avoids weird distros breaking
scripts.

For a script that is part of Tumbleweed, the second is wrong and the first is
correct.
This is because "/usr/bin/env" will find a python that a user has installed
into their own path, and
that might be a strange unsupported version which breaks your app ;)

The latter is (only) useful if you're distributing the script between different
distros.


[1]: https://en.opensuse.org/openSUSE:Packaging_Python
[2]: https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec


< Previous Next >