--- /dev/null
+--- Pygments-2.2.0/pygments/lexers/lisp.py.orig 2017-01-22 22:01:32.000000000 +0100
++++ Pygments-2.2.0/pygments/lexers/lisp.py 2018-07-18 21:48:02.153318157 +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
+--- Pygments-2.2.0/pygments/lexers/sql.py.orig 2017-01-22 22:01:32.000000000 +0100
++++ Pygments-2.2.0/pygments/lexers/sql.py 2018-07-18 21:49:02.033317475 +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
# Conditional build:
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
+%bcond_without doc # Sphinx documentation
+%bcond_without tests # unit tests
%define module pygments
Summary: A generic syntax highlighter as Python 2.x module
Summary(pl.UTF-8): Moduł Pythona 2.x do ogólnego podświetlania składni
Name: python-%{module}
Version: 2.2.0
-Release: 2
+Release: 3
License: BSD
Group: Development/Languages/Python
-#Source0Download: https://pypi.python.org/simple/Pygments
+#Source0Download: https://pypi.org/simple/Pygments/
Source0: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
# Source0-md5: 13037baca42f16917cbd5ad2fab50844
Patch0: rpmspec.patch
+Patch1: %{name}-py3.7.patch
URL: http://pygments.org/
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with python2}
BuildRequires: python3-setuptools
%endif
BuildRequires: rpm-pythonprov
+%{?with_doc:BuildRequires: sphinx-pdg}
Requires: python-modules >= 1:2.6
Requires: python-setuptools
Provides: python-Pygments = %{version}-%{release}
- możliwość używania z linii poleceń oraz jako biblioteki
- ...a także - podświetla nawet Brainf*cka!
+%package apidocs
+Summary: API documentation for Python Pygments module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona Pygments
+Group: Documentation
+
+%description apidocs
+API documentation for Python Pygments module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona Pygments.
+
%prep
%setup -q -n Pygments-%{version}
%patch0 -p1
+%patch1 -p1
%build
%if %{with python2}
%py_build
+
+%if %{with tests}
+%{__python} tests/run.py
+%endif
%endif
%if %{with python3}
%py3_build
+
+%if %{with tests}
+%{__python3} tests/run.py
+%endif
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(pwd) \
+%{__make} -C doc html
%endif
%install
%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc AUTHORS CHANGES LICENSE TODO
+%doc AUTHORS CHANGES LICENSE README.rst TODO
%attr(755,root,root) %{_bindir}/pygmentize
%attr(755,root,root) %{_bindir}/pygmentize-2
%{py_sitescriptdir}/%{module}
%if %{with python3}
%files -n python3-%{module}
%defattr(644,root,root,755)
-%doc AUTHORS CHANGES LICENSE TODO
+%doc AUTHORS CHANGES LICENSE README.rst TODO
%attr(755,root,root) %{_bindir}/pygmentize-3
%{py3_sitescriptdir}/%{module}
%{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/_build/html/{_static,docs,*.html,*.js}
+%endif