[arch-commits] Commit in (5 files)

Felix Yan fyan at archlinux.org
Tue Oct 13 14:43:41 UTC 2015


    Date: Tuesday, October 13, 2015 @ 16:43:41
  Author: fyan
Revision: 143918

addpkg: python-planout 0.5.20151001-1

Added:
  python-planout/
  python-planout/repos/
  python-planout/trunk/
  python-planout/trunk/PKGBUILD
  python-planout/trunk/py3k-fix.patch

----------------+
 PKGBUILD       |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 py3k-fix.patch |   37 +++++++++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+)

Added: python-planout/trunk/PKGBUILD
===================================================================
--- python-planout/trunk/PKGBUILD	                        (rev 0)
+++ python-planout/trunk/PKGBUILD	2015-10-13 14:43:41 UTC (rev 143918)
@@ -0,0 +1,57 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgbase=python-planout
+pkgname=(python-planout python2-planout)
+pkgver=0.5.20151001
+_commit=82ccf7b212bd5a292e1485c0942b513a52737c78
+pkgrel=1
+pkgdesc="A framework for online field experimentation"
+arch=('any')
+url='http://facebook.github.io/planout'
+license=('custom:BSD')
+makedepends=('python-six' 'python2-six' 'git')
+checkdepends=('python-pytest' 'python2-pytest')
+source=("git+https://github.com/facebook/planout.git#commit=$_commit"
+        py3k-fix.patch)
+sha512sums=('SKIP'
+            '1ec44bf082f73045a39076bed7dcf9ce25b79e1f288c5c06136d67894aac262ad309bad4feb0909b5690d3cd67862f3d15c71f51adfcc97a7cc4cc58bc13d78f')
+
+prepare() {
+  (cd planout; patch -p1 -i ../py3k-fix.patch)
+  cp -a planout{,-py2}
+}
+
+build() {
+  cd "$srcdir/planout/python"
+  python setup.py build
+
+  cd "$srcdir/planout-py2/python"
+  python2 setup.py build
+}
+
+check() {
+  cd "$srcdir/planout/python/planout/test"
+  py.test
+
+  cd "$srcdir/planout-py2/python/planout/test"
+  py.test2
+}
+
+package_python-planout() {
+  depends=('python-six')
+
+  cd planout/python
+  python setup.py install -O1 --root "$pkgdir"
+
+  install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_python2-planout() {
+  depends=('python2-six')
+
+  cd planout-py2/python
+  python2 setup.py install -O1 --root "$pkgdir"
+
+  install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}


Property changes on: python-planout/trunk/PKGBUILD
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: python-planout/trunk/py3k-fix.patch
===================================================================
--- python-planout/trunk/py3k-fix.patch	                        (rev 0)
+++ python-planout/trunk/py3k-fix.patch	2015-10-13 14:43:41 UTC (rev 143918)
@@ -0,0 +1,37 @@
+From 7108eaa07bd031630489b41f8e072957fbfed7a8 Mon Sep 17 00:00:00 2001
+From: Felix Yan <felixonmars at archlinux.org>
+Date: Tue, 13 Oct 2015 22:41:23 +0800
+Subject: [PATCH] Fix prints in namespace.py for Python 3.x compatibility
+
+---
+ python/planout/namespace.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/python/planout/namespace.py b/python/planout/namespace.py
+index b5243fc..31ab927 100644
+--- a/python/planout/namespace.py
++++ b/python/planout/namespace.py
+@@ -116,11 +116,11 @@ def primary_unit(self, value):
+     def add_experiment(self, name, exp_object, segments):
+         num_avail = len(self.available_segments)
+         if num_avail < segments:
+-            print 'error: %s segments requested, only %s available.' % \
+-                (segments, num_avail)
++            print('error: %s segments requested, only %s available.' %
++                  (segments, num_avail))
+             return False
+         if name in self.current_experiments:
+-            print 'error: there is already an experiment called %s.' % name
++            print('error: there is already an experiment called %s.' % name)
+             return False
+ 
+         # randomly select the given number of segments from all available
+@@ -140,7 +140,7 @@ def add_experiment(self, name, exp_object, segments):
+ 
+     def remove_experiment(self, name):
+         if name not in self.current_experiments:
+-            print 'error: there is no experiment called %s.' % name
++            print('error: there is no experiment called %s.' % name)
+             return False
+ 
+         segments_to_free = \



More information about the arch-commits mailing list