You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/11/29 22:01:06 UTC
[libcloud] branch trunk updated (73186bf -> 75f07bd)
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.
from 73186bf Merge pull request #1375 from Kami/promote_start_stop_node_methods
new 5159bab Update setup.py, enum module is required with Python 2.7 and < 3.4.0.
new 4e42ea3 Fix a bug with inadvertent dependency of setup.py on requests.
new 75f07bd Add checks to the ci which verify the library installs correctly without any dependencies pre-installed.
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.travis.yml | 2 ++
libcloud/common/base.py | 4 ++--
libcloud/compute/providers.py | 7 ++++++-
libcloud/pricing.py | 4 ++--
setup.py | 1 +
tox.ini | 13 +++++++++++--
6 files changed, 24 insertions(+), 7 deletions(-)
[libcloud] 02/03: Fix a bug with inadvertent dependency of setup.py
on requests.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 4e42ea3c5a7c4cc83dae53958cdc72f9b5df2750
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Nov 29 22:56:02 2019 +0100
Fix a bug with inadvertent dependency of setup.py on requests.
---
libcloud/common/base.py | 4 ++--
libcloud/compute/providers.py | 7 ++++++-
libcloud/pricing.py | 4 ++--
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 79da320..1f0012e 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -27,8 +27,6 @@ import time
from libcloud.utils.py3 import ET
-import requests
-
import libcloud
from libcloud.utils.py3 import httplib
@@ -196,6 +194,7 @@ class Response(object):
:return: ``True`` or ``False``
"""
# pylint: disable=E1101
+ import requests
return self.status in [requests.codes.ok, requests.codes.created,
httplib.OK, httplib.CREATED, httplib.ACCEPTED]
@@ -274,6 +273,7 @@ class RawResponse(Response):
:return: ``True`` or ``False``
"""
# pylint: disable=E1101
+ import requests
return self.status in [requests.codes.ok, requests.codes.created,
httplib.OK, httplib.CREATED, httplib.ACCEPTED]
diff --git a/libcloud/compute/providers.py b/libcloud/compute/providers.py
index a3993a1..cf64ceb 100644
--- a/libcloud/compute/providers.py
+++ b/libcloud/compute/providers.py
@@ -21,14 +21,19 @@ from __future__ import absolute_import
from typing import Type
from typing import Union
from types import ModuleType
+from typing import TYPE_CHECKING
from libcloud.compute.types import Provider
-from libcloud.compute.base import NodeDriver
from libcloud.common.providers import get_driver as _get_provider_driver
from libcloud.common.providers import set_driver as _set_provider_driver
from libcloud.compute.types import OLD_CONSTANT_TO_NEW_MAPPING
from libcloud.compute.deprecated import DEPRECATED_DRIVERS
+
+if TYPE_CHECKING:
+ # NOTE: This is needed to avoid having setup.py depend on requests
+ from libcloud.compute.base import NodeDriver
+
__all__ = [
"Provider",
"DRIVERS",
diff --git a/libcloud/pricing.py b/libcloud/pricing.py
index 02f159f..a9d4701 100644
--- a/libcloud/pricing.py
+++ b/libcloud/pricing.py
@@ -35,8 +35,6 @@ except ImportError:
import json # type: ignore
JSONDecodeError = ValueError # type: ignore
-from libcloud.utils.connection import get_response_object
-
__all__ = [
'get_pricing',
'get_size_price',
@@ -200,6 +198,8 @@ def download_pricing_file(file_url=DEFAULT_FILE_URL,
:type file_path: ``str``
:param file_path: Path where a download pricing file will be saved.
"""
+ from libcloud.utils.connection import get_response_object
+
dir_name = os.path.dirname(file_path)
if not os.path.exists(dir_name):
[libcloud] 03/03: Add checks to the ci which verify the library
installs correctly without any dependencies pre-installed.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 75f07bd2c75ae6b82ccc07090bdefaa07b9938b8
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Nov 29 22:59:55 2019 +0100
Add checks to the ci which verify the library installs correctly without
any dependencies pre-installed.
---
.travis.yml | 2 ++
tox.ini | 13 +++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 8bf8272..47f1446 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,12 +14,14 @@ matrix:
fast_finish: true
include:
- python: 2.7
+ before_script: TOX_ENV=py2.7,py2.7-dist
- python: 3.4
- python: 3.5
- python: 3.6
- python: 3.7
dist: xenial
sudo: required
+ before_script: TOX_ENV=py3.7,py3.7-dist
- python: 3.8
dist: xenial
sudo: required
diff --git a/tox.ini b/tox.ini
index 353f078..ced788b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,19 +15,28 @@ deps =
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
python setup.py test
basepython =
- {py2.7,checks,lint,pylint,coverage}: python2.7
+ {py2.7,checks,lint,pylint,coverage,py2.7-dist}: python2.7
docs: python3.5
pypypy: pypy
pypypy3: pypy3
py3.4: python3.4
py3.5: python3.5
py3.6: python3.6
- py3.7: python3.7
+ {py3.7,py3.7-dist}: python3.7
py3.8: python3.8
mypy: python3.7
whitelist_externals = cp
bash
scripts/*.sh
+[testenv:py2.7-dist]
+# Verify library installs without any dependencies
+skipdist=False
+commands = python setup.py install
+
+[testenv:py3.7-dist]
+# Verify library installs without any dependencies
+skipdist=False
+commands = python setup.py install
[testenv:docs]
deps = pysphere
[libcloud] 01/03: Update setup.py,
enum module is required with Python 2.7 and < 3.4.0.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 5159babc482eb4cf8c87215d53dfe71f828a3a0c
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Nov 29 22:42:44 2019 +0100
Update setup.py, enum module is required with Python 2.7 and < 3.4.0.
---
setup.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/setup.py b/setup.py
index a141417..0d796e5 100644
--- a/setup.py
+++ b/setup.py
@@ -126,6 +126,7 @@ if PY2_pre_279:
if PY2_or_3_pre_34:
INSTALL_REQUIREMENTS.append('typing')
+ INSTALL_REQUIREMENTS.append('enum34')
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []