Bug #5137

[SDKs] Add Python version test 2.7 <= sys.version_info < 3

Added by Peter Amstutz over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
SDKs
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Story points:
0.5

Description

<tetron> brett: regarding #5136 any thoughts on how to warn the user if they are using Python < 2.7 ?
<brett> tetron: Inspect sys.version_info.
<tetron> so in arvados/__init__.py we should put a test at the top
<brett> Have arvados/__init__.py raise an ImportError or something. Don't see much point warning when it's never going to work.
<tetron> and bail out if sys.version_info isn't 2.7 or greater
<tetron> I'll add a ticket to bug triage
<brett> We should just check that major and minor are exactly 2.7.
<brett> It's not going to work under Python 3 either.
<tetron> er
<tetron> yes
<brett> Well, I guess for total correctness check 2.7 <= v < 3.0.
<tetron> I was thinking more about a hypothetical Python 2.8
<brett> It's never going to happen but sure.
<tetron> brett: #5137


Related issues

Related to Arvados - Bug #5136: arv-run arv-keep command gives error while runningNew02/04/201502/05/2015

History

#1 Updated by Peter Amstutz over 4 years ago

  • Description updated (diff)

#2 Updated by Brett Smith over 4 years ago

  • Category set to SDKs

#3 Updated by Brett Smith over 4 years ago

In order for the proposal to work, the old version of Python has to be able to compile and run arvados/__init__.py up through where the check is. Otherwise, users will get some kind of SyntaxError instead. The syntax currently in that file is pretty conservative, but the more conservative we make it, the better. The ternary operator and context managers ("with" statements) were added in Python 2.5. Syntax newer than that includes set literals and dictionary comprehensions.

At a first glance, I think we could make this file compile in all of Python 2.x if we flattened the ternary operator in logging setup.

#4 Updated by Tom Clegg over 4 years ago

  • Target version changed from Bug Triage to 2015-03-11 sprint

#5 Updated by Ward Vandewege over 4 years ago

  • Target version changed from 2015-03-11 sprint to 2015-04-01 sprint

#6 Updated by Brett Smith over 4 years ago

  • Assigned To set to Brett Smith

#7 Updated by Ward Vandewege over 4 years ago

  • Target version changed from 2015-04-01 sprint to Arvados Future Sprints

#8 Updated by Ward Vandewege over 4 years ago

  • Assigned To deleted (Brett Smith)

Also available in: Atom PDF