[packages/python-markdown] - updated to 3.1.1 - removed obsolete yaml patch - moved default binary to python3
qboosh
qboosh at pld-linux.org
Tue Dec 31 23:55:53 CET 2019
commit c10584292649218c12f3288e5b5b2388d55bfe38
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Dec 31 23:56:48 2019 +0100
- updated to 3.1.1
- removed obsolete yaml patch
- moved default binary to python3
python-markdown-yaml.patch | 68 ----------------------------------------------
python-markdown.spec | 47 ++++++++++++++++++--------------
2 files changed, 27 insertions(+), 88 deletions(-)
---
diff --git a/python-markdown.spec b/python-markdown.spec
index 93f065a..8317507 100644
--- a/python-markdown.spec
+++ b/python-markdown.spec
@@ -1,5 +1,6 @@
#
# Conditional build:
+%bcond_with doc # documentation
%bcond_without tests # unit tests
%bcond_without python2 # python2 package
%bcond_without python3 # python3 package
@@ -8,26 +9,27 @@
Summary: Markdown implementation in Python 2
Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 2
Name: python-%{module}
-Version: 2.6.11
-Release: 2
+Version: 3.1.1
+Release: 1
License: BSD
Group: Development/Languages/Python
#Source0Download: https://pypi.org/simple/markdown/
Source0: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
-# Source0-md5: a67c1b2914f7d74eeede2ebe0fdae470
-Patch0: %{name}-yaml.patch
+# Source0-md5: d84732ecc65b3a1bff693d9d4c24277f
URL: https://pypi.org/project/markdown/
-BuildRequires: python-devel
+%if %{with python2}
+BuildRequires: python-devel >= 1:2.7
BuildRequires: python-elementtree
+BuildRequires: python-setuptools >= 36
%if %{with tests}
BuildRequires: python-PyYAML
-BuildRequires: python-nose
+%endif
%endif
%if %{with python3}
-BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-devel >= 1:3.5
+BuildRequires: python3-setuptools >= 36
%if %{with tests}
BuildRequires: python3-PyYAML
-BuildRequires: python3-nose
%endif
%endif
BuildRequires: rpm-pythonprov
@@ -65,14 +67,13 @@ choć jest kilka znanych problemów.
%prep
%setup -q -n Markdown-%{version}
-%patch0 -p1
%build
%if %{with python2}
%py_build
%if %{with tests}
-%{__python} ./run-tests.py
+%{__python} -m unittest discover tests
%endif
%endif
@@ -80,26 +81,32 @@ choć jest kilka znanych problemów.
%py3_build
%if %{with tests}
-%{__python3} ./run-tests.py
+%{__python3} -m unittest discover tests
%endif
%endif
+%if %{with doc}
+mkdocs
+mkdocs_nature
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
-%if %{with python3}
-%py3_install
-# rename binary
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
-%endif
-
%if %{with python2}
%py_install
+
%py_postclean
# rename binary
%{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
-# 2.X binary is called by default for now
-ln -s markdown_py-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
+%endif
+
+%if %{with python3}
+%py3_install
+# rename binary
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
+# default binary
+ln -s markdown_py-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
%endif
%clean
@@ -109,7 +116,6 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
-%attr(755,root,root) %{_bindir}/markdown_py
%attr(755,root,root) %{_bindir}/markdown_py-%{py_ver}
%{py_sitescriptdir}/markdown
%{py_sitescriptdir}/Markdown-%{version}-py*.egg-info
@@ -119,6 +125,7 @@ rm -rf $RPM_BUILD_ROOT
%files -n python3-markdown
%defattr(644,root,root,755)
%doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
+%attr(755,root,root) %{_bindir}/markdown_py
%attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver}
%{py3_sitescriptdir}/markdown
%{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info
diff --git a/python-markdown-yaml.patch b/python-markdown-yaml.patch
deleted file mode 100644
index 90edd4d..0000000
--- a/python-markdown-yaml.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-diff --git a/markdown/__main__.py b/markdown/__main__.py
-index 38d08fe0..43e486c9 100644
---- a/markdown/__main__.py
-+++ b/markdown/__main__.py
-@@ -26,9 +26,17 @@
- import warnings
- import markdown
- try:
-- import yaml
-+ # We use `unsafe_load` because users may need to pass in actual Python
-+ # objects. As this is only available from the CLI, the user has much
-+ # worse problems if an attacker can use this as an attach vector.
-+ from yaml import unsafe_load as yaml_load
- except ImportError: # pragma: no cover
-- import json as yaml
-+ try:
-+ # Fall back to PyYAML <5.1
-+ from yaml import load as yaml_load
-+ except ImportError:
-+ # Fall back to JSON
-+ from json import load as yaml_load
-
- import logging
- from logging import DEBUG, WARNING, CRITICAL
-@@ -97,7 +105,7 @@ def parse_options(args=None, values=None):
- options.configfile, mode="r", encoding=options.encoding
- ) as fp:
- try:
-- extension_configs = yaml.load(fp)
-+ extension_configs = yaml_load(fp)
- except Exception as e:
- message = "Failed parsing extension config file: %s" % \
- options.configfile
---- a/tests/__init__.py.orig 2018-01-05 01:41:13.000000000 +0100
-+++ b/tests/__init__.py 2019-03-22 22:41:00.850729644 +0100
-@@ -17,13 +17,16 @@
- except ImportError:
- tidylib = None
- try:
-- import yaml
--except ImportError as e:
-- msg = e.args[0]
-- msg = msg + ". A YAML library is required to run the Python-Markdown " \
-- "tests. Run `pip install pyyaml` to install the latest version."
-- e.args = (msg,) + e.args[1:]
-- raise
-+ from yaml import unsafe_load as yaml_load
-+except ImportError: # PyYAML < 5.1
-+ try:
-+ from yaml import load as yaml_load
-+ except ImportError as e:
-+ msg = e.args[0]
-+ msg = msg + ". A YAML library is required to run the Python-Markdown " \
-+ "tests. Run `pip install pyyaml` to install the latest version."
-+ e.args = (msg,) + e.args[1:]
-+ raise
-
- test_dir = os.path.abspath(os.path.dirname(__file__))
-
-@@ -36,7 +39,7 @@
- self._config = {}
- if os.path.exists(filename):
- with codecs.open(filename, encoding="utf-8") as f:
-- self._config = yaml.load(f)
-+ self._config = yaml_load(f)
-
- def get(self, section, option):
- """ Get config value for given section and option key. """
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-markdown.git/commitdiff/c10584292649218c12f3288e5b5b2388d55bfe38
More information about the pld-cvs-commit
mailing list