FS#23910 - python2-default and python3-default

Attached to Project: Arch Linux
Opened by Radu Potop (wooptoo) - Sunday, 24 April 2011, 08:30 GMT
Last edited by Andrea Scarpino (BaSh) - Monday, 02 May 2011, 19:10 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

It would be nice if we had a way to set a version of python as default. How about having two packages: python2-default and python3-default?

Each of these packages would contain only symlinks:
python2-default would link python -> python2 and python-config -> python2-config
python3-default would link python -> python3 and python-config -> python3-config

Each package should conflict with the other, of course.
This would conform to the upcoming PEP 394: http://www.python.org/dev/peps/pep-0394/
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Monday, 02 May 2011, 19:10 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Forums/MLs are a better place for this thing
Comment by Thomas Dziedzic (tomd123) - Monday, 25 April 2011, 13:51 GMT
Isn't this going to be a problem for files that use #!/usr/bin/python in their header?
Comment by Radu Potop (wooptoo) - Monday, 25 April 2011, 14:08 GMT
This is exactly the thing that it's trying to solve. Files that have #!/usr/bin/python suppose you have python2 installed.
Comment by Thomas Dziedzic (tomd123) - Monday, 25 April 2011, 14:15 GMT
What about when #!/usr/bin/python refers to python3?
Comment by Thomas Dziedzic (tomd123) - Monday, 25 April 2011, 14:15 GMT
And it get's messy when there is multiple programs thinking python points to different versions of python (2/3)
Comment by Radu Potop (wooptoo) - Monday, 25 April 2011, 14:22 GMT
You understood nothing. Come to school with your mom tomorrow.
Comment by Thomas Dziedzic (tomd123) - Monday, 25 April 2011, 20:41 GMT
This is a legitimate concern.
I can't see this "feature request" gaining any credibility without first answering the previous question.
The packages in the repos are packaged assuming python->python3 so there is nothing broken there.
If you introduce a python->python2 optional symlink, the package dependencies will have to be adjusted, a huge headache will ensue, and I can not see this helping out anybody unless those which are too lazy to properly fix their python packages.

"You understood nothing. Come to school with your mom tomorrow."
I beg your pardon? Please elucidate.
Comment by Radu Potop (wooptoo) - Monday, 25 April 2011, 20:56 GMT
Ok so, ideally packages sould have #!/usr/bin/python2 and #!/usr/bin/python3 in their header.
But most packages have #!/usr/bin/python. In this case it should point to python2 (so you would install python2-default), unless you have some special setup and need python3 as default (then install python3-default).
Comment by Thomas Dziedzic (tomd123) - Monday, 25 April 2011, 21:13 GMT
"In this case it should point to python2"
I see this as a packaging problem. Nothing a proper PKGBUILD with some sed/find magic in it can't fix.
Comment by Radu Potop (wooptoo) - Monday, 25 April 2011, 21:16 GMT
Well then, the python2 package should contain the symlink python -> python2, because python2 is supposed to be the default.
Comment by Thomas Dziedzic (tomd123) - Monday, 25 April 2011, 21:47 GMT
python already provides python->python3 which would cause a conflict with python->python2 in the python2 package, making only one version of python possible on a system

it has already been decided that the default python point to python3, http://www.archlinux.org/news/python-is-now-python-3/
and according to the pep you linked to... "python should refer to the same target as python2 but may refer to python3 on some bleeding edge distributions"

So actually no, "because python2 is supposed to be the default" is simply not true.
Comment by Thomas Dziedzic (tomd123) - Monday, 25 April 2011, 21:55 GMT
"Ok so, ideally packages sould have #!/usr/bin/python2 and #!/usr/bin/python3 in their header.
But most packages have #!/usr/bin/python. In this case it should point to python2 (so you would install python2-default), unless you have some special setup and need python3 as default (then install python3-default)."

This in itself shows that the packages are not properly coded and that they should either use python2 or python3 in their headers. Arch shouldn't accommodate incorrect code.
Comment by JM (fijam) - Monday, 02 May 2011, 18:27 GMT
The conclusion appears to be that this bug report is invalid. Candidate for closing.

Loading...