[arch-commits] Commit in m2r/trunk (PKGBUILD docutils-0.19.patch)

Antonio Rojas arojas at gemini.archlinux.org
Sun Jul 31 18:56:06 UTC 2022


    Date: Sunday, July 31, 2022 @ 18:56:05
  Author: arojas
Revision: 1259466

upgpkg: m2r 0.2.1-11: Fix for docutils 0.19

Added:
  m2r/trunk/docutils-0.19.patch
Modified:
  m2r/trunk/PKGBUILD

---------------------+
 PKGBUILD            |    9 ++--
 docutils-0.19.patch |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-07-31 18:56:01 UTC (rev 1259465)
+++ PKGBUILD	2022-07-31 18:56:05 UTC (rev 1259466)
@@ -2,7 +2,7 @@
 
 pkgname=m2r
 pkgver=0.2.1
-pkgrel=10
+pkgrel=11
 pkgdesc="Markdown to reStructuredText converter"
 arch=('any')
 url="https://github.com/miyakogi/m2r"
@@ -11,13 +11,16 @@
 makedepends=('python-setuptools')
 checkdepends=('python-pygments' 'python-pytest-runner')
 source=("https://github.com/miyakogi/m2r/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
-        python310.patch)
+        python310.patch
+        docutils-0.19.patch)
 sha512sums=('847f04538ee52f0b0a88cee9474ed889e8114a3a7b1fb221cdaa867ab70ca52f517250f2c8bbf795ae598c7b6614e6d03d9f6f05b7e3d56fb8087d63eb52f1bc'
-            '3eeba63f27c0a4441948bfe3d55cf1db82ecc136a2ceafc054e68920f1da394df79d76c3fa8216effa516d1653f2bfda9f2f980cdca96d3f38468d18818c8bc1')
+            '3eeba63f27c0a4441948bfe3d55cf1db82ecc136a2ceafc054e68920f1da394df79d76c3fa8216effa516d1653f2bfda9f2f980cdca96d3f38468d18818c8bc1'
+            '9e6398fedb9ee4a9274b5e78222466696da51411bf80709f59220bb37d4fedd9a87f03106771409c295522a8a3ca1126c51e104a0b530b346950a435776b4f64')
 
 prepare() {
   cd m2r-$pkgver
   patch -Np1 -i ../python310.patch
+  patch -p1 -i ../docutils-0.19.patch
 }
 
 build() {

Added: docutils-0.19.patch
===================================================================
--- docutils-0.19.patch	                        (rev 0)
+++ docutils-0.19.patch	2022-07-31 18:56:05 UTC (rev 1259466)
@@ -0,0 +1,103 @@
+diff --git a/m2r.py b/m2r.py
+index a4e43c2..6c1e6e0 100644
+--- a/m2r.py
++++ b/m2r.py
+@@ -5,21 +5,13 @@
+ import os
+ import os.path
+ import re
+-import sys
+ from argparse import ArgumentParser, Namespace
+ 
+ from docutils import statemachine, nodes, io, utils
+ from docutils.parsers import rst
+-from docutils.core import ErrorString
+-from docutils.utils import SafeString, column_width
++from docutils.utils import column_width
+ import mistune
+-
+-if sys.version_info < (3, ):
+-    from codecs import open as _open
+-    from urlparse import urlparse
+-else:
+-    _open = open
+-    from urllib.parse import urlparse
++from urllib.parse import urlparse
+ 
+ __version__ = '0.2.1'
+ _is_sphinx = False
+@@ -609,10 +601,10 @@ def run(self):
+             raise self.severe('Problems with "%s" directive path:\n'
+                               'Cannot encode input file path "%s" '
+                               '(wrong locale?).' %
+-                              (self.name, SafeString(path)))
++                              (self.name, path))
+         except IOError as error:
+             raise self.severe('Problems with "%s" directive path:\n%s.' %
+-                              (self.name, ErrorString(error)))
++                              (self.name, io.error_string(error)))
+ 
+         # read from the file
+         startline = self.options.get('start-line', None)
+@@ -625,7 +617,7 @@ def run(self):
+                 rawtext = include_file.read()
+         except UnicodeError as error:
+             raise self.severe('Problem with "%s" directive:\n%s' %
+-                              (self.name, ErrorString(error)))
++                              (self.name, io.error_string(error)))
+ 
+         config = self.state.document.settings.env.config
+         converter = M2R(
+@@ -670,7 +662,7 @@ def convert(text, **kwargs):
+ def parse_from_file(file, encoding='utf-8', **kwargs):
+     if not os.path.exists(file):
+         raise OSError('No such file exists: {}'.format(file))
+-    with _open(file, encoding=encoding) as f:
++    with open(file, encoding=encoding) as f:
+         src = f.read()
+     output = convert(src, **kwargs)
+     return output
+@@ -684,7 +676,7 @@ def save_to_file(file, src, encoding='utf-8', **kwargs):
+         if confirm.upper() not in ('Y', 'YES'):
+             print('skip {}'.format(file))
+             return
+-    with _open(target, 'w', encoding=encoding) as f:
++    with open(target, 'w', encoding=encoding) as f:
+         f.write(src)
+ 
+ 
+diff --git a/setup.py b/setup.py
+index a5768ad..bbc01b0 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,7 +1,6 @@
+ #!/usr/bin/env python
+ # -*- coding: utf-8 -*-
+ 
+-import sys
+ from os import path
+ 
+ try:
+@@ -19,8 +18,6 @@
+ 
+ install_requires = ['mistune', 'docutils']
+ test_requirements = ['pygments']
+-if sys.version_info < (3, 3):
+-    test_requirements.append('mock')
+ 
+ setup(
+     name='m2r',
+@@ -42,12 +39,8 @@
+         'Intended Audience :: Developers',
+         'License :: OSI Approved :: MIT License',
+         'Natural Language :: English',
+-        'Programming Language :: Python :: 2',
+-        'Programming Language :: Python :: 2.7',
+         'Programming Language :: Python :: 3',
+-        'Programming Language :: Python :: 3.4',
+-        'Programming Language :: Python :: 3.5',
+-        'Programming Language :: Python :: 3.6',
++        'Programming Language :: Python :: 3.7',
+         'Topic :: Text Processing',
+     ],
+     install_requires=install_requires,



More information about the arch-commits mailing list