commit
9958f6d26a
@ -0,0 +1 @@
|
||||
SOURCES/smartypants-2.0.1.tar.gz
|
@ -0,0 +1 @@
|
||||
73f663d2370b33328a7c3490cb4c9fdf0146c5ee SOURCES/smartypants-2.0.1.tar.gz
|
@ -0,0 +1,113 @@
|
||||
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 = "’"
|
||||
else:
|
||||
t = "‘"
|
||||
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 = "”"
|
||||
else:
|
||||
t = "“"
|
||||
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 = '“foo” -- 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 = '“foo” — 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 = '“foobar”'
|
||||
|
||||
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" “bar”"""
|
||||
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>“foo”</a> <b>“bar”</b>'
|
||||
output = self._p([CLI_SCRIPT], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
E = '<a>"foo"</a> <b>“bar”</b>'
|
||||
output = self._p([CLI_SCRIPT, '--skip', 'a'], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
E = '<a>“foo”</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
|
||||
|
@ -0,0 +1,3 @@
|
||||
# python-smartypants
|
||||
|
||||
The python-smartypants package
|
@ -0,0 +1,155 @@
|
||||
%global pypi_name smartypants
|
||||
|
||||
Name: python-%{pypi_name}
|
||||
Version: 2.0.1
|
||||
Release: 22%{?dist}
|
||||
Summary: plug-in that easily translates ASCII punctuation characters into smart entities
|
||||
|
||||
License: BSD-3-Clause AND BSD-2-Clause
|
||||
URL: https://github.com/leohemsted/smartypants.py
|
||||
Source0: %url/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
# https://github.com/leohemsted/smartypants.py/pull/21
|
||||
Patch: 0001-Fix-regexps-and-tests-for-python3.12.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-docutils
|
||||
BuildRequires: python3-sphinx
|
||||
|
||||
|
||||
%description
|
||||
SmartyPants is a free web publishing plug-in for Movable
|
||||
Type, Blosxom, and BBEdit that easily translates plain ASCII
|
||||
punctuation characters into “smart” typographic punctuation HTML
|
||||
entities.
|
||||
|
||||
|
||||
%package -n python3-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
SmartyPants is a free web publishing plug-in for Movable
|
||||
Type, Blosxom, and BBEdit that easily translates plain ASCII
|
||||
punctuation characters into “smart” typographic punctuation HTML
|
||||
entities.
|
||||
|
||||
|
||||
%package -n python-%{pypi_name}-doc
|
||||
Summary: python-smartypants documentation
|
||||
%description -n python-%{pypi_name}-doc
|
||||
Documentation for python-smartypants
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p 1 -n %{pypi_name}.py-%{version}
|
||||
# This is automatically on scripts in %%{_bindir}, but the tests run this
|
||||
# script from the working directory so we need to fix it earlier.
|
||||
%py3_shebang_fix smartypants
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
# generate html documentation
|
||||
cd docs
|
||||
make html
|
||||
# remove the sphinx-build leftovers
|
||||
rm -rf _build/html/.{doctrees,buildinfo}
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l %{pypi_name}
|
||||
|
||||
|
||||
%check
|
||||
%{py3_test_envvars} %{python3} -m unittest discover --verbose --start-directory tests
|
||||
|
||||
|
||||
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
%doc CHANGES.rst
|
||||
%{_bindir}/%{pypi_name}
|
||||
|
||||
|
||||
%files -n python-%{pypi_name}-doc
|
||||
%doc docs/_build/html
|
||||
%license COPYING
|
||||
|
||||
%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
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.0.1-13
|
||||
- Rebuilt for Python 3.11
|
||||
|
||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.0.1-10
|
||||
- Rebuilt for Python 3.10
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.0.1-7
|
||||
- Rebuilt for Python 3.9
|
||||
|
||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0.1-5
|
||||
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
||||
|
||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0.1-4
|
||||
- Rebuilt for Python 3.8
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Tue Jun 11 2019 José Matos <jamatos@fedoraproject.org> - 2.0.1-2
|
||||
- fix source url, license short hand, description and summary.
|
||||
- remove shebang lines and make smartypants a shebang line use python3.
|
||||
|
||||
* Sat Sep 1 2018 José Matos <jamatos@fedoraproject.org> - 2.0.1-1
|
||||
- initial package.
|
Loading…
Reference in new issue