Re: [PATCH] t/lib-cvs: cvsimport no longer works without Python = 2.7

2013-01-13 Thread John Keeping
On Sat, Jan 12, 2013 at 04:27:36PM +0100, Michael Haggerty wrote:
  Even if we were to rip out the fallback code that uses the 2.7-only
  subprocess.check_output() on cvsps -V, the function is also used
  for doing the real work interacting with cvsps-3.x, so I think this
  patch will be necessary.  Unless new cvsimport is tweaked not to
  use the method, that is.
 
  A suggestion for a better alternative is of course very much
  appreciated.
 
 If the only reason to require Python 2.7 is subprocess.check_output(),
 it would be easy to reimplement it (it is only 12 lines of
 straightforward code, plus a few lines to define the exception type
 CalledProcessError).  According to [1], the Python license is
 GPL-compatible; therefore these lines could even be copied into
 git-cvsimport.

Note that this has already be done in git_remote_helpers.util.  Is there
any reason not to just reference that?


John
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] t/lib-cvs: cvsimport no longer works without Python = 2.7

2013-01-12 Thread Junio C Hamano
The new cvsimport requires at least Python 2.7 to work; do not fail
the cvsimport tests on platforms without one.

Signed-off-by: Junio C Hamano gits...@pobox.com
---

 Junio C Hamano gits...@pobox.com writes:

  http://docs.python.org/2/library/subprocess.html tells me that
  check_output has first become available in 2.7.
 
  So... does this mean that we now set the minimum required version of
  Python to 2.7?  I dunno.

 Even if we were to rip out the fallback code that uses the 2.7-only
 subprocess.check_output() on cvsps -V, the function is also used
 for doing the real work interacting with cvsps-3.x, so I think this
 patch will be necessary.  Unless new cvsimport is tweaked not to
 use the method, that is.

 A suggestion for a better alternative is of course very much
 appreciated.

 I do not want to keep pushing integration results that do not pass
 tests even for myself for too many integration cycles, so I'll keep
 this patch at the tip of the topic, at least for now.

 t/lib-cvs.sh | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index b55e861..4e890ea 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -27,6 +27,21 @@ case $cvsps_version in
;;
 esac
 
+if ! test_have_prereq PYTHON
+then
+   skipall='skipping cvsimport tests, no python'
+   test_done
+fi
+
+python -c '
+import sys
+if sys.hexversion  0x0207:
+   sys.exit(1)
+' || {
+   skip_all='skipping cvsimport tests, python too old ( 2.7)'
+   test_done
+}
+
 setup_cvs_test_repository () {
CVSROOT=$(pwd)/.cvsroot 
cp -r $TEST_DIRECTORY/$1/cvsroot $CVSROOT 
-- 
1.8.1.421.g6236851

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] t/lib-cvs: cvsimport no longer works without Python = 2.7

2013-01-12 Thread Michael Haggerty
I have the feeling I'm only seeing one side of this conversation...

On 01/12/2013 09:40 AM, Junio C Hamano wrote:
 The new cvsimport requires at least Python 2.7 to work; do not fail
 the cvsimport tests on platforms without one.
 
 Signed-off-by: Junio C Hamano gits...@pobox.com
 ---
 
  Junio C Hamano gits...@pobox.com writes:
 
   http://docs.python.org/2/library/subprocess.html tells me that
   check_output has first become available in 2.7.
  
   So... does this mean that we now set the minimum required version of
   Python to 2.7?  I dunno.

It would be unfortunate to set the minimum Python version to 2.7 if git
cvsimport is considered an integral part of git.

  Even if we were to rip out the fallback code that uses the 2.7-only
  subprocess.check_output() on cvsps -V, the function is also used
  for doing the real work interacting with cvsps-3.x, so I think this
  patch will be necessary.  Unless new cvsimport is tweaked not to
  use the method, that is.
 
  A suggestion for a better alternative is of course very much
  appreciated.

If the only reason to require Python 2.7 is subprocess.check_output(),
it would be easy to reimplement it (it is only 12 lines of
straightforward code, plus a few lines to define the exception type
CalledProcessError).  According to [1], the Python license is
GPL-compatible; therefore these lines could even be copied into
git-cvsimport.

Michael

[1] http://www.gnu.org/licenses/license-list.html#Python

-- 
Michael Haggerty
mhag...@alum.mit.edu
http://softwareswirl.blogspot.com/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html