You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by qu...@apache.org on 2017/12/16 14:29:12 UTC
[1/4] libcloud git commit: contrib: Update tox Dockerfile
Repository: libcloud
Updated Branches:
refs/heads/trunk ab84b0304 -> 25c4d99b5
contrib: Update tox Dockerfile
Stop testing Python 2.6 and 3.3
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/74c1db85
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/74c1db85
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/74c1db85
Branch: refs/heads/trunk
Commit: 74c1db8568fed97acb34f726d4e66c571b8535c9
Parents: 987a22d
Author: Quentin Pradet <qu...@apache.org>
Authored: Sat Dec 16 10:47:41 2017 +0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Sat Dec 16 18:28:00 2017 +0400
----------------------------------------------------------------------
contrib/Dockerfile | 20 ++++++--------------
contrib/run_tests.sh | 2 +-
2 files changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/74c1db85/contrib/Dockerfile
----------------------------------------------------------------------
diff --git a/contrib/Dockerfile b/contrib/Dockerfile
index 2a49c46..eabf990 100644
--- a/contrib/Dockerfile
+++ b/contrib/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:14.04
+FROM ubuntu:16.04
RUN set -e && \
apt-get update && \
@@ -6,30 +6,22 @@ RUN set -e && \
software-properties-common \
wget \
ssh && \
- add-apt-repository ppa:fkrull/deadsnakes && \
+ add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get -y install \
- python2.6 \
python2.7 \
- python3.2 \
- python3.3 \
python3.4 \
python3.5 \
+ python3.6 \
python-dev \
- python2.6-dev \
python2.7-dev \
- python3.2-dev \
- python3.3-dev \
python3.4-dev \
python3.5-dev \
+ python3.6-dev \
+ pypy \
python-pip
RUN set -e && \
- wget https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux64.tar.bz2 && \
- tar xf ./pypy-2.5.0-linux64.tar.bz2 -C /opt && \
- ln -s /opt/pypy-2.5.0-linux64/bin/pypy /usr/local/bin/pypy
-
-RUN set -e && \
pip install tox \
mock \
lockfile \
@@ -37,4 +29,4 @@ RUN set -e && \
COPY . /libcloud
WORKDIR /libcloud
-CMD tox -e py2.6,py2.7,pypypy,py3.2,py3.3,py3.4,py3.5,lint
+CMD tox -e py2.7,pypypy,py3.4,py3.5,py3.6,lint
http://git-wip-us.apache.org/repos/asf/libcloud/blob/74c1db85/contrib/run_tests.sh
----------------------------------------------------------------------
diff --git a/contrib/run_tests.sh b/contrib/run_tests.sh
index 45032d8..06840a3 100755
--- a/contrib/run_tests.sh
+++ b/contrib/run_tests.sh
@@ -21,7 +21,7 @@
#
# Script which builds a testing docker image and container,
# install the necessary packages: pypy, pip, python versions
-# 2.6, 2.7, 3.2, 3.3, 3.4 (corresponding dev packages as well)
+# 2.7, 3.3, 3.4, 3.5 and 3.6 (corresponding dev packages as well)
# and run the tox tests within the container.
# The script has to be run from libcloud root.
[2/4] libcloud git commit: Fix paramiko tests on Python 2.7
Posted by qu...@apache.org.
Fix paramiko tests on Python 2.7
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/987a22d7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/987a22d7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/987a22d7
Branch: refs/heads/trunk
Commit: 987a22d7c384c8fff4a0a02ec4d1f6f93d043e7d
Parents: ab84b03
Author: Quentin Pradet <qu...@apache.org>
Authored: Sat Dec 16 10:50:45 2017 +0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Sat Dec 16 18:28:00 2017 +0400
----------------------------------------------------------------------
libcloud/__init__.py | 4 +++-
libcloud/test/test_init.py | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/987a22d7/libcloud/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/__init__.py b/libcloud/__init__.py
index 1d53281..f59a8a1 100644
--- a/libcloud/__init__.py
+++ b/libcloud/__init__.py
@@ -18,6 +18,7 @@ libcloud provides a unified interface to the cloud computing resources.
:var __version__: Current version of libcloud
"""
+import logging
import os
import codecs
@@ -78,6 +79,7 @@ def _init_once():
enable_debug(fo)
if have_paramiko:
- paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG)
+ paramiko_logger = paramiko.util.logging.getLogger()
+ paramiko_logger.setLevel(logging.DEBUG)
_init_once()
http://git-wip-us.apache.org/repos/asf/libcloud/blob/987a22d7/libcloud/test/test_init.py
----------------------------------------------------------------------
diff --git a/libcloud/test/test_init.py b/libcloud/test/test_init.py
index d512d3b..d088cb9 100644
--- a/libcloud/test/test_init.py
+++ b/libcloud/test/test_init.py
@@ -41,7 +41,7 @@ class TestUtils(unittest.TestCase):
if have_paramiko:
logger = paramiko.util.logging.getLogger()
paramiko_log_level = logger.getEffectiveLevel()
- self.assertEqual(paramiko_log_level, logging.WARNING)
+ self.assertEqual(paramiko_log_level, logging.NOTSET)
# Enable debug mode
os.environ['LIBCLOUD_DEBUG'] = '/dev/null'
[4/4] libcloud git commit: Remove support for Python <2.7 and <3.4
Posted by qu...@apache.org.
Remove support for Python <2.7 and <3.4
They're no longer supported, and the Python ecosystem is starting to
drop support: two of our test dependencies no longer support them.
Closes #1150
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/25c4d99b
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/25c4d99b
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/25c4d99b
Branch: refs/heads/trunk
Commit: 25c4d99b50017e4fd233ad03fa56d337e99ef451
Parents: 2224ec7
Author: Quentin Pradet <qu...@apache.org>
Authored: Sat Dec 16 12:39:53 2017 +0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Sat Dec 16 18:28:05 2017 +0400
----------------------------------------------------------------------
.travis.yml | 10 ----------
CHANGES.rst | 5 +++++
docs/other/using-http-proxy.rst | 4 ----
libcloud/test/__init__.py | 7 +------
libcloud/utils/py3.py | 14 --------------
setup.py | 7 +------
tox.ini | 7 ++-----
7 files changed, 9 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/25c4d99b/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index c07208b..128549c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,9 +2,7 @@ language: python
sudo: false
# Add or remove version for match with Travis support
python:
- - 2.6
- 2.7
- - 3.3
- 3.4
- 3.5
- 3.6
@@ -48,14 +46,6 @@ matrix:
# Trigger ReadTheDocs build on docs builder
after_success:
- ./contrib/trigger_rtd_build.py 8284
- # For now allow failures of all the builds which use lxml
- allow_failures:
- - env: ENV=coverage
- - env:
- python: pypy3
- - env:
- python: pypy
- # Trigger ReadTheDocs build
install:
- pip install --upgrade "pip==9.0.1"
http://git-wip-us.apache.org/repos/asf/libcloud/blob/25c4d99b/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 0f19b18..deb451e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,11 @@
Changes in Apach Libcloud in development
----------------------------------------
+- Drop support for Python 2.6 and Python 3.3
+ They're no longer supported, and the Python ecosystem is starting to
+ drop support: two of our test dependencies no longer support them.
+ [Quentin Pradet]
+
Common
~~~~~~
http://git-wip-us.apache.org/repos/asf/libcloud/blob/25c4d99b/docs/other/using-http-proxy.rst
----------------------------------------------------------------------
diff --git a/docs/other/using-http-proxy.rst b/docs/other/using-http-proxy.rst
index 1a8699a..651fdd7 100644
--- a/docs/other/using-http-proxy.rst
+++ b/docs/other/using-http-proxy.rst
@@ -9,11 +9,7 @@ Libcloud supports using an HTTP proxy for outgoing HTTP and HTTPS requests.
Proxy support has been tested with the following Python versions;
-* Python 2.6
* Python 2.7 / PyPy
-* Python 3.1
-* Python 3.2
-* Python 3.3
* Python 3.4
You can specify which HTTP proxy to use using one of the approaches described
http://git-wip-us.apache.org/repos/asf/libcloud/blob/25c4d99b/libcloud/test/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/test/__init__.py b/libcloud/test/__init__.py
index 645105e..149de42 100644
--- a/libcloud/test/__init__.py
+++ b/libcloud/test/__init__.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import unittest
import random
import requests
from libcloud.common.base import Response
@@ -31,12 +32,6 @@ from libcloud.utils.py3 import urlparse
from libcloud.utils.py3 import parse_qs
from libcloud.utils.py3 import parse_qsl
from libcloud.utils.py3 import urlquote
-from libcloud.utils.py3 import unittest2_required
-
-if unittest2_required:
- import unittest2 as unittest
-else:
- import unittest
XML_HEADERS = {'content-type': 'application/xml'}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/25c4d99b/libcloud/utils/py3.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/py3.py b/libcloud/utils/py3.py
index 645ffc7..955cb6e 100644
--- a/libcloud/utils/py3.py
+++ b/libcloud/utils/py3.py
@@ -37,30 +37,21 @@ except ImportError:
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
-PY2_pre_27 = PY2 and sys.version_info < (2, 7)
PY2_pre_279 = PY2 and sys.version_info < (2, 7, 9)
PY2 = False
-PY26 = False
PY27 = False
PY3 = False
-PY32 = False
if sys.version_info >= (2, 0) and sys.version_info < (3, 0):
PY2 = True
-if sys.version_info >= (2, 6) and sys.version_info < (2, 7):
- PY26 = True
-
if sys.version_info >= (2, 7) and sys.version_info < (2, 8):
PY27 = True
if sys.version_info >= (3, 0):
PY3 = True
-if sys.version_info >= (3, 2) and sys.version_info < (3, 3):
- PY32 = True
-
if PY2_pre_279:
try:
from backports.ssl_match_hostname import match_hostname, CertificateError # NOQA
@@ -197,8 +188,3 @@ else:
def hexadigits(s):
# s needs to be a string.
return [x.encode("hex") for x in s]
-
-if PY27 or PY3:
- unittest2_required = False
-else:
- unittest2_required = True
http://git-wip-us.apache.org/repos/asf/libcloud/blob/25c4d99b/setup.py
----------------------------------------------------------------------
diff --git a/setup.py b/setup.py
index b58ff9f..2b54296 100644
--- a/setup.py
+++ b/setup.py
@@ -66,12 +66,7 @@ TEST_REQUIREMENTS = [
if PY2_pre_279:
TEST_REQUIREMENTS.append('backports.ssl_match_hostname')
-if PY2_pre_27:
- unittest2_required = True
-else:
- unittest2_required = False
-
-if PY2_pre_26 or PY3_pre_34:
+if PY2_pre_27 or PY3_pre_34:
version = '.'.join([str(x) for x in sys.version_info[:3]])
print('Version ' + version + ' is not supported. Supported versions are ' +
', '.join(SUPPORTED_VERSIONS))
http://git-wip-us.apache.org/repos/asf/libcloud/blob/25c4d99b/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index 7319fd3..73c9714 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,22 +1,19 @@
[tox]
-envlist = py{2.6,2.7,pypy,pypy3,3.3,3.4,3.5,3.6},checks,lint,pylint,integration,coverage
+envlist = py{2.7,pypy,pypy3,3.4,3.5,3.6},checks,lint,pylint,integration,coverage
[testenv]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
-r{toxinidir}/requirements-tests.txt
lockfile
- py{2.6,2.7}: paramiko
- py{2.6}: unittest2
+ py2.7: paramiko
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
python setup.py test
basepython =
- py2.6: python2.6
{py2.7,checks,lint,pylint,coverage}: python2.7
docs: python3.5
pypypy: pypy
pypypy3: pypy3
- py3.3: python3.3
py3.4: python3.4
py3.5: python3.5
py3.6: python3.6
[3/4] libcloud git commit: Finish removing support for Python 2.5/3.2
Posted by qu...@apache.org.
Finish removing support for Python 2.5/3.2
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2224ec79
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2224ec79
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2224ec79
Branch: refs/heads/trunk
Commit: 2224ec797e1a6dae197b30eaa27cb04f2391f60c
Parents: 74c1db8
Author: Quentin Pradet <qu...@apache.org>
Authored: Sat Dec 16 11:41:45 2017 +0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Sat Dec 16 18:28:05 2017 +0400
----------------------------------------------------------------------
docs/testing.rst | 7 ++---
libcloud/common/base.py | 11 ++------
libcloud/test/common/test_openstack.py | 11 ++------
libcloud/utils/py3.py | 41 +++--------------------------
setup.py | 11 +++-----
5 files changed, 14 insertions(+), 67 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/2224ec79/docs/testing.rst
----------------------------------------------------------------------
diff --git a/docs/testing.rst b/docs/testing.rst
index 3a8511d..26461d5 100644
--- a/docs/testing.rst
+++ b/docs/testing.rst
@@ -34,10 +34,7 @@ To run the tests on all the supported Python versions run the following command:
.. sourcecode:: bash
- sudo tox
-
-You need to run this command as a root user, because Python 2.5 depends on ssl
-module and you need root permissions to install it.
+ tox
Running Tests Manually
----------------------
@@ -81,7 +78,7 @@ contains the test coverage.
Running tests inside a Docker container
---------------------------------------
-To run the tests on all the supported Python versions (minus Python 2.5), run
+To run the tests on all the supported Python versions, run
the following command:
.. sourcecode:: bash
http://git-wip-us.apache.org/repos/asf/libcloud/blob/2224ec79/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index fbcdd92..24fdbdb 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import json
import os
import sys
import ssl
@@ -23,16 +24,10 @@ import time
from libcloud.utils.py3 import ET
-try:
- import simplejson as json
-except:
- import json
-
import requests
import libcloud
-from libcloud.utils.py3 import PY25
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import urlparse
from libcloud.utils.py3 import urlencode
@@ -439,9 +434,7 @@ class Connection(object):
if not hasattr(kwargs, 'cert_file') and hasattr(self, 'cert_file'):
kwargs.update({'cert_file': getattr(self, 'cert_file')})
- # Timeout is only supported in Python 2.6 and later
- # http://docs.python.org/library/httplib.html#httplib.HTTPConnection
- if self.timeout and not PY25:
+ if self.timeout:
kwargs.update({'timeout': self.timeout})
if self.proxy_url:
http://git-wip-us.apache.org/repos/asf/libcloud/blob/2224ec79/libcloud/test/common/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/common/test_openstack.py b/libcloud/test/common/test_openstack.py
index b5e9341..4f5420b 100644
--- a/libcloud/test/common/test_openstack.py
+++ b/libcloud/test/common/test_openstack.py
@@ -19,7 +19,6 @@ import unittest
from mock import Mock
from libcloud.common.base import LibcloudConnection
from libcloud.common.openstack import OpenStackBaseConnection
-from libcloud.utils.py3 import PY25
class OpenStackBaseConnectionTest(unittest.TestCase):
@@ -38,14 +37,8 @@ class OpenStackBaseConnectionTest(unittest.TestCase):
def test_base_connection_timeout(self):
self.connection.connect()
self.assertEqual(self.connection.timeout, self.timeout)
- if PY25:
- self.connection.conn_class.assert_called_with(host='127.0.0.1',
- port=443)
- else:
- self.connection.conn_class.assert_called_with(host='127.0.0.1',
- secure=1,
- port=443,
- timeout=10)
+ self.connection.conn_class.assert_called_with(
+ host='127.0.0.1', secure=1, port=443, timeout=10)
if __name__ == '__main__':
http://git-wip-us.apache.org/repos/asf/libcloud/blob/2224ec79/libcloud/utils/py3.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/py3.py b/libcloud/utils/py3.py
index 9b7a866..645ffc7 100644
--- a/libcloud/utils/py3.py
+++ b/libcloud/utils/py3.py
@@ -37,14 +37,10 @@ except ImportError:
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
-PY2_pre_25 = PY2 and sys.version_info < (2, 5)
-PY2_pre_26 = PY2 and sys.version_info < (2, 6)
PY2_pre_27 = PY2 and sys.version_info < (2, 7)
PY2_pre_279 = PY2 and sys.version_info < (2, 7, 9)
-PY3_pre_32 = PY3 and sys.version_info < (3, 2)
PY2 = False
-PY25 = False
PY26 = False
PY27 = False
PY3 = False
@@ -53,9 +49,6 @@ PY32 = False
if sys.version_info >= (2, 0) and sys.version_info < (3, 0):
PY2 = True
-if sys.version_info >= (2, 5) and sys.version_info < (2, 6):
- PY25 = True
-
if sys.version_info >= (2, 6) and sys.version_info < (2, 7):
PY26 = True
@@ -68,7 +61,7 @@ if sys.version_info >= (3, 0):
if sys.version_info >= (3, 2) and sys.version_info < (3, 3):
PY32 = True
-if PY2_pre_279 or PY3_pre_32:
+if PY2_pre_279:
try:
from backports.ssl_match_hostname import match_hostname, CertificateError # NOQA
except ImportError:
@@ -157,17 +150,10 @@ else:
from __builtin__ import reload # NOQA
- if PY25:
- import cgi
-
- parse_qs = cgi.parse_qs
- parse_qsl = cgi.parse_qsl
- else:
- parse_qs = urlparse.parse_qs
- parse_qsl = urlparse.parse_qsl
+ parse_qs = urlparse.parse_qs
+ parse_qsl = urlparse.parse_qsl
- if not PY25:
- from os.path import relpath # NOQA
+ from os.path import relpath # NOQA
# Save the real value of unicode because urlquote needs it to tell the
# difference between a unicode string and a byte string.
@@ -212,25 +198,6 @@ else:
# s needs to be a string.
return [x.encode("hex") for x in s]
-if PY25:
- import posixpath
-
- # Taken from http://jimmyg.org/work/code/barenecessities/index.html
- # (MIT license)
- # pylint: disable=function-redefined
- def relpath(path, start=posixpath.curdir): # NOQA
- """Return a relative version of a path"""
- if not path:
- raise ValueError("no path specified")
- start_list = posixpath.abspath(start).split(posixpath.sep)
- path_list = posixpath.abspath(path).split(posixpath.sep)
- # Work out how much of the filepath is shared by start and path.
- i = len(posixpath.commonprefix([start_list, path_list]))
- rel_list = [posixpath.pardir] * (len(start_list) - i) + path_list[i:]
- if not rel_list:
- return posixpath.curdir
- return posixpath.join(*rel_list)
-
if PY27 or PY3:
unittest2_required = False
else:
http://git-wip-us.apache.org/repos/asf/libcloud/blob/2224ec79/setup.py
----------------------------------------------------------------------
diff --git a/setup.py b/setup.py
index f9be490..b58ff9f 100644
--- a/setup.py
+++ b/setup.py
@@ -36,11 +36,10 @@ libcloud.utils.SHOW_DEPRECATION_WARNING = False
# installed / available
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
-PY2_pre_25 = PY2 and sys.version_info < (2, 5)
+PY3_pre_34 = PY3 and sys.version_info < (3, 4)
PY2_pre_26 = PY2 and sys.version_info < (2, 6)
PY2_pre_27 = PY2 and sys.version_info < (2, 7)
PY2_pre_279 = PY2 and sys.version_info < (2, 7, 9)
-PY3_pre_32 = PY3 and sys.version_info < (3, 2)
HTML_VIEWSOURCE_BASE = 'https://svn.apache.org/viewvc/libcloud/trunk'
PROJECT_BASE_DIR = 'http://libcloud.apache.org'
@@ -64,7 +63,7 @@ TEST_REQUIREMENTS = [
'pytest-runner'
]
-if PY2_pre_279 or PY3_pre_32:
+if PY2_pre_279:
TEST_REQUIREMENTS.append('backports.ssl_match_hostname')
if PY2_pre_27:
@@ -72,7 +71,7 @@ if PY2_pre_27:
else:
unittest2_required = False
-if PY2_pre_25:
+if PY2_pre_26 or PY3_pre_34:
version = '.'.join([str(x) for x in sys.version_info[:3]])
print('Version ' + version + ' is not supported. Supported versions are ' +
', '.join(SUPPORTED_VERSIONS))
@@ -127,10 +126,8 @@ class ApiDocsCommand(Command):
forbid_publish()
install_requires = ['requests']
-if PY2_pre_26:
- install_requires.extend(['ssl', 'simplejson'])
-if PY2_pre_279 or PY3_pre_32:
+if PY2_pre_279:
install_requires.append('backports.ssl_match_hostname')
setup(