You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by av...@apache.org on 2017/03/15 11:49:23 UTC

incubator-ariatosca git commit: Explicitly state conditional dependencies in `extras_require`

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-96-less-strict-dependencies 49ee75f53 -> 453902370


Explicitly state conditional dependencies in `extras_require`


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/45390237
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/45390237
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/45390237

Branch: refs/heads/ARIA-96-less-strict-dependencies
Commit: 45390237016c394ddc2ce9af2005dce3eb148068
Parents: 49ee75f
Author: Avia Efrat <av...@gigaspaces.com>
Authored: Wed Mar 15 13:48:26 2017 +0200
Committer: Avia Efrat <av...@gigaspaces.com>
Committed: Wed Mar 15 13:48:26 2017 +0200

----------------------------------------------------------------------
 setup.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45390237/setup.py
----------------------------------------------------------------------
diff --git a/setup.py b/setup.py
index 7a1a3f4..a9045e6 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',
+                                                    'ordered_dict',
+                                                     'total_ordering',
+                                                     ],
+                          ":sys_platform=='win32'": 'pypiwin32'}
 except IOError:
     install_requires = []
     extras_require = {}