From 1d7647fa857fa718af814f3038d538d758c35201 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Wed, 4 Jun 2014 10:35:13 -0700 Subject: Some tweaks to get closer to Python 3 compat Convert to use idioms that work for both python 3 and python 2.6+ and ensure that a suitable version of dependencies is included for python 3 compatibility. Update python-jenkins to 0.3.3 as the earliest version that supports python 3 without any known regressions. Add an extra parser check for missing 'command' due to changes in how argparse works under python 3. Where contents should be retained, to access the first element of a dict in both python 2 and 3, 'next(iter(dict.items()))' is used as the standard idiom to replace 'dict.items()[0]' as 'items()' returns an iterator in python 3 which cannot be indexed. Using 'next(iter(..))' allows for both lists and iterators to be passed in without unnecessary conversion of iterators to lists which would be true of 'list(dict.items())[0]'. Alternatively, where further access to the data is not required, 'dict.popitem()' is used. Change-Id: If4b35e2ceee8239379700e22eb79a3eaa04d6f0f --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'requirements.txt') diff --git a/requirements.txt b/requirements.txt index cc7e45d8..30110f64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ argparse +six>=1.5.2 PyYAML -python-jenkins +python-jenkins>=0.3.3 pbr>=0.8.2,<1.0 -- cgit