Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-96-less-strict-dependencies e9eed80c3 -> d7f32e1d6 (forced update)
Improve our requirements handling 1. Currently, don't vendor any library. 2. Use pip-tools (specifically, pip-compile) to manage our dependencies requirement files. 3. requirements.in: The requirements.in will be read into `install_requires`, and includes loose dependencies (as possible, and only direct dependencies), as is common when installing using a setup.py file. Since we haven't tested ARIA with many versions of our dependencies, our dependencies are not very loose, but we are hoping to improve this as our project matures. Currently, when we provide an upper bound, it is either because of python 2.6 compatibility, or according to a semantic versioning (i.e. future versions that could break the current API). Lower boundaries are usually the lowest version that we tested with ARIA, or because version before are lacking functionality we are using. 4. requirements.txt: The requirements.txt is generated from requirements.in via pip-compile, and includes fixed-version dependencies, including all transitive dependencies, in order to provide an stable environment that ARIA is ensured to work on. Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/d7f32e1d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/d7f32e1d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/d7f32e1d Branch: refs/heads/ARIA-96-less-strict-dependencies Commit: d7f32e1d64706fe074712d1bed0b38617d889d1e Parents: 95177d0 Author: Avia Efrat <[email protected]> Authored: Thu Mar 9 12:02:06 2017 +0200 Committer: Avia Efrat <[email protected]> Committed: Mon Mar 20 12:30:57 2017 +0200 ---------------------------------------------------------------------- aria/orchestrator/plugin.py | 2 +- .../use-cases/non-normative-types.yaml | 2 +- requirements.in | 39 +++++++++++ requirements.txt | 70 +++++++++++++------- setup.py | 19 +++--- 5 files changed, 97 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d7f32e1d/aria/orchestrator/plugin.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/plugin.py b/aria/orchestrator/plugin.py index 381504e..d815754 100644 --- a/aria/orchestrator/plugin.py +++ b/aria/orchestrator/plugin.py @@ -92,7 +92,7 @@ class PluginManager(object): install_args='--prefix="{prefix}" --constraint="{constraint}"'.format( prefix=prefix, constraint=constraint.name), - virtualenv=os.environ.get('VIRTUAL_ENV')) + venv=os.environ.get('VIRTUAL_ENV')) finally: os.remove(constraint_path) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d7f32e1d/examples/tosca-simple-1.0/use-cases/non-normative-types.yaml ---------------------------------------------------------------------- diff --git a/examples/tosca-simple-1.0/use-cases/non-normative-types.yaml b/examples/tosca-simple-1.0/use-cases/non-normative-types.yaml index fa826f5..24f22a3 100644 --- a/examples/tosca-simple-1.0/use-cases/non-normative-types.yaml +++ b/examples/tosca-simple-1.0/use-cases/non-normative-types.yaml @@ -155,7 +155,7 @@ node_types: properties: # Property to supply the desired implementation in the Github repository github_url: - required: no + required: false type: string description: location of the application on the github. default: https://github.com/mmm/testnode.git http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d7f32e1d/requirements.in ---------------------------------------------------------------------- diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..9584a36 --- /dev/null +++ b/requirements.in @@ -0,0 +1,39 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PyYAML>=3.10 +requests>=2.7.0, <3 +networkx<=1.9 # version 1.10 dropped support of python 2.6 +retrying>=1.3.2, <1.3.4 # 1.3.3 version came out in Dec 2014. Not so much activity since then. +blinker>=1.4 +jsonpickle +ruamel.yaml<=0.11.15 # version 0.12.0 dropped support of python 2.6 +Jinja2>=2.8, <2.9 +shortuuid<0.6 +CacheControl[filecache]>=0.11.6, <0.13 +clint>=0.5.0, <0.6 +SQLAlchemy>=1.1.4, <1.2 # version 1.2 dropped support of python 2.6 +wagon==0.6.0 +bottle>=0.12.11, <0.13 +Fabric>=1.13.1, <2.O + +# 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' http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d7f32e1d/requirements.txt ---------------------------------------------------------------------- diff --git a/requirements.txt b/requirements.txt index d6331a5..1bb1860 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,33 +1,55 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# This file is autogenerated by pip-compile +# To update, run: # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -PyYAML>=3.10,<=3.12 -requests>=2.7.0,<=2.10.0 +# pip-compile --output-file requirements.txt requirements.in +# +appdirs==1.4.3 # via setuptools +args==0.1.0 # via clint +asn1crypto==0.21.1 # via cryptography +blinker==1.4 +bottle==0.12.13 +CacheControl[filecache]==0.12.1 +cffi==1.9.1 # via cryptography +clint==0.5.1 +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 +Jinja2==2.8.1 +jsonpickle==0.9.4 +lockfile==0.12.2 # via cachecontrol +MarkupSafe==1.0 # via jinja2 +msgpack-python==0.4.8 # via cachecontrol networkx==1.9 +packaging==16.8 # via cryptography, setuptools +paramiko==2.1.2 # via fabric +pyasn1==0.2.3 # via paramiko +pycparser==2.17 # via cffi +pyparsing==2.2.0 # via packaging +PyYAML==3.12 +requests==2.13.0 retrying==1.3.3 -blinker==1.4 +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 +SQLAlchemy==1.1.6 +wagon==0.6.0 +wheel==0.29.0 # via wagon + +# The following packages are considered to be unsafe in a requirements file: +# setuptools # via cryptography + +# 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 manually. +# The relevant pip-tools issue: https://github.com/jazzband/pip-tools/issues/435 + importlib==1.0.4 ; python_version < '2.7' ordereddict==1.1 ; python_version < '2.7' total-ordering==0.1.0 ; python_version < '2.7' -jsonpickle -ruamel.yaml==0.11.15 -Jinja2==2.8 -shortuuid==0.4.3 -CacheControl[filecache]==0.11.6 -clint==0.5.1 -SQLAlchemy==1.1.4 -wagon==0.5.0 -bottle==0.12.11 -six==1.10.0 -Fabric==1.13.1 # Fabric makes use of this library, but doesn't bring it :( pypiwin32==219 ; sys_platform == 'win32' http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d7f32e1d/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index 7a1a3f4..ff1f5a6 100644 --- a/setup.py +++ b/setup.py @@ -44,16 +44,17 @@ 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.txt')) as requirements: + with open(os.path.join(root_dir, 'requirements.in')) as requirements: for requirement in requirements.readlines(): - if not requirement.strip().startswith('#'): - if ';' in requirement: - package, condition = requirement.split(';') - cond_name = ':{0}'.format(condition.strip()) - extras_require.setdefault(cond_name, []) - extras_require[cond_name].append(package.strip()) - else: - install_requires.append(requirement.strip()) + 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 = {}
