Compare commits
6 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| b8e151ea95 | |||
| 88d83eca0e | |||
| 53b913be5d | |||
| 1c677aeb11 | |||
| 6459197020 | |||
| f3b26ebdf9 |
@@ -1,99 +0,0 @@
|
||||
Index: smartypants.py-2.0.1/tests/test_cli.py
|
||||
===================================================================
|
||||
--- smartypants.py-2.0.1.orig/tests/test_cli.py
|
||||
+++ smartypants.py-2.0.1/tests/test_cli.py
|
||||
@@ -35,7 +35,7 @@ class TestCLI(unittest.TestCase):
|
||||
E = '“foobar”'
|
||||
|
||||
output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
def test_pipe_attr(self):
|
||||
|
||||
@@ -43,11 +43,11 @@ class TestCLI(unittest.TestCase):
|
||||
|
||||
E = T
|
||||
output = self._p([sys.executable, CLI_SCRIPT, '--attr', '0'], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
E = """"foo" “bar”"""
|
||||
output = self._p([sys.executable, CLI_SCRIPT, '--attr', 'b'], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
def test_skipped_elements(self):
|
||||
|
||||
@@ -55,19 +55,19 @@ class TestCLI(unittest.TestCase):
|
||||
|
||||
E = '<a>“foo”</a> <b>“bar”</b>'
|
||||
output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
E = '<a>"foo"</a> <b>“bar”</b>'
|
||||
output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a'], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
E = '<a>“foo”</a> <b>"bar"</b>'
|
||||
output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'b'], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
E = T
|
||||
output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a,b'], T)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
|
||||
def test_file(self):
|
||||
|
||||
@@ -82,4 +82,4 @@ class TestCLI(unittest.TestCase):
|
||||
output = self._p([sys.executable, CLI_SCRIPT, F])
|
||||
finally:
|
||||
os.remove(F)
|
||||
- self.assertEquals(output, E)
|
||||
+ self.assertEqual(output, E)
|
||||
Index: smartypants.py-2.0.1/smartypants.py
|
||||
===================================================================
|
||||
--- smartypants.py-2.0.1.orig/smartypants.py
|
||||
+++ smartypants.py-2.0.1/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 = "“"
|
||||
Index: smartypants.py-2.0.1/tests/test.py
|
||||
===================================================================
|
||||
--- smartypants.py-2.0.1.orig/tests/test.py
|
||||
+++ smartypants.py-2.0.1/tests/test.py
|
||||
@@ -24,7 +24,7 @@ class SmartyPantsTestCase(unittest.TestC
|
||||
|
||||
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.TestC
|
||||
|
||||
T = sp(TEXT)
|
||||
E = '“foo” — bar'
|
||||
- self.assertEquals(T, E)
|
||||
+ self.assertEqual(T, E)
|
||||
|
||||
def test_dates(self):
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 25 12:30:18 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Convert to libalternatives on SLE-16-based and newer systems only
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 17 16:46:42 UTC 2025 - Benoît Monin <benoit.monin@gmx.fr>
|
||||
|
||||
- update to version 2.0.2:
|
||||
* Fix double closing quotes after an HTML block
|
||||
* Fix regular expressions and tests for Python 3.12+
|
||||
* Move documentation to ReadTheDocs
|
||||
- drop fix-312.patch: merged upstream
|
||||
- refresh use-sys-executable.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 12 12:07:46 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Convert to pip-based build and libalternatives
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 25 08:24:56 UTC 2023 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-smartypants
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC and contributors
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,9 +16,14 @@
|
||||
#
|
||||
|
||||
|
||||
%if 0%{?suse_version} > 1500
|
||||
%bcond_without libalternatives
|
||||
%else
|
||||
%bcond_with libalternatives
|
||||
%endif
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-smartypants
|
||||
Version: 2.0.1
|
||||
Version: 2.0.2
|
||||
Release: 0
|
||||
Summary: Python fork of perl SmartyPants
|
||||
License: BSD-3-Clause
|
||||
@@ -26,16 +31,21 @@ Group: Development/Languages/Python
|
||||
URL: https://github.com/leohemsted/smartypants.py
|
||||
Source: https://github.com/leohemsted/smartypants.py/archive/v%{version}.tar.gz#/smartypants-%{version}.tar.gz
|
||||
Patch0: use-sys-executable.patch
|
||||
Patch1: fix-312.patch
|
||||
BuildRequires: %{python_module docutils}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pygments}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun):update-alternatives
|
||||
BuildArch: noarch
|
||||
|
||||
%if %{with libalternatives}
|
||||
BuildRequires: alts
|
||||
Requires: alts
|
||||
%else
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
%endif
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
@@ -47,10 +57,10 @@ typographic punctuation HTML entities.
|
||||
%autosetup -p1 -n smartypants.py-%{version}
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%{python_expand sed -i '1{/^#!/d}' %{buildroot}%{$python_sitelib}/smartypants.py
|
||||
%fdupes %{buildroot}%{$python_sitelib}
|
||||
}
|
||||
@@ -62,6 +72,9 @@ typographic punctuation HTML entities.
|
||||
%postun
|
||||
%python_uninstall_alternative smartypants
|
||||
|
||||
%pre
|
||||
%python_libalternatives_reset_alternative smartypants
|
||||
|
||||
%check
|
||||
%pyunittest discover -v tests
|
||||
|
||||
|
||||
BIN
smartypants-2.0.1.tar.gz
LFS
BIN
smartypants-2.0.1.tar.gz
LFS
Binary file not shown.
3
smartypants-2.0.2.tar.gz
Normal file
3
smartypants-2.0.2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:560ae7485a27c288f5bd63131f5c3c7b8f0745f50e7c3f85f0bbc65d87799d19
|
||||
size 28770
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: smartypants.py-2.0.1/tests/test_cli.py
|
||||
Index: smartypants.py-2.0.2/tests/test_cli.py
|
||||
===================================================================
|
||||
--- smartypants.py-2.0.1.orig/tests/test_cli.py
|
||||
+++ smartypants.py-2.0.1/tests/test_cli.py
|
||||
--- smartypants.py-2.0.2.orig/tests/test_cli.py
|
||||
+++ smartypants.py-2.0.2/tests/test_cli.py
|
||||
@@ -7,6 +7,7 @@ import os
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -16,7 +16,7 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
||||
|
||||
- output = self._p([CLI_SCRIPT], T)
|
||||
+ output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||
self.assertEquals(output, E)
|
||||
self.assertEqual(output, E)
|
||||
|
||||
def test_pipe_attr(self):
|
||||
@@ -41,11 +42,11 @@ class TestCLI(unittest.TestCase):
|
||||
@@ -25,12 +25,12 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
||||
E = T
|
||||
- output = self._p([CLI_SCRIPT, '--attr', '0'], T)
|
||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--attr', '0'], T)
|
||||
self.assertEquals(output, E)
|
||||
self.assertEqual(output, E)
|
||||
|
||||
E = """"foo" “bar”"""
|
||||
- output = self._p([CLI_SCRIPT, '--attr', 'b'], T)
|
||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--attr', 'b'], T)
|
||||
self.assertEquals(output, E)
|
||||
self.assertEqual(output, E)
|
||||
|
||||
def test_skipped_elements(self):
|
||||
@@ -53,19 +54,19 @@ class TestCLI(unittest.TestCase):
|
||||
@@ -39,22 +39,22 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
||||
E = '<a>“foo”</a> <b>“bar”</b>'
|
||||
- output = self._p([CLI_SCRIPT], T)
|
||||
+ output = self._p([sys.executable, 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)
|
||||
+ output = self._p([sys.executable, 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)
|
||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'b'], T)
|
||||
self.assertEquals(output, E)
|
||||
self.assertEqual(output, E)
|
||||
|
||||
E = T
|
||||
- output = self._p([CLI_SCRIPT, '--skip', 'a,b'], T)
|
||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a,b'], T)
|
||||
self.assertEquals(output, E)
|
||||
self.assertEqual(output, E)
|
||||
|
||||
def test_file(self):
|
||||
@@ -78,7 +79,7 @@ class TestCLI(unittest.TestCase):
|
||||
@@ -65,4 +65,4 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
||||
+ output = self._p([sys.executable, CLI_SCRIPT, F])
|
||||
finally:
|
||||
os.remove(F)
|
||||
self.assertEquals(output, E)
|
||||
self.assertEqual(output, E)
|
||||
|
||||
Reference in New Issue
Block a user