Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 336B8200CBD for ; Thu, 6 Jul 2017 18:02:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 31DC2166C5B; Thu, 6 Jul 2017 16:02:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 77C64166C57 for ; Thu, 6 Jul 2017 18:02:02 +0200 (CEST) Received: (qmail 6588 invoked by uid 500); 6 Jul 2017 16:02:01 -0000 Mailing-List: contact commits-help@ariatosca.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ariatosca.incubator.apache.org Delivered-To: mailing list commits@ariatosca.incubator.apache.org Received: (qmail 6575 invoked by uid 99); 6 Jul 2017 16:02:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jul 2017 16:02:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2A436C03A3 for ; Thu, 6 Jul 2017 16:02:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 1nEIT2z405tQ for ; Thu, 6 Jul 2017 16:01:59 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id C54825F6C6 for ; Thu, 6 Jul 2017 16:01:58 +0000 (UTC) Received: (qmail 6544 invoked by uid 99); 6 Jul 2017 16:01:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jul 2017 16:01:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4EEA6E10F3; Thu, 6 Jul 2017 16:01:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ran@apache.org To: commits@ariatosca.incubator.apache.org Message-Id: <611476ae17d8453ea6950cdb762592c6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-ariatosca git commit: ARIA-301 Fix issue when installing from wheel Date: Thu, 6 Jul 2017 16:01:56 +0000 (UTC) archived-at: Thu, 06 Jul 2017 16:02:03 -0000 Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-301-environment-marked-dependencies-installation-from-wheel [created] 3e0748749 ARIA-301 Fix issue when installing from wheel Fixed an issue when installing ARIA from wheel where environment-marked dependencies would install regardless of the environment ARIA is installed 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/3e074874 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/3e074874 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/3e074874 Branch: refs/heads/ARIA-301-environment-marked-dependencies-installation-from-wheel Commit: 3e07487498681b2346e5728ffb361afbaa74559a Parents: 2195e1f Author: Ran Ziv Authored: Thu Jul 6 18:59:42 2017 +0300 Committer: Ran Ziv Committed: Thu Jul 6 18:59:42 2017 +0300 ---------------------------------------------------------------------- setup.py | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3e074874/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index 340cce2..ac0af8b 100644 --- a/setup.py +++ b/setup.py @@ -45,14 +45,9 @@ with open(os.path.join(root_dir, 'README.rst')) as readme: install_requires = [] -# 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', + # Fabric depends on the pypiwin32 on Windows, but doesn't install it "pypiwin32==219 ; sys_platform == 'win32'" ] @@ -60,6 +55,26 @@ extras_require = { 'ssh': ssh_requires } +with open(os.path.join(root_dir, 'requirements.in')) as requirements: + for requirement in requirements.readlines(): + requirement = requirement.strip() + if not requirement or requirement.startswith('#'): + continue # skip empty and comment lines + + # dependencies which use environment markers have to go in as conditional dependencies + # under "extra_require" rather than "install_requires", or otherwise the environment + # markers get ignored when installing from wheel. See more here: + # https://wheel.readthedocs.io/en/latest/index.html#defining-conditional-dependencies + # https://hynek.me/articles/conditional-python-dependencies/ + 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()) + + console_scripts = ['aria = aria.cli.main:main']