[packages/python-commonmark] - updated to 0.8.1 - added deps patch (don't require future on python3, loose hypothesis version)
qboosh
qboosh at pld-linux.org
Sat Oct 6 08:45:02 CEST 2018
commit 5502662fe3db8d55d35df2c7dfe06340709b963c
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Oct 6 08:48:25 2018 +0200
- updated to 0.8.1
- added deps patch (don't require future on python3, loose hypothesis version)
python-commonmark-deps.patch | 23 +++++++++++++++
python-commonmark.spec | 70 +++++++++++++++++++++++++++++++++++---------
2 files changed, 79 insertions(+), 14 deletions(-)
---
diff --git a/python-commonmark.spec b/python-commonmark.spec
index 9b3f78b..c80581a 100644
--- a/python-commonmark.spec
+++ b/python-commonmark.spec
@@ -1,58 +1,91 @@
-# TODO:
-# - package %{_bindir}/cmark
#
# Conditional build:
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
+%bcond_without tests # unit tests
Summary: Python parser for the CommonMark Markdown spec
+Summary(pl.UTF-8): Pythonowy parser specyfikacji CommonMark Markdown
Name: python-commonmark
-Version: 0.7.5
+Version: 0.8.1
Release: 1
License: BSD
Group: Libraries/Python
-Source0: https://pypi.python.org/packages/source/c/commonmark/CommonMark-%{version}.tar.gz
-# Source0-md5: 70cb4ade4b9d0370213be9816f99a21e
+Source0: https://files.pythonhosted.org/packages/source/c/commonmark/commonmark-%{version}.tar.gz
+# Source0-md5: f0925dd4fe99e8e177dfac930ac1972d
+Patch0: %{name}-deps.patch
URL: https://github.com/rtfd/CommonMark-py
%if %{with python2}
BuildRequires: python-modules >= 1:2.7
BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-future
+BuildRequires: python-hypothesis >= 3.55.3
+%endif
%endif
%if %{with python3}
BuildRequires: python3-modules >= 1:3.3
BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-hypothesis >= 3.55.3
+%endif
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
+Requires: python-future
Requires: python-modules >= 1:2.7
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-CommonMark-py is a pure Python port of jgm’s commonmark.js, a Markdown
+CommonMark-py is a pure Python port of jgm's commonmark.js, a Markdown
parser and renderer for the CommonMark specification, using only
native modules.
+%description -l pl.UTF-8
+CommonMark-py to czysto perlowy port kodu jgm commonmark.js - parsera
+i renderera specyfikacji CommonMark, napisany przy wyłącznie przy
+użyciu natywnych modułów.
+
%package -n python3-commonmark
Summary: Python parser for the CommonMark Markdown spec
+Summary(pl.UTF-8): Pythonowy parser specyfikacji CommonMark Markdown
Group: Libraries/Python
Requires: python3-modules >= 1:3.3
%description -n python3-commonmark
-CommonMark-py is a pure Python port of jgm’s commonmark.js, a Markdown
+CommonMark-py is a pure Python port of jgm's commonmark.js, a Markdown
parser and renderer for the CommonMark specification, using only
native modules.
+%description -n python3-commonmark -l pl.UTF-8
+CommonMark-py to czysto perlowy port kodu jgm commonmark.js - parsera
+i renderera specyfikacji CommonMark, napisany przy wyłącznie przy
+użyciu natywnych modułów.
+
%prep
-%setup -q -n CommonMark-%{version}
+%setup -q -n commonmark-%{version}
+%patch0 -p1
%build
%if %{with python2}
%py_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 \
+PYTHONPATH=$(pwd)/build-2/lib \
+%{__python} commonmark/tests/run_spec_tests.py
+%endif
%endif
%if %{with python3}
%py3_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 \
+PYTHONPATH=$(pwd)/build-3/lib \
+%{__python} commonmark/tests/run_spec_tests.py
+%endif
%endif
%install
@@ -62,10 +95,16 @@ rm -rf $RPM_BUILD_ROOT
%py_install
%py_postclean
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/cmark{,-2}
%endif
%if %{with python3}
%py3_install
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/cmark{,-3}
+
+ln -sf cmark-3 $RPM_BUILD_ROOT%{_bindir}/cmark
%endif
%clean
@@ -74,15 +113,18 @@ rm -rf $RPM_BUILD_ROOT
%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc README.rst
-%{py_sitescriptdir}/CommonMark
-%{py_sitescriptdir}/CommonMark-%{version}-py*.egg-info
+%doc LICENSE README.rst
+%attr(755,root,root) %{_bindir}/cmark-2
+%{py_sitescriptdir}/commonmark
+%{py_sitescriptdir}/commonmark-%{version}-py*.egg-info
%endif
%if %{with python3}
%files -n python3-commonmark
%defattr(644,root,root,755)
-%doc README.rst
-%{py3_sitescriptdir}/CommonMark
-%{py3_sitescriptdir}/CommonMark-%{version}-py*.egg-info
+%doc LICENSE README.rst
+%attr(755,root,root) %{_bindir}/cmark
+%attr(755,root,root) %{_bindir}/cmark-3
+%{py3_sitescriptdir}/commonmark
+%{py3_sitescriptdir}/commonmark-%{version}-py*.egg-info
%endif
diff --git a/python-commonmark-deps.patch b/python-commonmark-deps.patch
new file mode 100644
index 0000000..a7a692d
--- /dev/null
+++ b/python-commonmark-deps.patch
@@ -0,0 +1,23 @@
+--- commonmark-0.8.1/setup.py.orig 2018-09-06 19:15:16.000000000 +0200
++++ commonmark-0.8.1/setup.py 2018-10-06 08:34:46.490706284 +0200
+@@ -21,10 +21,8 @@
+
+
+ tests_require = [
+- 'flake8==3.5.0',
+- 'hypothesis==3.55.3',
++ 'hypothesis>=3.55.3',
+ # For python 2.6
+- 'hypothesislegacysupport',
+ ]
+
+
+@@ -55,7 +53,7 @@
+ },
+ cmdclass={'test': Test},
+ install_requires=[
+- 'future',
++ # 'future', # python2 only
+ ],
+ tests_require=tests_require,
+ extras_require={'test': tests_require},
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-commonmark.git/commitdiff/5502662fe3db8d55d35df2c7dfe06340709b963c
More information about the pld-cvs-commit
mailing list