forked from pool/python-blockdiag
Accepting request 915425 from home:pgajdos:python
The sed was superfluous, redundant and forgotten. - added patches https://github.com/blockdiag/blockdiag/pull/131 + python-blockdiag-nose-to-pytest.patch OBS-URL: https://build.opensuse.org/request/show/915425 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-blockdiag?expand=0&rev=18
This commit is contained in:
93
python-blockdiag-nose-to-pytest.patch
Normal file
93
python-blockdiag-nose-to-pytest.patch
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index 116434d..7da66c2 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -67,7 +67,7 @@ def get_version():
|
||||||
|
'docutils'
|
||||||
|
],
|
||||||
|
'testing': [
|
||||||
|
- 'nose',
|
||||||
|
+ 'pytest',
|
||||||
|
'flake8',
|
||||||
|
'flake8-coding',
|
||||||
|
'flake8-copyright',
|
||||||
|
@@ -76,7 +76,6 @@ def get_version():
|
||||||
|
'docutils',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
- test_suite='nose.collector',
|
||||||
|
entry_points="""
|
||||||
|
[console_scripts]
|
||||||
|
blockdiag = blockdiag.command:main
|
||||||
|
diff --git a/src/blockdiag/tests/rst/test_blockdiag_directives.py b/src/blockdiag/tests/rst/test_blockdiag_directives.py
|
||||||
|
index 0b86583..72ed086 100644
|
||||||
|
--- a/src/blockdiag/tests/rst/test_blockdiag_directives.py
|
||||||
|
+++ b/src/blockdiag/tests/rst/test_blockdiag_directives.py
|
||||||
|
@@ -24,6 +24,9 @@
|
||||||
|
from blockdiag.tests.utils import TemporaryDirectory, capture_stderr, with_pil
|
||||||
|
from blockdiag.utils.rst import directives
|
||||||
|
|
||||||
|
+TESTDIR = os.path.dirname(__file__)
|
||||||
|
+FONTPATH = os.path.join(TESTDIR, '..', 'VLGothic', 'VL-Gothic-Regular.ttf')
|
||||||
|
+
|
||||||
|
|
||||||
|
class TestRstDirectives(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
@@ -178,7 +181,7 @@ def test_setup_inline_svg_is_true_but_format_isnt_svg(self):
|
||||||
|
self.assertEqual(nodes.image, type(doctree[0]))
|
||||||
|
|
||||||
|
def test_setup_inline_svg_is_true_with_multibytes(self):
|
||||||
|
- directives.setup(format='SVG', outputdir=self.tmpdir)
|
||||||
|
+ directives.setup(format='SVG', outputdir=self.tmpdir, fontpath=FONTPATH)
|
||||||
|
text = (".. blockdiag::\n"
|
||||||
|
"\n"
|
||||||
|
" あ -> い")
|
||||||
|
diff --git a/src/blockdiag/tests/test_generate_diagram.py b/src/blockdiag/tests/test_generate_diagram.py
|
||||||
|
index 361c86f..6b9a773 100644
|
||||||
|
--- a/src/blockdiag/tests/test_generate_diagram.py
|
||||||
|
+++ b/src/blockdiag/tests/test_generate_diagram.py
|
||||||
|
@@ -18,8 +18,6 @@
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
-from nose.tools import nottest
|
||||||
|
-
|
||||||
|
import blockdiag
|
||||||
|
import blockdiag.command
|
||||||
|
from blockdiag.tests.utils import (TemporaryDirectory, capture_stderr,
|
||||||
|
@@ -51,7 +49,7 @@ def test_generate():
|
||||||
|
files = get_diagram_files(basepath)
|
||||||
|
options = []
|
||||||
|
|
||||||
|
- for testcase in testcase_generator(basepath, mainfunc, files, options):
|
||||||
|
+ for testcase in _testcase_generator(basepath, mainfunc, files, options):
|
||||||
|
yield testcase
|
||||||
|
|
||||||
|
|
||||||
|
@@ -62,12 +60,11 @@ def test_generate_with_separate():
|
||||||
|
filtered = (f for f in files if re.search('separate', f))
|
||||||
|
options = ['--separate']
|
||||||
|
|
||||||
|
- for testcase in testcase_generator(basepath, mainfunc, filtered, options):
|
||||||
|
+ for testcase in _testcase_generator(basepath, mainfunc, filtered, options):
|
||||||
|
yield testcase
|
||||||
|
|
||||||
|
|
||||||
|
-@nottest
|
||||||
|
-def testcase_generator(basepath, mainfunc, files, options):
|
||||||
|
+def _testcase_generator(basepath, mainfunc, files, options):
|
||||||
|
fontpath = get_fontpath(basepath)
|
||||||
|
options = options + ['-f', fontpath]
|
||||||
|
|
||||||
|
diff --git a/tox.ini b/tox.ini
|
||||||
|
index 3912471..48b0c85 100644
|
||||||
|
--- a/tox.ini
|
||||||
|
+++ b/tox.ini
|
||||||
|
@@ -18,5 +18,5 @@ deps =
|
||||||
|
passenv =
|
||||||
|
ALL_TESTS
|
||||||
|
commands =
|
||||||
|
- nosetests
|
||||||
|
+ pytest
|
||||||
|
flake8 src
|
||||||
|
|
@@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 1 07:28:26 UTC 2021 - pgajdos@suse.com
|
||||||
|
|
||||||
|
- added patches
|
||||||
|
https://github.com/blockdiag/blockdiag/pull/131
|
||||||
|
+ python-blockdiag-nose-to-pytest.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Aug 30 13:34:57 UTC 2021 - pgajdos@suse.com
|
Mon Aug 30 13:34:57 UTC 2021 - pgajdos@suse.com
|
||||||
|
|
||||||
|
@@ -26,6 +26,8 @@ License: Apache-2.0
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: http://blockdiag.com/
|
URL: http://blockdiag.com/
|
||||||
Source: https://files.pythonhosted.org/packages/source/b/blockdiag/blockdiag-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/b/blockdiag/blockdiag-%{version}.tar.gz
|
||||||
|
# https://github.com/blockdiag/blockdiag/pull/131
|
||||||
|
Patch0: python-blockdiag-nose-to-pytest.patch
|
||||||
BuildRequires: %{python_module Pillow >= 2.2.1}
|
BuildRequires: %{python_module Pillow >= 2.2.1}
|
||||||
BuildRequires: %{python_module funcparserlib >= 0.3.6}
|
BuildRequires: %{python_module funcparserlib >= 0.3.6}
|
||||||
BuildRequires: %{python_module reportlab}
|
BuildRequires: %{python_module reportlab}
|
||||||
@@ -54,9 +56,11 @@ Recommends: python-reportlab
|
|||||||
|
|
||||||
%description
|
%description
|
||||||
The blockdiag package generates block-diagram image files
|
The blockdiag package generates block-diagram image files
|
||||||
|
from spec-text files.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n blockdiag-%{version}
|
%setup -q -n blockdiag-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
@@ -74,8 +78,6 @@ The blockdiag package generates block-diagram image files
|
|||||||
|
|
||||||
%check
|
%check
|
||||||
pushd src
|
pushd src
|
||||||
# this only test requires nose
|
|
||||||
rm blockdiag/tests/test_generate_diagram.py
|
|
||||||
# other disabled tests:
|
# other disabled tests:
|
||||||
# [ 9s] WARNING: Could not retrieve: http://blockdiag.com/favicon.ico
|
# [ 9s] WARNING: Could not retrieve: http://blockdiag.com/favicon.ico
|
||||||
# [ 9s] WARNING: Could not retrieve: http://upload.wikimedia.org/wikipedia/commons/9/9b/Scalable_Vector_Graphics_Circle2.svg
|
# [ 9s] WARNING: Could not retrieve: http://upload.wikimedia.org/wikipedia/commons/9/9b/Scalable_Vector_Graphics_Circle2.svg
|
||||||
|
Reference in New Issue
Block a user