- Update to 2.3.1:

* Update lexers
  * Minimum Python versions changed to 2.7 and 3.5
  *  Added support for Python 3.7 generator changes (PR#772)
  * Fix incorrect token type in SCSS for single-quote strings (#1322)
  * Use `terminal256` formatter if `TERM` contains `256` (PR#666)
  * Fix incorrect handling of GitHub style fences in Markdown (PR#741, #1389)
  * Fix `%a` not being highlighted in Python3 strings (PR#727)
- Drop patch python_37.diff which was merged upstream
- Refresh patch denose.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=50
This commit is contained in:
Tomáš Chvátal 2019-02-11 11:15:42 +00:00 committed by Git OBS Bridge
parent 3318ee464e
commit 2cc7d8a540
6 changed files with 40 additions and 51 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc
size 2113944

3
Pygments-2.3.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a
size 3124216

View File

@ -1,14 +1,17 @@
--- a/tests/run.py
+++ b/tests/run.py
@@ -16,18 +16,13 @@ from __future__ import print_function
Index: Pygments-2.3.1/tests/run.py
===================================================================
--- Pygments-2.3.1.orig/tests/run.py
+++ Pygments-2.3.1/tests/run.py
@@ -17,6 +17,7 @@ from __future__ import print_function
import os
import sys
import warnings
+import unittest
# only find tests in this directory
if os.path.dirname(__file__):
os.chdir(os.path.dirname(__file__))
@@ -30,12 +31,6 @@ warnings.filterwarnings("error", module=
category=DeprecationWarning)
-try:
@ -20,14 +23,16 @@
# make sure the current source is first on sys.path
sys.path.insert(0, '..')
@@ -47,4 +42,4 @@ else:
@@ -55,4 +50,4 @@ else:
print('Pygments test suite running (Python %s)...' % sys.version.split()[0],
file=sys.stderr)
-nose.main()
+unittest.main()
--- a/tests/support.py
+++ b/tests/support.py
Index: Pygments-2.3.1/tests/support.py
===================================================================
--- Pygments-2.3.1.orig/tests/support.py
+++ Pygments-2.3.1/tests/support.py
@@ -5,7 +5,7 @@ Support for Pygments tests
import os
@ -37,8 +42,10 @@
def location(mod_name):
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
Index: Pygments-2.3.1/tests/test_cmdline.py
===================================================================
--- Pygments-2.3.1.orig/tests/test_cmdline.py
+++ Pygments-2.3.1/tests/test_cmdline.py
@@ -143,7 +143,7 @@ class CmdLineTest(unittest.TestCase):
def test_h_opt(self):
@ -202,7 +209,9 @@
# same with -v: should reraise the exception
try:
Index: Pygments-2.3.1/tests/__init__.py
===================================================================
--- /dev/null
+++ b/tests/__init__.py
+++ Pygments-2.3.1/tests/__init__.py
@@ -0,0 +1 @@
+

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon Feb 11 11:10:41 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 2.3.1:
* Update lexers
* Minimum Python versions changed to 2.7 and 3.5
* Added support for Python 3.7 generator changes (PR#772)
* Fix incorrect token type in SCSS for single-quote strings (#1322)
* Use `terminal256` formatter if `TERM` contains `256` (PR#666)
* Fix incorrect handling of GitHub style fences in Markdown (PR#741, #1389)
* Fix `%a` not being highlighted in Python3 strings (PR#727)
- Drop patch python_37.diff which was merged upstream
- Refresh patch denose.patch
-------------------------------------------------------------------
Thu Jan 10 01:20:08 UTC 2019 - Matej Cepl <mcepl@suse.com>

View File

@ -18,19 +18,18 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Pygments
Version: 2.2.0
Version: 2.3.1
Release: 0
Summary: Pygments is a syntax highlighting package written in Python
License: BSD-2-Clause
Group: Development/Languages/Python
URL: http://pygments.org
Source: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
Patch0: python_37.diff
Patch1: denose.patch
BuildRequires: %{python_module setuptools}
# We need pytest just because of its test runner, it seems even
# python3 stdlib unittest runner doesn't work
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-setuptools
@ -59,6 +58,7 @@ source code. Highlights are:
%prep
%setup -q -n Pygments-%{version}
%autopatch -p1
# Remove non-oss licensed files, see bnc# 760344
rm tests/examplefiles/{Sorting,test}.mod

View File

@ -1,34 +0,0 @@
diff -r 7941677dc77d pygments/lexers/lisp.py
--- a/pygments/lexers/lisp.py Mon Mar 13 19:16:03 2017 +0000
+++ b/pygments/lexers/lisp.py Wed Jul 04 18:03:07 2018 +0200
@@ -2327,13 +2327,13 @@
token = Name.Function if token == Literal else token
yield index, token, value
- raise StopIteration
+ return
def _process_signature(self, tokens):
for index, token, value in tokens:
if token == Literal and value == '}':
yield index, Punctuation, value
- raise StopIteration
+ return
elif token in (Literal, Name.Function):
token = Name.Variable if value.istitle() else Keyword.Type
yield index, token, value
diff -r 7941677dc77d pygments/lexers/sql.py
--- a/pygments/lexers/sql.py Mon Mar 13 19:16:03 2017 +0000
+++ b/pygments/lexers/sql.py Wed Jul 04 18:03:07 2018 +0200
@@ -347,7 +347,10 @@
# Emit the output lines
out_token = Generic.Output
while 1:
- line = next(lines)
+ try:
+ line = next(lines)
+ except StopIteration:
+ return
mprompt = re_prompt.match(line)
if mprompt is not None:
# push the line back to have it processed by the prompt