Make aria dependency optional
Since cloudify has announced the retirement of aria, we need to add
opnfv-toscaparser as our default backend. However, since they have
conflicting dependencies, we need to make aria dependency optional.
Change-Id: I22bb5f7411162828226d4290fd00dfd91d49efa3
Issue-ID: VNFSDK-292
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
diff --git a/requirements.txt b/requirements.txt
index f27a466..45562d5 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,6 @@
-ruamel.yaml<0.12.0,>=0.11.12
-requests<2.14.0,>=2.3.0
-apache-ariatosca==0.1.1
+ruamel.yaml<0.16
+requests>=2.3.0
+#apache-ariatosca==0.1.1
stevedore >= 1.9.0
udatetime<1.0,>=0.0.16
+nfv-toscaparser<2.0,>=1.0.1
diff --git a/setup.py b/setup.py
index c6ba237..7615d29 100644
--- a/setup.py
+++ b/setup.py
@@ -47,6 +47,8 @@
else:
install_requires.append(requirement)
+extras_require['aria'] = 'apache-ariatosca==0.1.1'
+
version = { }
with open(os.path.join(root_dir, 'vnfsdk_pkgtools/version.py')) as fp:
exec(fp.read(), version)
@@ -83,7 +85,7 @@
'console_scripts': [
'vnfsdk = vnfsdk_pkgtools.cli.__main__:main'],
'vnfsdk.pkgtools.validator': [
- 'aria = vnfsdk_pkgtools.validator.aria_validator:AriaValidator'
+ 'aria = vnfsdk_pkgtools.validator.aria_validator:AriaValidator [aria]'
]
},
diff --git a/tox.ini b/tox.ini
index 17f33c7..efdc361 100644
--- a/tox.ini
+++ b/tox.ini
@@ -33,7 +33,8 @@
[testenv:py27]
commands =
- coverage run --module pytest --junitxml xunit-results.xml
+ pip install 'apache-ariatosca==0.1.1'
+ coverage run --module pytest --junitxml xunit-results.xml tests/
coverage xml --omit=".tox/py27/*","tests/*"
coverage report --omit=".tox/py27/*","tests/*"
#pytest tests --cov-report term-missing --cov vnfsdk_pkgtools
diff --git a/vnfsdk_pkgtools/cli/__main__.py b/vnfsdk_pkgtools/cli/__main__.py
index 88776de..7cb4e54 100644
--- a/vnfsdk_pkgtools/cli/__main__.py
+++ b/vnfsdk_pkgtools/cli/__main__.py
@@ -18,7 +18,6 @@
import sys
import logging
import argparse
-from aria import install_aria_extensions
import os
import shutil
import tempfile
@@ -53,8 +52,6 @@
"""
CLI entry point
"""
- install_aria_extensions()
-
parser = argparse.ArgumentParser(description='VNF SDK CSAR manipulation tool')
subparsers = parser.add_subparsers(help='csar-create')
diff --git a/vnfsdk_pkgtools/validator/aria_validator.py b/vnfsdk_pkgtools/validator/aria_validator.py
index b4b947c..e84d017 100644
--- a/vnfsdk_pkgtools/validator/aria_validator.py
+++ b/vnfsdk_pkgtools/validator/aria_validator.py
@@ -15,6 +15,7 @@
import os
+from aria import install_aria_extensions
from aria.parser.loading import UriLocation
from aria.parser.consumption import (
ConsumptionContext,
@@ -29,6 +30,10 @@
class AriaValidator(validator.ValidatorBase):
+ def __init__(self):
+ super(AriaValidator, self).__init__()
+ install_aria_extensions()
+
def validate(self, reader):
context = ConsumptionContext()
service_template_path = os.path.join(reader.destination,