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 B57BA200C4D for ; Wed, 5 Apr 2017 17:58:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B23F0160BA6; Wed, 5 Apr 2017 15:58:26 +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 01C41160B91 for ; Wed, 5 Apr 2017 17:58:25 +0200 (CEST) Received: (qmail 80223 invoked by uid 500); 5 Apr 2017 15:58:25 -0000 Mailing-List: contact dev-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 dev@ariatosca.incubator.apache.org Received: (qmail 80203 invoked by uid 99); 5 Apr 2017 15:58:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2017 15:58:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B30731803A6 for ; Wed, 5 Apr 2017 15:58:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.221 X-Spam-Level: X-Spam-Status: No, score=-4.221 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, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id foAnSJdl-oC3 for ; Wed, 5 Apr 2017 15:58:23 +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 D23325F4AC for ; Wed, 5 Apr 2017 15:58:22 +0000 (UTC) Received: (qmail 80182 invoked by uid 99); 5 Apr 2017 15:58:22 -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; Wed, 05 Apr 2017 15:58:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DE948E00AF; Wed, 5 Apr 2017 15:58:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: emblemparade@apache.org To: dev@ariatosca.incubator.apache.org Date: Wed, 05 Apr 2017 15:58:23 -0000 Message-Id: <2f94bbe4ff2449ebad33597fff181caf@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/6] incubator-ariatosca git commit: ARIA-136-ctx-binary-doesnt-get-installed-via-pip-install archived-at: Wed, 05 Apr 2017 15:58:26 -0000 ARIA-136-ctx-binary-doesnt-get-installed-via-pip-install Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/369323b6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/369323b6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/369323b6 Branch: refs/heads/ARIA-134-populate-workflows Commit: 369323b66cdd02ccfba6cc3e3c547ac4694fc2fd Parents: 2d83475 Author: max-orlov Authored: Sun Apr 2 19:24:20 2017 +0300 Committer: max-orlov Committed: Tue Apr 4 11:48:08 2017 +0300 ---------------------------------------------------------------------- setup.py | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/369323b6/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index 7be5275..3d72ebc 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ import sys from setuptools import setup, find_packages from setuptools.command.install import install +from setuptools.command.develop import develop _PACKAGE_NAME = 'aria' _PYTHON_SUPPORTED_VERSIONS = [(2, 6), (2, 7)] @@ -63,20 +64,43 @@ except IOError: console_scripts = ['aria = aria.cli.cli:main'] -class InstallCommand(install): - user_options = install.user_options + [ +def _generate_user_options(command): + return command.user_options + [ ('skip-ctx', None, 'Install with or without the ctx (Defaults to False)') ] - boolean_options = install.boolean_options + ['skip-ctx'] - def initialize_options(self): - install.initialize_options(self) - self.skip_ctx = False - def run(self): - if self.skip_ctx is False: - console_scripts.append('ctx = aria.orchestrator.execution_plugin.ctx_proxy.client:main') - install.run(self) +def _generate_boolean_options(command): + return command.boolean_options + ['skip-ctx'] + + +def _initialize_options(custom_cmd): + custom_cmd.command.initialize_options(custom_cmd) + custom_cmd.skip_ctx = False + + +def _run(custom_cmd): + if custom_cmd.skip_ctx is False: + console_scripts.append('ctx = aria.orchestrator.execution_plugin.ctx_proxy.client:main') + custom_cmd.command.run(custom_cmd) + + +class InstallCommand(install): + command = install + + user_options = _generate_user_options(install) + boolean_options = _generate_boolean_options(install) + initialize_options = _initialize_options + run = _run + + +class DevelopCommand(develop): + command = develop + + user_options = _generate_user_options(develop) + boolean_options = _generate_boolean_options(develop) + initialize_options = _initialize_options + run = _run setup( name=_PACKAGE_NAME, @@ -116,6 +140,7 @@ setup( 'console_scripts': console_scripts }, cmdclass={ - 'install': InstallCommand + 'install': InstallCommand, # used in pip install ... + 'develop': DevelopCommand # used in pip install -e ... } )