- add use-sys-executable.patch to run the tests with the flavor
python interpreter OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-smartypants?expand=0&rev=12
This commit is contained in:
parent
57122881b5
commit
7f13d3529b
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 14 20:32:40 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- add use-sys-executable.patch to run the tests with the flavor
|
||||||
|
python interpreter
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Sep 8 10:03:32 UTC 2021 - pgajdos@suse.com
|
Wed Sep 8 10:03:32 UTC 2021 - pgajdos@suse.com
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-smartypants
|
# spec file for package python-smartypants
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 SUSE LLC
|
# Copyright (c) 2023 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
|
%global pythons python310 python311
|
||||||
Name: python-smartypants
|
Name: python-smartypants
|
||||||
Version: 2.0.1
|
Version: 2.0.1
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -25,6 +26,7 @@ License: BSD-3-Clause
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/leohemsted/smartypants.py
|
URL: https://github.com/leohemsted/smartypants.py
|
||||||
Source: https://github.com/leohemsted/smartypants.py/archive/v%{version}.tar.gz#/smartypants-%{version}.tar.gz
|
Source: https://github.com/leohemsted/smartypants.py/archive/v%{version}.tar.gz#/smartypants-%{version}.tar.gz
|
||||||
|
Patch1: use-sys-executable.patch
|
||||||
BuildRequires: %{python_module docutils}
|
BuildRequires: %{python_module docutils}
|
||||||
BuildRequires: %{python_module pygments}
|
BuildRequires: %{python_module pygments}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
@ -43,10 +45,10 @@ typographic punctuation HTML entities.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n smartypants.py-%{version}
|
%setup -q -n smartypants.py-%{version}
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
sed -i 's:python:python3:' setup.py smartypants tests/*.py
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%python_install
|
||||||
|
68
use-sys-executable.patch
Normal file
68
use-sys-executable.patch
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
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
|
||||||
|
@@ -7,6 +7,7 @@ import os
|
||||||
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
from subprocess import PIPE, Popen
|
||||||
|
+import sys
|
||||||
|
|
||||||
|
CLI_SCRIPT = './smartypants'
|
||||||
|
|
||||||
|
@@ -33,7 +34,7 @@ class TestCLI(unittest.TestCase):
|
||||||
|
T = '"foobar"'
|
||||||
|
E = '“foobar”'
|
||||||
|
|
||||||
|
- output = self._p([CLI_SCRIPT], T)
|
||||||
|
+ output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||||
|
self.assertEquals(output, E)
|
||||||
|
|
||||||
|
def test_pipe_attr(self):
|
||||||
|
@@ -41,11 +42,11 @@ class TestCLI(unittest.TestCase):
|
||||||
|
T = """"foo" ``bar''"""
|
||||||
|
|
||||||
|
E = T
|
||||||
|
- output = self._p([CLI_SCRIPT, '--attr', '0'], T)
|
||||||
|
+ output = self._p([sys.executable, CLI_SCRIPT, '--attr', '0'], T)
|
||||||
|
self.assertEquals(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)
|
||||||
|
|
||||||
|
def test_skipped_elements(self):
|
||||||
|
@@ -53,19 +54,19 @@ class TestCLI(unittest.TestCase):
|
||||||
|
T = '<a>"foo"</a> <b>"bar"</b>'
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
def test_file(self):
|
||||||
|
@@ -78,7 +79,7 @@ class TestCLI(unittest.TestCase):
|
||||||
|
with open(F, 'w') as f:
|
||||||
|
f.write(T)
|
||||||
|
|
||||||
|
- output = self._p([CLI_SCRIPT, F])
|
||||||
|
+ output = self._p([sys.executable, CLI_SCRIPT, F])
|
||||||
|
finally:
|
||||||
|
os.remove(F)
|
||||||
|
self.assertEquals(output, E)
|
Loading…
x
Reference in New Issue
Block a user