forked from pool/python-readme_renderer
Accepting request 946779 from devel:languages:python
- update to 32.0: * Allow start attribute in ordered lists (#216) * No limit rendering RST one column field names (#219) * Render disabled checkboxes from Markdown (#217) * support cmarkgfm>=0.6.0 (#209) - drop remove-mock.patch, remove-six.patch: upstream OBS-URL: https://build.opensuse.org/request/show/946779 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-readme_renderer?expand=0&rev=6
This commit is contained in:
commit
e50110e589
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 16 12:48:21 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 32.0:
|
||||
* Allow start attribute in ordered lists (#216)
|
||||
* No limit rendering RST one column field names (#219)
|
||||
* Render disabled checkboxes from Markdown (#217)
|
||||
* support cmarkgfm>=0.6.0 (#209)
|
||||
- drop remove-mock.patch, remove-six.patch: upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 22 10:45:29 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-readme_renderer
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -19,16 +19,12 @@
|
||||
%define skip_python2 1
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-readme_renderer
|
||||
Version: 29.0
|
||||
Version: 32.0
|
||||
Release: 0
|
||||
Summary: A library for rendering "readme" descriptions
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/pypa/readme_renderer
|
||||
Source: https://files.pythonhosted.org/packages/source/r/readme_renderer/readme_renderer-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM remove-mock.patch -- part of gh#pypa/readme_renderer#192
|
||||
Patch0: https://github.com/pypa/readme_renderer/commit/091bcd6.patch#/remove-mock.patch
|
||||
# PATCH-FIX-UPSTREAM remove-six.patch -- part of gh#pypa/readme_renderer#192
|
||||
Patch1: https://github.com/pypa/readme_renderer/commit/690e524.patch#/remove-six.patch
|
||||
BuildRequires: %{python_module Pygments >= 2.5.1}
|
||||
BuildRequires: %{python_module bleach >= 2.1.0}
|
||||
BuildRequires: %{python_module cmarkgfm >= 0.5.0}
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:92fd5ac2bf8677f310f3303aa4bce5b9d5f9f2094ab98c29f13791d7b805a3db
|
||||
size 27169
|
3
readme_renderer-32.0.tar.gz
Normal file
3
readme_renderer-32.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b512beafa6798260c7d5af3e1b1f097e58bfcd9a575da7c4ddd5e037490a5b85
|
||||
size 27812
|
@ -1,117 +0,0 @@
|
||||
From 091bcd67ada85e54b534a71fd63e5997120590a6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Tue, 23 Feb 2021 08:32:32 +0100
|
||||
Subject: [PATCH] Use built-in Python 3 unittest.mock module
|
||||
|
||||
Replace the use of external 'mock' package with the 'unittest.mock'
|
||||
module provided by Python 3. Since Python 2 is no longer supported,
|
||||
this eliminates an unnecessary dependency.
|
||||
---
|
||||
tests/test_integration_distutils.py | 26 +++++++++++++-------------
|
||||
tox.ini | 1 -
|
||||
2 files changed, 13 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/tests/test_integration_distutils.py b/tests/test_integration_distutils.py
|
||||
index 8118692..55a857e 100644
|
||||
--- a/tests/test_integration_distutils.py
|
||||
+++ b/tests/test_integration_distutils.py
|
||||
@@ -1,6 +1,6 @@
|
||||
import distutils.dist
|
||||
+import unittest.mock
|
||||
|
||||
-import mock
|
||||
import pytest
|
||||
import setuptools.dist
|
||||
|
||||
@@ -11,7 +11,7 @@ def test_valid_rst():
|
||||
dist = distutils.dist.Distribution(attrs=dict(
|
||||
long_description="Hello, I am some text."))
|
||||
checker = readme_renderer.integration.distutils.Check(dist)
|
||||
- checker.warn = mock.Mock()
|
||||
+ checker.warn = unittest.mock.Mock()
|
||||
|
||||
checker.check_restructuredtext()
|
||||
|
||||
@@ -22,14 +22,14 @@ def test_invalid_rst():
|
||||
dist = distutils.dist.Distribution(attrs=dict(
|
||||
long_description="Hello, I am some `totally borked< text."))
|
||||
checker = readme_renderer.integration.distutils.Check(dist)
|
||||
- checker.warn = mock.Mock()
|
||||
- checker.announce = mock.Mock()
|
||||
+ checker.warn = unittest.mock.Mock()
|
||||
+ checker.announce = unittest.mock.Mock()
|
||||
|
||||
checker.check_restructuredtext()
|
||||
|
||||
# Should warn once for the syntax error, and finally to warn that the
|
||||
# overall syntax is invalid
|
||||
- checker.warn.assert_called_once_with(mock.ANY)
|
||||
+ checker.warn.assert_called_once_with(unittest.mock.ANY)
|
||||
message = checker.warn.call_args[0][0]
|
||||
assert 'invalid markup' in message
|
||||
assert 'line 1: Warning:' in message
|
||||
@@ -47,14 +47,14 @@ def test_malicious_rst():
|
||||
dist = distutils.dist.Distribution(attrs=dict(
|
||||
long_description=description))
|
||||
checker = readme_renderer.integration.distutils.Check(dist)
|
||||
- checker.warn = mock.Mock()
|
||||
- checker.announce = mock.Mock()
|
||||
+ checker.warn = unittest.mock.Mock()
|
||||
+ checker.announce = unittest.mock.Mock()
|
||||
|
||||
checker.check_restructuredtext()
|
||||
|
||||
# Should warn once for the syntax error, and finally to warn that the
|
||||
# overall syntax is invalid
|
||||
- checker.warn.assert_called_once_with(mock.ANY)
|
||||
+ checker.warn.assert_called_once_with(unittest.mock.ANY)
|
||||
message = checker.warn.call_args[0][0]
|
||||
assert 'directive disabled' in message
|
||||
|
||||
@@ -68,7 +68,7 @@ def test_markdown():
|
||||
long_description="Hello, I am some text.",
|
||||
long_description_content_type="text/markdown"))
|
||||
checker = readme_renderer.integration.distutils.Check(dist)
|
||||
- checker.warn = mock.Mock()
|
||||
+ checker.warn = unittest.mock.Mock()
|
||||
|
||||
checker.check_restructuredtext()
|
||||
|
||||
@@ -79,11 +79,11 @@ def test_markdown():
|
||||
def test_invalid_missing():
|
||||
dist = distutils.dist.Distribution(attrs=dict())
|
||||
checker = readme_renderer.integration.distutils.Check(dist)
|
||||
- checker.warn = mock.Mock()
|
||||
+ checker.warn = unittest.mock.Mock()
|
||||
|
||||
checker.check_restructuredtext()
|
||||
|
||||
- checker.warn.assert_called_once_with(mock.ANY)
|
||||
+ checker.warn.assert_called_once_with(unittest.mock.ANY)
|
||||
assert 'missing' in checker.warn.call_args[0][0]
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ def test_invalid_empty():
|
||||
dist = distutils.dist.Distribution(attrs=dict(
|
||||
long_description=""))
|
||||
checker = readme_renderer.integration.distutils.Check(dist)
|
||||
- checker.warn = mock.Mock()
|
||||
+ checker.warn = unittest.mock.Mock()
|
||||
|
||||
checker.check_restructuredtext()
|
||||
|
||||
- checker.warn.assert_called_once_with(mock.ANY)
|
||||
+ checker.warn.assert_called_once_with(unittest.mock.ANY)
|
||||
assert 'missing' in checker.warn.call_args[0][0]
|
||||
diff --git a/tox.ini b/tox.ini
|
||||
index 70fdc66..5edb19f 100644
|
||||
--- a/tox.ini
|
||||
+++ b/tox.ini
|
||||
@@ -4,7 +4,6 @@ envlist = py36,py37,py38,py39,pep8,packaging,noextra
|
||||
[testenv]
|
||||
deps =
|
||||
pytest
|
||||
- mock
|
||||
commands =
|
||||
py.test --strict {posargs}
|
||||
extras = md
|
@ -1,90 +0,0 @@
|
||||
From 690e5248960280232315f804e1f0c6bf7a1d3348 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Tue, 23 Feb 2021 08:58:46 +0100
|
||||
Subject: [PATCH] Remove the use of six since only Python 3 is supported
|
||||
|
||||
---
|
||||
readme_renderer/integration/distutils.py | 2 --
|
||||
readme_renderer/markdown.py | 9 ++-------
|
||||
setup.py | 2 +-
|
||||
tests/test_rst.py | 3 +--
|
||||
4 files changed, 4 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/readme_renderer/integration/distutils.py b/readme_renderer/integration/distutils.py
|
||||
index 98d0f08..eb04460 100644
|
||||
--- a/readme_renderer/integration/distutils.py
|
||||
+++ b/readme_renderer/integration/distutils.py
|
||||
@@ -20,7 +20,6 @@
|
||||
import distutils.log
|
||||
from distutils.command.check import check as _check
|
||||
from distutils.core import Command
|
||||
-import six
|
||||
|
||||
from ..rst import render
|
||||
|
||||
@@ -35,7 +34,6 @@
|
||||
r'(?P<message>.*)', re.DOTALL | re.MULTILINE)
|
||||
|
||||
|
||||
-@six.python_2_unicode_compatible
|
||||
class _WarningStream(object):
|
||||
def __init__(self):
|
||||
self.output = io.StringIO()
|
||||
diff --git a/readme_renderer/markdown.py b/readme_renderer/markdown.py
|
||||
index ca2f03f..ae32539 100644
|
||||
--- a/readme_renderer/markdown.py
|
||||
+++ b/readme_renderer/markdown.py
|
||||
@@ -16,17 +16,12 @@
|
||||
import re
|
||||
import warnings
|
||||
|
||||
+from html.parser import unescape
|
||||
+
|
||||
import pygments
|
||||
import pygments.lexers
|
||||
import pygments.formatters
|
||||
|
||||
-try:
|
||||
- from six.moves.html_parser import unescape
|
||||
-except ImportError: # Python 2
|
||||
- from six.moves import html_parser
|
||||
-
|
||||
- unescape = html_parser.HTMLParser().unescape
|
||||
-
|
||||
from .clean import clean
|
||||
|
||||
_EXTRA_WARNING = (
|
||||
diff --git a/setup.py b/setup.py
|
||||
index ff1feaf..c8e35c1 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -55,7 +55,7 @@
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
],
|
||||
- install_requires=["bleach>=2.1.0", "docutils>=0.13.1", "Pygments>=2.5.1", "six"],
|
||||
+ install_requires=["bleach>=2.1.0", "docutils>=0.13.1", "Pygments>=2.5.1"],
|
||||
entry_points={
|
||||
"distutils.commands": ["check = readme_renderer.integration.distutils:Check"],
|
||||
},
|
||||
diff --git a/tests/test_rst.py b/tests/test_rst.py
|
||||
index 3de3dbf..64e552c 100755
|
||||
--- a/tests/test_rst.py
|
||||
+++ b/tests/test_rst.py
|
||||
@@ -3,7 +3,6 @@
|
||||
import os.path
|
||||
|
||||
import pytest
|
||||
-import six
|
||||
|
||||
from readme_renderer.rst import render
|
||||
|
||||
@@ -46,7 +45,7 @@ def test_rst_002():
|
||||
|
||||
|
||||
def test_rst_raw():
|
||||
- warnings = six.StringIO()
|
||||
+ warnings = io.StringIO()
|
||||
assert render("""
|
||||
.. raw:: html
|
||||
<script>I am evil</script>
|
Loading…
Reference in New Issue
Block a user