Compare commits

...

No commits in common. 'i10ce' and 'epel9' have entirely different histories.
i10ce ... epel9

3
.gitignore vendored

@ -1 +1,2 @@
SOURCES/smartypants-2.0.1.tar.gz /smartypants-2.0.1.tar.gz
clog

@ -1 +0,0 @@
73f663d2370b33328a7c3490cb4c9fdf0146c5ee SOURCES/smartypants-2.0.1.tar.gz

@ -1,113 +0,0 @@
From 7532e7c62b67cb16fbe2a9bcd48afb7011e1bfd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= <mimi.vx@gmail.com>
Date: Mon, 25 Sep 2023 10:31:37 +0200
Subject: [PATCH] Fix regexps and tests for python3.12
---
smartypants.py | 4 ++--
tests/test.py | 4 ++--
tests/test_cli.py | 16 ++++++++--------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/smartypants.py b/smartypants.py
index c39f409..37368fb 100755
--- a/smartypants.py
+++ b/smartypants.py
@@ -268,13 +268,13 @@ def smartypants(text, attr=None):
if do_quotes:
if t == "'":
# Special case: single-character ' token
- if re.match("\S", prev_token_last_char):
+ if re.match(r"\S", prev_token_last_char):
t = "&#8217;"
else:
t = "&#8216;"
elif t == '"':
# Special case: single-character " token
- if re.match("\S", prev_token_last_char):
+ if re.match(r"\S", prev_token_last_char):
t = "&#8221;"
else:
t = "&#8220;"
diff --git a/tests/test.py b/tests/test.py
index 2c1a0ea..ac5075a 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -24,7 +24,7 @@ class SmartyPantsTestCase(unittest.TestCase):
T = sp(TEXT)
E = '&#8220;foo&#8221; -- bar'
- self.assertEquals(T, E)
+ self.assertEqual(T, E)
attr = Attr.q | Attr.d
Attr.default = attr
@@ -32,7 +32,7 @@ class SmartyPantsTestCase(unittest.TestCase):
T = sp(TEXT)
E = '&#8220;foo&#8221; &#8212; bar'
- self.assertEquals(T, E)
+ self.assertEqual(T, E)
def test_dates(self):
diff --git a/tests/test_cli.py b/tests/test_cli.py
index e85545a..6b5e136 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -34,7 +34,7 @@ class TestCLI(unittest.TestCase):
E = '&#8220;foobar&#8221;'
output = self._p([CLI_SCRIPT], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
def test_pipe_attr(self):
@@ -42,11 +42,11 @@ class TestCLI(unittest.TestCase):
E = T
output = self._p([CLI_SCRIPT, '--attr', '0'], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
E = """"foo" &#8220;bar&#8221;"""
output = self._p([CLI_SCRIPT, '--attr', 'b'], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
def test_skipped_elements(self):
@@ -54,19 +54,19 @@ class TestCLI(unittest.TestCase):
E = '<a>&#8220;foo&#8221;</a> <b>&#8220;bar&#8221;</b>'
output = self._p([CLI_SCRIPT], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
E = '<a>"foo"</a> <b>&#8220;bar&#8221;</b>'
output = self._p([CLI_SCRIPT, '--skip', 'a'], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
E = '<a>&#8220;foo&#8221;</a> <b>"bar"</b>'
output = self._p([CLI_SCRIPT, '--skip', 'b'], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
E = T
output = self._p([CLI_SCRIPT, '--skip', 'a,b'], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
def test_file(self):
@@ -81,4 +81,4 @@ class TestCLI(unittest.TestCase):
output = self._p([CLI_SCRIPT, F])
finally:
os.remove(F)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
--
2.46.0

@ -2,22 +2,18 @@
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 2.0.1 Version: 2.0.1
Release: 22%{?dist} Release: 14%{?dist}
Summary: plug-in that easily translates ASCII punctuation characters into smart entities Summary: plug-in that easily translates ASCII punctuation characters into smart entities
License: BSD-3-Clause AND BSD-2-Clause License: BSD
URL: https://github.com/leohemsted/smartypants.py URL: https://github.com/leohemsted/smartypants.py
Source0: %url/archive/v%{version}/%{pypi_name}-%{version}.tar.gz Source0: %url/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
# https://github.com/leohemsted/smartypants.py/pull/21
Patch: 0001-Fix-regexps-and-tests-for-python3.12.patch
BuildRequires: make BuildRequires: make
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-docutils BuildRequires: python3dist(setuptools)
BuildRequires: python3-sphinx BuildRequires: python3dist(sphinx)
%description %description
SmartyPants is a free web publishing plug-in for Movable SmartyPants is a free web publishing plug-in for Movable
@ -28,8 +24,9 @@ entities.
%package -n python3-%{pypi_name} %package -n python3-%{pypi_name}
Summary: %{summary} Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires: python3dist(setuptools)
%description -n python3-%{pypi_name} %description -n python3-%{pypi_name}
SmartyPants is a free web publishing plug-in for Movable SmartyPants is a free web publishing plug-in for Movable
Type, Blosxom, and BBEdit that easily translates plain ASCII Type, Blosxom, and BBEdit that easily translates plain ASCII
@ -44,18 +41,17 @@ Documentation for python-smartypants
%prep %prep
%autosetup -p 1 -n %{pypi_name}.py-%{version} %autosetup -n %{pypi_name}.py-%{version}
# This is automatically on scripts in %%{_bindir}, but the tests run this # Remove bundled egg-info
# script from the working directory so we need to fix it earlier. rm -rf %{pypi_name}.egg-info
%py3_shebang_fix smartypants for lib in $(find -type f -name '*.py'); do
sed -i.python -e '1{\@^#!@d}' $lib
done
%generate_buildrequires sed -i.python -e 's|#!/usr/bin/env python|#!/usr/bin/python3|' smartypants
%pyproject_buildrequires
%build %build
%pyproject_wheel %py3_build
# generate html documentation # generate html documentation
cd docs cd docs
make html make html
@ -64,53 +60,26 @@ rm -rf _build/html/.{doctrees,buildinfo}
%install %install
%pyproject_install %py3_install
%pyproject_save_files -l %{pypi_name}
%check %check
%{py3_test_envvars} %{python3} -m unittest discover --verbose --start-directory tests %{__python3} setup.py test
%files -n python3-%{pypi_name} -f %{pyproject_files} %files -n python3-%{pypi_name}
%doc README.rst %doc README.rst
%doc CHANGES.rst %doc CHANGES.rst
%license COPYING
%{_bindir}/%{pypi_name} %{_bindir}/%{pypi_name}
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{pypi_name}.py
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%files -n python-%{pypi_name}-doc %files -n python-%{pypi_name}-doc
%doc docs/_build/html %doc docs/_build/html
%license COPYING %license COPYING
%changelog %changelog
* Thu Dec 12 2024 Sergey Cherevko <s.cherevko@msvsphere-os.ru> - 2.0.1-22
- Rebuilt for MSVSphere 10
* Tue Oct 15 2024 Carl George <carlwgeorge@fedoraproject.org> - 2.0.1-22
- Convert to pyproject macros
- Fix test invocation
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 2.0.1-20
- Rebuilt for Python 3.13
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 2.0.1-16
- Rebuilt for Python 3.12
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-14 * Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

@ -0,0 +1 @@
SHA512 (smartypants-2.0.1.tar.gz) = d47a866a5478c3520251f87a93a468a5eea10318b24b2e8d4bc918d533b5a5789aa56d3a8d5fb8ccff9572fb63e5b6f2eafc44f93fb57a19e6621ebef5d64d9d
Loading…
Cancel
Save