Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-15 Thread Florian Festi
Closed #212.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#event-1082511411___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-15 Thread Florian Festi
I think this is a lesson how thinking needs to be different between one 
particular (or even all) distribution and rpm upstream. There is just no point 
for rpm upstream to switch from one old thing to the new thing while everyone 
else is also switching. This just complicates stuff for everyone.
The right way is staying with the old default and have the distributions patch 
things whenever they are ready. And only after no one remembers the reason for 
the old result we can change to the new thing and have the distributions drop 
their patch on the next update.
Closing.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-301515664___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-15 Thread Igor Gnatenko
I would say that there is no good patch, so distros would have to patch 
something anyway, so I would close it as well.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-301461891___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-15 Thread torsava
So seeing as no one has the resources to guide the larger patch, then unless 
you find the simple shebang change acceptable, I suggest we close the issue.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-301459911___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-10 Thread torsava
So, to conclude the discussion: I don't really have the know-how and time to 
push through the more complicated change that @proyvind proposed. Would you be 
interested in leading that, @proyvind ? I would help where I can.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-300476838___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-05 Thread torsava
> As distros completes their migration to python 3 and no python 2 package 
> installed on system, any py3k compatible script from packages in distro using 
> /usr/bin/python as shebang will be left broken, for which there surely are 
> quite a few.

That's exactly what you want and why Fedora, RHEL, openSUSE and Mageia follow 
upstream recommendation in PEP 394. This way you'll know about scripts that 
aren't ported yet and you can fix them. Otherwise you would be running old 
Python 2 scripts on Python 3 which might run fine in 99% of cases and fail only 
in weird corner cases. And that's a huge pain to debug as you know.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299409590___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-04 Thread proyvind
the philosophical discussion regarding is anyways rather moot, but the patch 
from my earlier comment should anyways be sufficient to address it properly. :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299267220___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-04 Thread proyvind
OpenMandriva uses python 3 as default, with /usr/bin/python pointing to python3.
AFAIK Mageia doesn't intentionally follow PEP 394 as much as it rather hasn't 
switched to python3 as it's default yet, where ie. python packages prefixed 
with python- are python 2, while python 3 packages are prefixed with python3-...


As distros completes their migration to python 3 and no python 2 package 
installed on system, any py3k compatible script from packages in distro using 
/usr/bin/python as shebang will be left broken, for which there surely are 
quite a few.

PEP 394 doesn't take the flipped situation py3k compatible scripts with 
/usr/bin/python as shebang into reasonable enough consideration, where such 
scripts are already and growingly in majority.

For old sys admin scripts, more realistic/sane scenarios would be for the sys 
admins running something non-cutting edge releases like RHEL/CentOS etc.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299258863___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-04 Thread ニール・ゴンパ
>> Welcome back to 2017, Mandriva is dead ;)

> Ah, that explains it :)

Mageia is still here, and we follow PEP 394. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299249293___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-04 Thread proyvind
First of all, while PEP 394 recommends this, it's not what's common practice 
amongst distros, where Arch not even being a RPM based distro makes it less 
relevant.

I know of no rpm based distros where /usr/bin/python isn't pointing to the 
default python interpreter binary version. Also using shell aliases to set the 
default binary to use isn't really a good idea as these aliases are internal to 
the shell instance itself only in contrast to environment variables and paths.

While python upstream plans to EOL python 2 in two years, distributions 
interest and priorities aren't the same. The usual approach is to either only 
keep python 2 around untill everything still depending on and not ported to 
py3k and/or at least not install any python2 packages by default, where if 
/usr/bin/python had to point to python2, that would leave one in a tricky 
situation if only python 3 is installed.

However, if you really think this is a necessity (where forcing distros still 
using python2 to patch the shebang themself would be considered less acceptable 
than not adhering to PEP 394), the patch betlow would be the more proper way to 
achieve your goal.

This one also ensures that this $PYTHON is used for both %__python and the 
python bindings as well.
``
From 2ca7cc81357fc61fd017bae0cf3c109345224216 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= 
Date: Thu, 4 May 2017 14:30:54 +0200
Subject: [PATCH] allow to set default python interpreter with $PYTHON during
 ./configure

---
 configure.ac| 3 ++-
 python/setup.py.in  | 2 +-
 scripts/{pythondistdeps.py => pythondistdeps.py.in} | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
 rename scripts/{pythondistdeps.py => pythondistdeps.py.in} (99%)

diff --git a/configure.ac b/configure.ac
index b41a4c9..0f8c202 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,7 +129,7 @@ AC_MSG_CHECKING(old version of patch)
 
 AC_PATH_PROG(__PERL, perl, /usr/bin/perl, $MYPATH)
 AC_PATH_PROG(__PGP, pgp, /usr/bin/pgp, $MYPATH)
-AC_PATH_PROG(__PYTHON, python, /usr/bin/python, $MYPATH) 
+AC_PATH_PROG(__PYTHON, [$PYTHON python], $PYTHON, [/usr/bin/python], $MYPATH)
 AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
 AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
 AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
@@ -1016,5 +1016,6 @@ AC_CONFIG_FILES([Makefile
tests/Makefile
plugins/Makefile
python/setup.py
+   scripts/pythondistdeps.py
   ])
 AC_OUTPUT
diff --git a/python/setup.py.in b/python/setup.py.in
index 87c7358..534688b 100644
--- a/python/setup.py.in
+++ b/python/setup.py.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!@__PYTHON@
 
 from distutils.core import setup, Extension
 import subprocess
diff --git a/scripts/pythondistdeps.py b/scripts/pythondistdeps.py.in
similarity index 99%
rename from scripts/pythondistdeps.py
rename to scripts/pythondistdeps.py.in
index 36590ba..408a1de 100755
--- a/scripts/pythondistdeps.py
+++ b/scripts/pythondistdeps.py.in
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!@__PYTHON@
 # -*- coding: utf-8 -*-
 #
 # Copyright 2010 Per Øyvind Karlsen 
-- 
2.10.2



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299175921___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-04 Thread torsava
> This makes no sense, /usr/bin/python is usually the linked to the binary of 
> the default python version in use on distros, so hardcoding the version makes 
> no sense.

That is a common misconception. While some distros went ahead and switched 
`/usr/bin/python` to Python 3, most notably Arch Linux, most are keeping it 
pointing to Python 2 and will continue to do so at least until Python 2 EOL in 
2020. Upstream Python issued a recommendation to that effect as well: [PEP 394 
-- The "python" Command on Unix-Like 
Systems](https://www.python.org/dev/peps/pep-0394/#abstract)

So while most distros that will be using the latest RPM already switched to 
Python 3 being default, the binary `/usr/bin/python` still points to Python 2. 
That means that most distros will need to patch this shebang to 
`/usr/bin/python3` before deploying.

I propose that we switch the shebang to explicitly Python 3 by default. There 
possibly might be some distros that will be using the latest RPM version but 
still haven't switched to Python 3 being default (and they will need to patch 
this shebang back to Python 2), but I'd wager it will be a minuscule number 
compared to Python 3–default distros.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299131961___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-03 Thread Igor Gnatenko
well, I think we should have some configure switch which interpreter to use for 
all of python scripts... But this PR as it is a bit ugly..

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299013392___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-03 Thread proyvind
This makes no sense, /usr/bin/python is usually the linked to the binary of the 
default python version in use on distros, so hardcoding the version makes no 
sense.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#issuecomment-299013062___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Change the shebang of pythondistdeps.py to Python 3 (#212)

2017-05-03 Thread ニール・ゴンパ
Conan-Kudo approved this pull request.

I don't have a problem with this.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/212#pullrequestreview-36056750___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint