diff --git a/mkdocs-1.1.2-72f506dcce8db268ae4b3798cd30c8afd378d076.patch b/mkdocs-1.1.2-72f506dcce8db268ae4b3798cd30c8afd378d076.patch new file mode 100644 index 0000000..303903a --- /dev/null +++ b/mkdocs-1.1.2-72f506dcce8db268ae4b3798cd30c8afd378d076.patch @@ -0,0 +1,24 @@ +From 72f506dcce8db268ae4b3798cd30c8afd378d076 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Singaravelan +Date: Sun, 18 Oct 2020 07:12:43 +0000 +Subject: [PATCH] Import ABC from collections.abc explicitly. + +--- + mkdocs/config/config_options.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py +index b5b2804..56eda77 100644 +--- a/mkdocs/config/config_options.py ++++ b/mkdocs/config/config_options.py +@@ -1,5 +1,6 @@ + import os +-from collections import Sequence, namedtuple ++from collections import namedtuple ++from collections.abc import Sequence + from urllib.parse import urlparse + import ipaddress + import markdown +-- +2.31.1 + diff --git a/mkdocs-1.1.2-775d506c63d4b57553110ee56b8c1f94d336e1f7.patch b/mkdocs-1.1.2-775d506c63d4b57553110ee56b8c1f94d336e1f7.patch new file mode 100644 index 0000000..74e3493 --- /dev/null +++ b/mkdocs-1.1.2-775d506c63d4b57553110ee56b8c1f94d336e1f7.patch @@ -0,0 +1,46 @@ +From 775d506c63d4b57553110ee56b8c1f94d336e1f7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= +Date: Sat, 8 May 2021 15:40:37 +0200 +Subject: [PATCH] Update IpAddress tests for Python3.9.5 + +--- + mkdocs/tests/config/config_options_tests.py | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/mkdocs/tests/config/config_options_tests.py b/mkdocs/tests/config/config_options_tests.py +index 3a125d6..8095f9f 100644 +--- a/mkdocs/tests/config/config_options_tests.py ++++ b/mkdocs/tests/config/config_options_tests.py +@@ -132,6 +132,10 @@ class IpAddressTest(unittest.TestCase): + self.assertEqual(value.host, '127.0.0.1') + self.assertEqual(value.port, 8000) + ++ @unittest.skipIf( ++ sys.version_info >= (3, 9, 5), ++ "Leading zeros not allowed in IP addresses since Python3.9.5", ++ ) + def test_IP_normalization(self): + addr = '127.000.000.001:8000' + option = config_options.IpAddress(default=addr) +@@ -140,6 +144,18 @@ class IpAddressTest(unittest.TestCase): + self.assertEqual(value.host, '127.0.0.1') + self.assertEqual(value.port, 8000) + ++ @unittest.skipIf( ++ sys.version_info < (3, 9, 5), ++ "Leading zeros allowed in IP addresses before Python3.9.5", ++ ) ++ def test_invalid_leading_zeros(self): ++ addr = '127.000.000.001:8000' ++ option = config_options.IpAddress(default=addr) ++ self.assertRaises( ++ config_options.ValidationError, ++ option.validate, addr ++ ) ++ + def test_invalid_address_range(self): + option = config_options.IpAddress() + self.assertRaises( +-- +2.31.1 + diff --git a/mkdocs-1.1.2-autospec.patch b/mkdocs-1.1.2-autospec.patch new file mode 100644 index 0000000..bf8da77 --- /dev/null +++ b/mkdocs-1.1.2-autospec.patch @@ -0,0 +1,54 @@ +diff -Naur mkdocs-1.1.2-original/mkdocs/tests/utils/ghp_import_tests.py mkdocs-1.1.2/mkdocs/tests/utils/ghp_import_tests.py +--- mkdocs-1.1.2-original/mkdocs/tests/utils/ghp_import_tests.py 2020-05-14 11:07:56.000000000 -0400 ++++ mkdocs-1.1.2/mkdocs/tests/utils/ghp_import_tests.py 2021-06-07 06:29:51.063019433 -0400 +@@ -13,8 +13,8 @@ + + class UtilsTests(unittest.TestCase): + +- @mock.patch('subprocess.call', auto_spec=True) +- @mock.patch('subprocess.Popen', auto_spec=True) ++ @mock.patch('subprocess.call', autospec=True) ++ @mock.patch('subprocess.Popen', autospec=True) + def test_try_rebase(self, mock_popen, mock_call): + + popen = mock.Mock() +@@ -33,7 +33,7 @@ + ['git', 'update-ref', 'refs/heads/gh-pages', + '4c82346e4b1b816be89dd709d35a6b169aa3df61']) + +- @mock.patch('subprocess.Popen', auto_spec=True) ++ @mock.patch('subprocess.Popen', autospec=True) + def test_get_prev_commit(self, mock_popen): + + popen = mock.Mock() +@@ -50,7 +50,7 @@ + stdin=subprocess.PIPE, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + +- @mock.patch('subprocess.Popen', auto_spec=True) ++ @mock.patch('subprocess.Popen', autospec=True) + def test_get_config(self, mock_popen): + + popen = mock.Mock() +@@ -81,8 +81,8 @@ + @mock.patch('mkdocs.utils.ghp_import.try_rebase', return_value=True) + @mock.patch('mkdocs.utils.ghp_import.get_prev_commit', return_value='sha') + @mock.patch('mkdocs.utils.ghp_import.get_config', return_value='config') +- @mock.patch('subprocess.call', auto_spec=True) +- @mock.patch('subprocess.Popen', auto_spec=True) ++ @mock.patch('subprocess.call', autospec=True) ++ @mock.patch('subprocess.Popen', autospec=True) + def test_ghp_import(self, mock_popen, mock_call, mock_get_config, + mock_get_prev_commit, mock_try_rebase): + +@@ -108,8 +108,8 @@ + @mock.patch('mkdocs.utils.ghp_import.get_prev_commit', return_value='sha') + @mock.patch('mkdocs.utils.ghp_import.get_config', return_value='config') + @mock.patch('mkdocs.utils.ghp_import.run_import') +- @mock.patch('subprocess.call', auto_spec=True) +- @mock.patch('subprocess.Popen', auto_spec=True) ++ @mock.patch('subprocess.call', autospec=True) ++ @mock.patch('subprocess.Popen', autospec=True) + def test_ghp_import_error(self, mock_popen, mock_call, mock_get_config, + mock_run_import, mock_get_prev_commit, mock_try_rebase): + diff --git a/mkdocs.spec b/mkdocs.spec index 991266b..e0483d0 100644 --- a/mkdocs.spec +++ b/mkdocs.spec @@ -1,6 +1,6 @@ Name: mkdocs Version: 1.1.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Python tool to create HTML documentation from markdown sources # The entire source code is BSD except mkdocs/utils/ghp_import.py @@ -9,6 +9,21 @@ License: BSD and Tumbolia URL: http://www.mkdocs.org/ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Backport upstream commit 72f506dcce8db268ae4b3798cd30c8afd378d076 “Import ABC +# from collections.abc explicitly.”; this is required for Python 3.10. +Patch0: mkdocs-1.1.2-72f506dcce8db268ae4b3798cd30c8afd378d076.patch +# Backport upstream commit 775d506c63d4b57553110ee56b8c1f94d336e1f7 “Update +# IpAddress tests for Python3.9.5”; this fixes failing test +# test_IP_normalization (tests.config.config_options_tests.IpAddressTest) on +# Python 3.10. +Patch1: mkdocs-1.1.2-775d506c63d4b57553110ee56b8c1f94d336e1f7.patch +# Replace the incorrect mock.patch() keyword argument “auto_spec” with +# “autospec”; this caused “tests.utils.ghp_import_tests” to fail to import on +# Python 3.10. This patch does not need to be upstreamed because the affected +# file was removed entirely in commit 5c2b4f13536009852046c89aadd63ac46eacbaaa +# “Update ghp_import dependency to 1.0”. +Patch2: mkdocs-1.1.2-autospec.patch + BuildArch: noarch BuildRequires: python3-devel @@ -127,6 +142,12 @@ PYTHONPATH=$PWD coverage run --source=mkdocs --omit 'mkdocs/tests/*' -m unittest %doc site/* %changelog +* Mon Jun 07 2021 Benjamin A. Beasley - 1.1.2-6 +- Fix Python 3.10 build (fix rhbz#1913266): Backport upstream commits 72f506dc + and 775d506, and apply a temporary patch to + mkdocs/tests/utils/ghp_import_tests.py (which is removed upstream after the + current release) + * Fri Jun 04 2021 Python Maint - 1.1.2-5 - Rebuilt for Python 3.10