diff --git a/pr_5.patch b/pr_5.patch new file mode 100644 index 0000000..3fef275 --- /dev/null +++ b/pr_5.patch @@ -0,0 +1,49 @@ +From f06dccb62cec60f4c950893861f27b39531d50da Mon Sep 17 00:00:00 2001 +From: Torbjorn Sorby +Date: Tue, 7 Sep 2021 15:26:31 +0200 +Subject: [PATCH] Remove use_2to3 + +use_2to3 is no longer supported by setuptools. Let's deprecate Python 2 +support, and remove the types `unicode` and `long`. + +@graingert suggested adding `python_requires`, thanks! + +Closes #4 +--- + rst2ast/writer.py | 2 +- + setup.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/rst2ast/writer.py b/rst2ast/writer.py +index 1e2e30c..59a675b 100644 +--- a/rst2ast/writer.py ++++ b/rst2ast/writer.py +@@ -47,7 +47,7 @@ def walk(self, node, line=1): + # Attributes + for k, v in node.__dict__.items(): + try: +- if not k.startswith('__') and isinstance(v, (str, int, float, bool, unicode, long,)): ++ if not k.startswith('__') and isinstance(v, (str, int, float, bool,)): + result[k] = v + except NameError as e: + pass +diff --git a/setup.py b/setup.py +index 0314cbb..84b4396 100755 +--- a/setup.py ++++ b/setup.py +@@ -6,7 +6,7 @@ + setup( + name='docutils-ast-writer', + description='AST Writer for docutils', +- version='0.1.2', ++ version='0.1.3', + author='jimo1001', + author_email='jimo1001@gmail.com', + license='MIT', +@@ -19,5 +19,5 @@ + [console_scripts] + rst2ast = rst2ast.cmd:run + """, +- use_2to3 = True ++ python_requires=">=3.6", + ) diff --git a/python-docutils-ast-writer.changes b/python-docutils-ast-writer.changes index f334ca5..488f7bc 100644 --- a/python-docutils-ast-writer.changes +++ b/python-docutils-ast-writer.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Feb 27 07:37:35 UTC 2022 - John Vandenberg + +- Add pr_5.patch to fix Python 3.10 + ------------------------------------------------------------------- Tue May 26 07:22:45 UTC 2020 - Petr Gajdos diff --git a/python-docutils-ast-writer.spec b/python-docutils-ast-writer.spec index 2dafd5f..cf83cc6 100644 --- a/python-docutils-ast-writer.spec +++ b/python-docutils-ast-writer.spec @@ -1,7 +1,7 @@ # # spec file for package python-docutils-ast-writer # -# Copyright (c) 2020 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 @@ -26,6 +26,7 @@ Group: Development/Languages/Python URL: https://github.com/jimo1001/docutils-ast-writer Source: https://files.pythonhosted.org/packages/source/d/docutils-ast-writer/docutils-ast-writer-%{version}.tar.gz Source1: https://raw.githubusercontent.com/jimo1001/docutils-ast-writer/master/LICENSE +Patch0: https://patch-diff.githubusercontent.com/raw/jimo1001/docutils-ast-writer/pull/5.patch#/pr_5.patch BuildRequires: %{python_module docutils >= 0.12} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -42,6 +43,7 @@ Docutils-ast-writer is an AST writer of Docutils. %prep %setup -q -n docutils-ast-writer-%{version} cp %{SOURCE1} . +%patch0 -p1 %build %python_build