Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-236-Resumable-workflow-executions 6236a4768 -> 75112ab05 (forced update)
ARIA-282 Make SSH capability opt-in Since the Fabric library uses Paramiko, which is a library using a license which is incompatible with Apache's, ARIA's SSH capabilities are now opt-in and no longer part of the default installation. Instead, users who would like to use SSH operations should install ARIA's extra "[ssh]", which would install Fabric and allow to take advantage of the execution-plugin's SSH capabilities. Users who won't install this extra will still be able to use ARIA as well as the execution plugin, only without SSH. Additional changes: - A new tox environment has been created for running SSH tests. The remaining envs only install plain ARIA. - requirements.in commented lines were removed - the bug that used to exist regarding environment markers has been fixed, and there's no longer the need to copy these manually to requirements.txt. - Environment-marked dependencies are now installed via "install_requires" rather than "extra_requires". - Added requirements.in to the manifest file, as well as fixed a bug in setup.py, which caused source distribution to make aria get installed without any dependencies before this fix. Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/105971f8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/105971f8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/105971f8 Branch: refs/heads/ARIA-236-Resumable-workflow-executions Commit: 105971f8ebc81de5ce5a98ce11a1d8580e671c21 Parents: 1fee85c Author: Ran Ziv <r...@gigaspaces.com> Authored: Wed Jun 21 15:39:34 2017 +0300 Committer: Ran Ziv <r...@gigaspaces.com> Committed: Wed Jun 21 17:37:57 2017 +0300 ---------------------------------------------------------------------- .travis.yml | 2 ++ MANIFEST.in | 1 + Makefile | 5 +-- .../orchestrator/execution_plugin/operations.py | 13 ++++++-- requirements.in | 16 ++-------- requirements.txt | 32 ++++--------------- setup.py | 33 +++++++++----------- tox.ini | 18 ++++++++--- 8 files changed, 53 insertions(+), 67 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index b11ed62..de02d78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,8 @@ env: - TOX_ENV=py26 - TOX_ENV=py27e2e - TOX_ENV=py26e2e +- TOX_ENV=py27ssh +- TOX_ENV=py26ssh install: - pip install --upgrade pip - pip install --upgrade setuptools http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/MANIFEST.in ---------------------------------------------------------------------- diff --git a/MANIFEST.in b/MANIFEST.in index 877a7dd..020b00e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include NOTICE include VERSION include CHANGELOG.rst include README.rst +include requirements.in include requirements.txt recursive-include docs/html * recursive-include examples * http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/Makefile ---------------------------------------------------------------------- diff --git a/Makefile b/Makefile index cb4b58f..f5f2e66 100644 --- a/Makefile +++ b/Makefile @@ -33,10 +33,10 @@ clean: -find . -type d -name '*.egg-info' -exec rm -rf {} \; 2>/dev/null install: - pip install . + pip install .[ssh] install-virtual: - pip install --editable . + pip install --editable .[ssh] # "pip install --editable" will not add our extensions to the path, so we will patch the virtualenv EXTENSIONS_PATH="$$(head -n 1 "$(EASY_INSTALL_PTH)")/extensions" && \ @@ -55,6 +55,7 @@ test: tox -e pylint_tests tox -e py$(PYTHON_VERSION) tox -e py$(PYTHON_VERSION)e2e + tox -e py$(PYTHON_VERSION)ssh dist: docs python ./setup.py sdist bdist_wheel http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/aria/orchestrator/execution_plugin/operations.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/execution_plugin/operations.py b/aria/orchestrator/execution_plugin/operations.py index 5effa8a..0bc8083 100644 --- a/aria/orchestrator/execution_plugin/operations.py +++ b/aria/orchestrator/execution_plugin/operations.py @@ -15,7 +15,6 @@ from aria.orchestrator import operation from . import local as local_operations -from .ssh import operations as ssh_operations @operation @@ -38,7 +37,7 @@ def run_script_with_ssh(ctx, use_sudo=False, hide_output=None, **kwargs): - return ssh_operations.run_script( + return _try_import_ssh().run_script( ctx=ctx, script_path=script_path, fabric_env=fabric_env, @@ -55,9 +54,17 @@ def run_commands_with_ssh(ctx, use_sudo=False, hide_output=None, **_): - return ssh_operations.run_commands( + return _try_import_ssh().run_commands( ctx=ctx, commands=commands, fabric_env=fabric_env, use_sudo=use_sudo, hide_output=hide_output) + + +def _try_import_ssh(): + try: + from .ssh import operations as ssh_operations + return ssh_operations + except Exception: + raise RuntimeError('Failed to import SSH modules; Have you installed the ARIA SSH extra?') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/requirements.in ---------------------------------------------------------------------- diff --git a/requirements.in b/requirements.in index d205c7a..cecc9fd 100644 --- a/requirements.in +++ b/requirements.in @@ -26,7 +26,6 @@ clint>=0.5.0, <0.6 SQLAlchemy>=1.1.0, <1.2 # version 1.2 dropped support of python 2.6 wagon==0.6.0 bottle>=0.12.0, <0.13 -Fabric>=1.13.0, <1.14 setuptools>=35.0.0, <36.0.0 click>=6.0, < 7.0 colorama>=0.3.7, <=0.3.9 @@ -34,15 +33,6 @@ PrettyTable>=0.7,<0.8 click_didyoumean==0.0.3 backports.shutil_get_terminal_size==1.0.0 logutils==0.3.4.1 - -# Since the tool we are using to generate our requirements.txt, `pip-tools`, -# does not currently support conditional dependencies (;), we're adding our original -# conditional dependencies here as comments, and manually adding them to our -# generated requirements.txt file. -# The relevant pip-tools issue: https://github.com/jazzband/pip-tools/issues/435 - -# importlib ; python_version < '2.7' -# ordereddict ; python_version < '2.7' -# total-ordering ; python_version < '2.7' # only one version on pypi -# Fabric makes use of this library, but doesn't bring it :( -# pypiwin32==219 ; sys_platform == 'win32' +importlib ; python_version < '2.7' +ordereddict ; python_version < '2.7' +total-ordering ; python_version < '2.7' # only one version on pypi http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/requirements.txt ---------------------------------------------------------------------- diff --git a/requirements.txt b/requirements.txt index 6cf2ade..9f929a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,39 +2,20 @@ # This file is autogenerated by pip-compile # To update, run: # -# pip-compile --output-file ./requirements.txt ./requirements.in +# pip-compile --output-file requirements.txt requirements.in # -# Since the tool we are using to generate our requirements.txt, `pip-tools`, -# does not currently support conditional dependencies (;), we're adding our original -# conditional dependencies here as comments, and manually adding them to our -# generated requirements.txt file. -# The relevant pip-tools issue: https://github.com/jazzband/pip-tools/issues/435 - -importlib ; python_version < '2.7' -ordereddict ; python_version < '2.7' -total-ordering ; python_version < '2.7' # only one version on pypi -# Fabric makes use of this library, but doesn't bring it :( -pypiwin32==219 ; sys_platform == 'win32' -# ---------------------------------------------------------------------------------- - appdirs==1.4.3 # via setuptools args==0.1.0 # via clint -asn1crypto==0.22.0 # via cryptography backports.shutil_get_terminal_size==1.0.0 blinker==1.4 bottle==0.12.13 cachecontrol[filecache]==0.12.1 -cffi==1.10.0 # via cryptography click==6.7 click_didyoumean==0.0.3 clint==0.5.1 colorama==0.3.9 -cryptography==1.8.1 # via paramiko decorator==4.0.11 # via networkx -enum34==1.1.6 # via cryptography -fabric==1.13.1 -idna==2.5 # via cryptography -ipaddress==1.0.18 # via cryptography +importlib==1.0.4 ; python_version < "2.7" jinja2==2.8.1 jsonpickle==0.9.4 lockfile==0.12.2 # via cachecontrol @@ -42,19 +23,18 @@ logutils==0.3.4.1 markupsafe==1.0 # via jinja2 msgpack-python==0.4.8 # via cachecontrol networkx==1.9.1 -packaging==16.8 # via cryptography, setuptools -paramiko==2.1.2 # via fabric +ordereddict==1.1 ; python_version < "2.7" +packaging==16.8 # via setuptools prettytable==0.7.2 -pyasn1==0.2.3 # via paramiko -pycparser==2.17 # via cffi pyparsing==2.2.0 # via packaging requests==2.13.0 retrying==1.3.3 ruamel.ordereddict==0.4.9 # via ruamel.yaml ruamel.yaml==0.11.15 shortuuid==0.5.0 -six==1.10.0 # via cryptography, packaging, retrying, setuptools +six==1.10.0 # via packaging, retrying, setuptools sqlalchemy==1.1.6 +total-ordering==0.1.0 ; python_version < "2.7" wagon==0.6.0 wheel==0.29.0 # via wagon http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index 8d5f463..d2a914c 100644 --- a/setup.py +++ b/setup.py @@ -43,26 +43,21 @@ with open(os.path.join(root_dir, 'README.rst')) as readme: long_description = readme.read() install_requires = [] -extras_require = {} - -# We need to parse the requirements for the conditional dependencies to work for wheels and -# standard installation -try: - with open(os.path.join(root_dir, 'requirements.in')) as requirements: - for requirement in requirements.readlines(): - install_requires.append(requirement.strip()) - # We are using the install_requires mechanism in order to specify - # conditional dependencies since reading them from a file in their - # standard ';' from does silently nothing. - extras_require = {":python_version<'2.7'": ['importlib', - 'ordereddict', - 'total-ordering', - ], - ":sys_platform=='win32'": 'pypiwin32'} -except IOError: - install_requires = [] - extras_require = {} +# We need to parse the requirements for the conditional dependencies to work for wheels creation +# as well as source dist installation +with open(os.path.join(root_dir, 'requirements.in')) as requirements: + for requirement in requirements.readlines(): + install_requires.append(requirement.strip()) + +ssh_requires = [ + 'Fabric>=1.13.0, <1.14', + "pypiwin32==219 ; sys_platform == 'win32'" +] + +extras_require = { + 'ssh': ssh_requires +} console_scripts = ['aria = aria.cli.main:main'] http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/105971f8/tox.ini ---------------------------------------------------------------------- diff --git a/tox.ini b/tox.ini index 58e62c3..3e1fb3c 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ # limitations under the License. [tox] -envlist=py27,py26,py27e2e,py26e2e,pywin,pylint_code,pylint_tests +envlist=py27,py26,py27e2e,py26e2e,pywin,py27ssh,pylint_code,pylint_tests [testenv] passenv = @@ -27,15 +27,17 @@ basepython = py27: python2.7 py26e2e: python2.6 py27e2e: python2.7 + py26ssh: python2.6 + py27ssh: python2.7 pywin: {env:PYTHON:}\python.exe pylint_code: python2.7 pylint_tests: python2.7 [testenv:py27] -commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov aria +commands=pytest tests --ignore=tests/end2end --ignore=tests/orchestrator/execution_plugin/test_ssh.py --cov-report term-missing --cov aria [testenv:py26] -commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov aria +commands=pytest tests --ignore=tests/end2end --ignore=tests/orchestrator/execution_plugin/test_ssh.py --cov-report term-missing --cov aria [testenv:py27e2e] commands=pytest tests/end2end --cov-report term-missing --cov aria @@ -44,7 +46,15 @@ commands=pytest tests/end2end --cov-report term-missing --cov aria commands=pytest tests/end2end --cov-report term-missing --cov aria [testenv:pywin] -commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov aria +commands=pytest tests --ignore=tests/end2end --ignore=tests/orchestrator/execution_plugin/test_ssh.py --cov-report term-missing --cov aria + +[testenv:py27ssh] +install_command=pip install {opts} {packages} .[ssh] +commands=pytest tests/orchestrator/execution_plugin/test_ssh.py + +[testenv:py26ssh] +install_command=pip install {opts} {packages} .[ssh] +commands=pytest tests/orchestrator/execution_plugin/test_ssh.py [testenv:pylint_code] commands=pylint --rcfile=aria/.pylintrc --disable=fixme,missing-docstring aria extensions/aria_extension_tosca/