From patchwork Sat Jul 18 09:49:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 497352 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 39078140D16 for ; Sat, 18 Jul 2015 19:50:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ZmRsGT29; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC34E4B667; Sat, 18 Jul 2015 11:50:26 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g6ZuTIcwKm3O; Sat, 18 Jul 2015 11:50:26 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 16A7C4B65D; Sat, 18 Jul 2015 11:50:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 98E1E4B65D for ; Sat, 18 Jul 2015 11:50:22 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rBuLY_5uWzsC for ; Sat, 18 Jul 2015 11:50:22 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by theia.denx.de (Postfix) with ESMTPS id 118E74B65B for ; Sat, 18 Jul 2015 11:50:18 +0200 (CEST) Received: by pdjr16 with SMTP id r16so75555401pdj.3 for ; Sat, 18 Jul 2015 02:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QQxyZ+6Cp7chA5vQAvE/tr/25gxNnDOieqaYJbbBnaM=; b=ZmRsGT29EYHjgCVEtFjNtYLMubuf+AyGn+izh4et0hiR8//wShi0ww5U/tY2hHtVkD UKaWPaBlGSK5gGrqLXfuvk5/ZPxVWOD2Dyx/eLjRPdBBjWdgVsabaOSVxw1l0vFMCdJh /Pv3HHIYeT/stjll+rm/z1Jlv9PveXB7lWt3gP1JN64mELa9LfN8GoAJ3tSESfVCWiXp ZYosVKU1J4tE13sfkP3QlkRVnYwCzxk/IbC2Hvrsqa9XW++0k67g/cdf2f1iIEjlR6+Z TNluScEJ6tP50RDD+O5z17JZcvYBwa5tlK5iifYKPZI/6NFDR85ORVGJJMgUJlKxW0RF ykFg== X-Received: by 10.66.116.81 with SMTP id ju17mr37923271pab.35.1437213017168; Sat, 18 Jul 2015 02:50:17 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc (2-163-36-202-static.alliedtelesis.co.nz. [202.36.163.2]) by smtp.gmail.com with ESMTPSA id kh6sm13811455pbc.50.2015.07.18.02.50.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Jul 2015 02:50:16 -0700 (PDT) From: Chris Packham To: Simon Glass Date: Sat, 18 Jul 2015 21:49:57 +1200 Message-Id: <1437212997-14469-1-git-send-email-judge.packham@gmail.com> X-Mailer: git-send-email 2.5.0.rc0 In-Reply-To: References: Cc: u-boot@lists.denx.de, Chris Packham , Otavio Salvador , Tom Rini Subject: [U-Boot] [RFC PATCH v2] patman: add distutils based installer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" To make it easier to use patman on other projects add a distutils style installer. Now patman can be installed with cd u-boot/tools/patman && python setup.py install There are also the usual distutils options for creating source/binary distributions of patman. Signed-off-by: Chris Packham Tested-by: Simon Glass --- This gives us something that can be distributed separately as well as in-tree. The import trick allows the python module "patman" to be distributed and enables in-tree use without moving things around. An alternative would be to move the files into a sub directory (unfortunately a directory called "patman" would clash with the existing symlink). I've left this as RFC so that the community can decide if we want to live with this ugliness or come up with something else. Thanks, Chris Changes in v2: - Install as "patman" package - Allow running in-tree or out-of-tree tools/patman/__init__.py | 3 +++ tools/patman/patman.py | 20 ++++++++++++-------- tools/patman/setup.py | 13 +++++++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 tools/patman/__init__.py create mode 100644 tools/patman/setup.py diff --git a/tools/patman/__init__.py b/tools/patman/__init__.py new file mode 100644 index 0000000..7cbe5fa --- /dev/null +++ b/tools/patman/__init__.py @@ -0,0 +1,3 @@ +__all__ = ['checkpatch', 'command', 'commit', 'cros_subprocess', + 'get_maintainer', 'gitutil', 'patchstream', 'project', + 'series', 'settings', 'terminal', 'test'] diff --git a/tools/patman/patman.py b/tools/patman/patman.py index 6c6473e..e76fc42 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -14,14 +14,18 @@ import sys import unittest # Our modules -import checkpatch -import command -import gitutil -import patchstream -import project -import settings -import terminal -import test +try: + from patman import checkpatch, command, gitutil, patchstream, \ + project, settings, terminal, test +except ImportError: + import checkpatch + import command + import gitutil + import patchstream + import project + import settings + import terminal + import test parser = OptionParser() diff --git a/tools/patman/setup.py b/tools/patman/setup.py new file mode 100644 index 0000000..e61804f --- /dev/null +++ b/tools/patman/setup.py @@ -0,0 +1,13 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# +from distutils.core import setup +setup(name='patman', + version='1.0', + license='GPL-2.0+', + scripts=['patman'], + packages=['patman'], + package_dir={'patman': ''}, + package_data={'patman': ['README']}, + classifiers=['Environment :: Console', + 'Topic :: Software Development'])