[arch-commits] Commit in python-pygments/trunk (2 files)

Evangelos Foutras foutrelis at archlinux.org
Mon Nov 10 08:37:26 UTC 2014


    Date: Monday, November 10, 2014 @ 09:37:25
  Author: foutrelis
Revision: 122285

upgpkg: python-pygments 2.0-1

New upstream release.

Modified:
  python-pygments/trunk/PKGBUILD
Deleted:
  python-pygments/trunk/make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch

--------------------------------------------------------------------+
 PKGBUILD                                                           |   32 +---------
 make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch |   29 ---------
 2 files changed, 6 insertions(+), 55 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-11-09 15:24:59 UTC (rev 122284)
+++ PKGBUILD	2014-11-10 08:37:25 UTC (rev 122285)
@@ -3,8 +3,8 @@
 # Contributor: Timm Preetz <timm at preetz.us>
 
 pkgname=('python-pygments' 'python2-pygments')
-pkgver=1.6
-pkgrel=4
+pkgver=2.0
+pkgrel=1
 pkgdesc="Python syntax highlighter"
 arch=('any')
 url="http://pygments.org/"
@@ -11,34 +11,14 @@
 license=('BSD')
 makedepends=('python-setuptools' 'python2-setuptools')
 options=('!emptydirs')
-source=(https://pypi.python.org/packages/source/P/Pygments/Pygments-$pkgver.tar.gz
-        make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch)
-sha256sums=('799ed4caf77516e54440806d8d9cd82a7607dfdf4e4fb643815171a4b5c921c0'
-            '15cf8323ce343d32cbf78d35ab20001ce3204abe90b68a80607c7aea41499f07')
+source=(https://pypi.python.org/packages/source/P/Pygments/Pygments-$pkgver.tar.gz)
+sha256sums=('4de23e88eeb7570e0425270d1013deff6343d78776dd38aeaf26c98ec3552421')
 
-prepare() {
-  cd "$srcdir/Pygments-$pkgver"
-
-  patch -Np1 -i "$srcdir/make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch"
-}
-
-build() {
-  cd "$srcdir"
-
-  rm -rf python{2,3}-build
-  for builddir in python{2,3}-build; do
-    cp -r Pygments-$pkgver $builddir
-    pushd $builddir
-    ${builddir%-build} setup.py build
-    popd
-  done
-}
-
 package_python-pygments() {
   depends=('python-setuptools')
   install=python-pygments.install
 
-  cd "$srcdir/python3-build"
+  cd "$srcdir/Pygments-$pkgver"
 
   python3 setup.py install --root="$pkgdir" -O1
 
@@ -51,7 +31,7 @@
 package_python2-pygments() {
   depends=('python2-setuptools')
 
-  cd "$srcdir/python2-build"
+  cd "$srcdir/Pygments-$pkgver"
 
   python2 setup.py install --root="$pkgdir" -O1
 

Deleted: make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch
===================================================================
--- make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch	2014-11-09 15:24:59 UTC (rev 122284)
+++ make-pygments.lexers.guess_lexer_for_filename-py3-compatible.patch	2014-11-10 08:37:25 UTC (rev 122285)
@@ -1,29 +0,0 @@
-# HG changeset patch
-# User goodwillcoding <goodwillcoding at webhippo.net>
-# Date 1376769053 25200
-# Node ID c31841d2fd2171419134f30e815dcafb1e8c7eee
-# Parent  7304e4759ae65343d89a51359ca538912519cc31
-Make pygments.lexers.guess_lexer_for_filename py3 compatible.
-Background:
-In py3 one can longer sort classes by class names
-the fix addes a custome sorting function that works
-the same in py2 and py3
-
-diff --git a/pygments/lexers/__init__.py b/pygments/lexers/__init__.py
---- a/pygments/lexers/__init__.py
-+++ b/pygments/lexers/__init__.py
-@@ -188,7 +188,13 @@
-         if rv == 1.0:
-             return lexer(**options)
-         result.append((rv, lexer))
--    result.sort()
-+
-+    # since py3 can no longer sort by class name by default, here is the
-+    # sorting function that works in both
-+    def type_sort(type_):
-+        return (type_[0], type_[1].__name__)
-+    result.sort(key=type_sort)
-+
-     if not result[-1][0] and primary is not None:
-         return primary(**options)
-     return result[-1][1](**options)


More information about the arch-commits mailing list