Hello community,
here is the log from the commit of package python-sphinxcontrib-seqdiag for
openSUSE:Factory checked in at 2020-02-25 16:06:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sphinxcontrib-seqdiag (Old)
and /work/SRC/openSUSE:Factory/.python-sphinxcontrib-seqdiag.new.26092
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-sphinxcontrib-seqdiag"
Tue Feb 25 16:06:19 2020 rev:4 rq:778945 version:2.0.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-sphinxcontrib-seqdiag/python-sphinxcontrib-seqdiag.changes
2020-01-09 22:52:49.130776070 +0100
+++
/work/SRC/openSUSE:Factory/.python-sphinxcontrib-seqdiag.new.26092/python-sphinxcontrib-seqdiag.changes
2020-02-25 16:06:51.140571589 +0100
@@ -1,0 +2,14 @@
+Tue Feb 25 06:26:01 UTC 2020 - Thomas Bechtold <[email protected]>
+
+- update to version 2.0.0:
+ * Update CI settings
+ * blockdiag.utils.compat has been no longer needed
+ * Update package metadata
+ * Drop old Sphinx support
+ * Drop codes for old pythons
+ * Add .mypy_cache to gitignore
+ * Bump v2.0.0
+ * Fix flake8 violations
+- Stop building python2 version. No longer supported upstream
+
+-------------------------------------------------------------------
Old:
----
sphinxcontrib-seqdiag-0.8.5.tar.gz
New:
----
sphinxcontrib-seqdiag-2.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-sphinxcontrib-seqdiag.spec ++++++
--- /var/tmp/diff_new_pack.h4mbDe/_old 2020-02-25 16:06:52.368574158 +0100
+++ /var/tmp/diff_new_pack.h4mbDe/_new 2020-02-25 16:06:52.372574167 +0100
@@ -16,10 +16,11 @@
#
+%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_with test
Name: python-sphinxcontrib-seqdiag
-Version: 0.8.5
+Version: 2.0.0
Release: 0
Summary: Sphinx "seqdiag" extension
License: BSD-2-Clause
++++++ sphinxcontrib-seqdiag-0.8.5.tar.gz -> sphinxcontrib-seqdiag-2.0.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/PKG-INFO
new/sphinxcontrib-seqdiag-2.0.0/PKG-INFO
--- old/sphinxcontrib-seqdiag-0.8.5/PKG-INFO 2015-12-01 15:59:24.000000000
+0100
+++ new/sphinxcontrib-seqdiag-2.0.0/PKG-INFO 2019-12-08 12:21:44.246765100
+0100
@@ -1,8 +1,8 @@
Metadata-Version: 1.1
Name: sphinxcontrib-seqdiag
-Version: 0.8.5
+Version: 2.0.0
Summary: Sphinx "seqdiag" extension
-Home-page: http://github.com/blockdiag/sphinxcontrib-seqdiag
+Home-page: https://github.com/blockdiag/sphinxcontrib-seqdiag
Author: Takeshi KOMIYA
Author-email: [email protected]
License: BSD
@@ -46,12 +46,12 @@
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Documentation
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Utilities
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/setup.cfg
new/sphinxcontrib-seqdiag-2.0.0/setup.cfg
--- old/sphinxcontrib-seqdiag-0.8.5/setup.cfg 2015-12-01 15:59:24.000000000
+0100
+++ new/sphinxcontrib-seqdiag-2.0.0/setup.cfg 2019-12-08 12:21:44.247231000
+0100
@@ -1,7 +1,6 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
[build]
build-base = _build
@@ -21,6 +20,6 @@
[flake8]
max-line-length = 120
-ignore = _
+ignore = W504
exclude = tests/docs/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/setup.py
new/sphinxcontrib-seqdiag-2.0.0/setup.py
--- old/sphinxcontrib-seqdiag-0.8.5/setup.py 2015-12-01 15:59:12.000000000
+0100
+++ new/sphinxcontrib-seqdiag-2.0.0/setup.py 2019-12-08 12:21:21.000000000
+0100
@@ -2,12 +2,12 @@
from setuptools import setup, find_packages
-requires = ['blockdiag>=1.5.0', 'seqdiag>=0.9.3', 'Sphinx>=0.6']
+requires = ['blockdiag>=1.5.0', 'seqdiag>=0.9.3', 'Sphinx>=2.0']
setup(
name='sphinxcontrib-seqdiag',
- version='0.8.5',
- url='http://github.com/blockdiag/sphinxcontrib-seqdiag',
+ version='2.0.0',
+ url='https://github.com/blockdiag/sphinxcontrib-seqdiag',
license='BSD',
author='Takeshi KOMIYA',
author_email='[email protected]',
@@ -23,12 +23,12 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.6',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.2',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Topic :: Documentation',
'Topic :: Documentation :: Sphinx',
'Topic :: Utilities',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib/seqdiag.py
new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib/seqdiag.py
--- old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib/seqdiag.py 2015-11-30
16:18:01.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib/seqdiag.py 2019-12-08
12:21:07.000000000 +0100
@@ -20,18 +20,20 @@
from collections import namedtuple
from docutils import nodes
from sphinx import addnodes
+from sphinx.util import logging
from sphinx.util.osutil import ensuredir
import seqdiag.utils.rst.nodes
import seqdiag.utils.rst.directives
from blockdiag.utils.bootstrap import detectfont, Application
-from blockdiag.utils.compat import u, string_types
from blockdiag.utils.fontmap import FontMap
from blockdiag.utils.rst.directives import with_blockdiag
# fontconfig; it will be initialized on `builder-inited` event.
fontmap = None
+logger = logging.getLogger(__name__)
+
class seqdiag_node(seqdiag.utils.rst.nodes.seqdiag):
def to_drawer(self, image_format, builder, **kwargs):
@@ -92,7 +94,7 @@
if href is None:
return None
- pattern = re.compile(u("^:ref:`(.+?)`"), re.UNICODE)
+ pattern = re.compile("^:ref:`(.+?)`", re.UNICODE)
matched = pattern.search(href)
if matched is None:
return href
@@ -110,7 +112,7 @@
else:
return xref['refuri']
else:
- builder.warn('undefined label: %s' % refid)
+ logger.warning('undefined label: %s', refid)
return None
@@ -212,13 +214,13 @@
msg = ("seqdiag error: UnicodeEncodeError caught "
"(check your font settings)")
- self.builder.warn(msg)
+ logger.warning(msg)
raise nodes.SkipNode
except Exception as exc:
if self.builder.config.seqdiag_debug:
traceback.print_exc()
- self.builder.warn('dot code %r: %s' % (node['code'], str(exc)))
+ logger.warning('dot code %r: %s', node['code'], exc)
raise nodes.SkipNode
@@ -253,7 +255,7 @@
def on_builder_inited(self):
# show deprecated message
if self.builder.config.seqdiag_tex_image_format:
- self.builder.warn('seqdiag_tex_image_format is deprecated. Use
seqdiag_latex_image_format.')
+ logger.warning('seqdiag_tex_image_format is deprecated. Use
seqdiag_latex_image_format.')
# initialize fontmap
global fontmap
@@ -261,19 +263,19 @@
try:
fontmappath = self.builder.config.seqdiag_fontmap
fontmap = FontMap(fontmappath)
- except:
+ except Exception:
fontmap = FontMap(None)
try:
fontpath = self.builder.config.seqdiag_fontpath
- if isinstance(fontpath, string_types):
+ if isinstance(fontpath, str):
fontpath = [fontpath]
if fontpath:
config = namedtuple('Config', 'font')(fontpath)
fontpath = detectfont(config)
fontmap.set_default_font(fontpath)
- except:
+ except Exception:
pass
@@ -287,7 +289,7 @@
if self.builder.config.seqdiag_debug:
traceback.print_exc()
- self.builder.warn('seqdiag error: %s' % exc)
+ logger.warning('seqdiag error: %s', exc)
for node in doctree.traverse(seqdiag_node):
node.parent.remove(node)
@@ -308,7 +310,7 @@
if self.builder.config.seqdiag_debug:
traceback.print_exc()
- self.builder.warn('dot code %r: %s' % (node['code'], str(exc)))
+ logger.warning('dot code %r: %s', node['code'], exc)
node.parent.remove(node)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib_seqdiag.egg-info/PKG-INFO
new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib_seqdiag.egg-info/PKG-INFO
--- old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib_seqdiag.egg-info/PKG-INFO
2015-12-01 15:59:15.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib_seqdiag.egg-info/PKG-INFO
2019-12-08 12:21:44.000000000 +0100
@@ -1,8 +1,8 @@
Metadata-Version: 1.1
Name: sphinxcontrib-seqdiag
-Version: 0.8.5
+Version: 2.0.0
Summary: Sphinx "seqdiag" extension
-Home-page: http://github.com/blockdiag/sphinxcontrib-seqdiag
+Home-page: https://github.com/blockdiag/sphinxcontrib-seqdiag
Author: Takeshi KOMIYA
Author-email: [email protected]
License: BSD
@@ -46,12 +46,12 @@
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Documentation
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Utilities
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib_seqdiag.egg-info/SOURCES.txt
new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib_seqdiag.egg-info/SOURCES.txt
--- old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib_seqdiag.egg-info/SOURCES.txt
2015-12-01 15:59:16.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib_seqdiag.egg-info/SOURCES.txt
2019-12-08 12:21:44.000000000 +0100
@@ -12,9 +12,4 @@
sphinxcontrib_seqdiag.egg-info/namespace_packages.txt
sphinxcontrib_seqdiag.egg-info/not-zip-safe
sphinxcontrib_seqdiag.egg-info/requires.txt
-sphinxcontrib_seqdiag.egg-info/top_level.txt
-tests/__init__.py
-tests/test_basic.py
-tests/test_errors.py
-tests/test_html.py
-tests/test_latex.py
\ No newline at end of file
+sphinxcontrib_seqdiag.egg-info/top_level.txt
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib_seqdiag.egg-info/requires.txt
new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib_seqdiag.egg-info/requires.txt
--- old/sphinxcontrib-seqdiag-0.8.5/sphinxcontrib_seqdiag.egg-info/requires.txt
2015-12-01 15:59:15.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/sphinxcontrib_seqdiag.egg-info/requires.txt
2019-12-08 12:21:44.000000000 +0100
@@ -1,3 +1,3 @@
blockdiag>=1.5.0
seqdiag>=0.9.3
-Sphinx>=0.6
+Sphinx>=2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/tests/test_basic.py
new/sphinxcontrib-seqdiag-2.0.0/tests/test_basic.py
--- old/sphinxcontrib-seqdiag-0.8.5/tests/test_basic.py 2015-11-30
16:18:01.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/tests/test_basic.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,28 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from sphinx_testing import with_app
-
-
-@with_app(buildername='html', srcdir='tests/docs/basic/')
-def test_build_html(app, status, warning):
- app.builder.build_all()
-
-
-@with_app(buildername='singlehtml', srcdir='tests/docs/basic/')
-def test_build_singlehtml(app, status, warning):
- app.builder.build_all()
-
-
-@with_app(buildername='latex', srcdir='tests/docs/basic/')
-def test_build_latex(app, status, warning):
- app.builder.build_all()
-
-
-@with_app(buildername='epub', srcdir='tests/docs/basic/')
-def test_build_epub(app, status, warning):
- app.builder.build_all()
-
-
-@with_app(buildername='json', srcdir='tests/docs/basic/')
-def test_build_json(app, status, warning):
- app.builder.build_all()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/tests/test_errors.py
new/sphinxcontrib-seqdiag-2.0.0/tests/test_errors.py
--- old/sphinxcontrib-seqdiag-0.8.5/tests/test_errors.py 2015-11-30
16:18:01.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/tests/test_errors.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from mock import patch
-from sphinx_testing import with_app
-from blockdiag.utils.compat import u
-
-import sys
-if sys.version_info < (2, 7):
- import unittest2 as unittest
-else:
- import unittest
-
-
-class TestSphinxcontribSeqdiagErrors(unittest.TestCase):
- @with_app(srcdir='tests/docs/basic', write_docstring=True)
- def test_parse_error(self, app, status, warning):
- """
- .. seqdiag::
-
- { A -> B;
- """
- app.builder.build_all()
- self.assertIn('got unexpected token:', warning.getvalue())
-
- @with_app(srcdir='tests/docs/basic',
confoverrides=dict(seqdiag_html_image_format='JPG'))
- def test_unknown_format_error(self, app, status, warning):
- app.builder.build_all()
- self.assertIn('unknown format: JPG', warning.getvalue())
-
- @with_app(srcdir='tests/docs/basic',
confoverrides=dict(seqdiag_html_image_format='PDF'))
- def test_reportlab_not_found_error(self, app, status, warning):
- try:
- # unload reportlab and make loading it impossible
- sys.modules.pop('reportlab', None)
- path = sys.path
- sys.path = []
-
- app.builder.build_all()
- self.assertIn('Could not output PDF format. Install reportlab.',
- warning.getvalue())
- finally:
- sys.path = path
-
- @with_app(srcdir='tests/docs/basic')
- @patch("seqdiag.utils.rst.nodes.seqdiag.processor.drawer.DiagramDraw")
- def test_rendering_error(self, app, status, warning, DiagramDraw):
- DiagramDraw.side_effect = RuntimeError("UNKNOWN ERROR!")
- app.builder.build_all()
- self.assertIn('UNKNOWN ERROR!', warning.getvalue())
-
- @with_app(srcdir='tests/docs/basic')
- @patch("sphinxcontrib.seqdiag.seqdiag.drawer.DiagramDraw.draw")
- def test_font_settings_error(self, app, status, warning, draw):
- draw.side_effect = UnicodeEncodeError("", u(""), 0, 0, "")
- app.builder.build_all()
- self.assertIn('UnicodeEncodeError caught (check your font settings)',
- warning.getvalue())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/tests/test_html.py
new/sphinxcontrib-seqdiag-2.0.0/tests/test_html.py
--- old/sphinxcontrib-seqdiag-0.8.5/tests/test_html.py 2015-11-30
16:18:01.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/tests/test_html.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,398 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from sphinx_testing import with_app
-
-import sys
-if sys.version_info < (2, 7):
- import unittest2 as unittest
-else:
- import unittest
-
-with_png_app = with_app(srcdir='tests/docs/basic',
- buildername='html',
- write_docstring=True)
-with_svg_app = with_app(srcdir='tests/docs/basic',
- buildername='html',
- write_docstring=True,
- confoverrides={
- 'seqdiag_html_image_format': 'SVG',
- })
-
-
-class TestSphinxcontribSeqdiagHTML(unittest.TestCase):
- @with_png_app
- def test_build_png_image(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><img .*? src="_images/.*?.png"
.*?/></div>')
-
- @with_app(srcdir='tests/docs/subdir', buildername='html',
write_docstring=True)
- def test_build_png_image_in_subdir(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'subdir' /
'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><img .*?
src="\.\./_images/.*?.png" .*?/></div>')
-
- @with_png_app
- def test_width_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :width: 224
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><a class="reference internal
image-reference" href="(.*?.png)">'
- '<img height="97.0" src="\\1"
width="224.0" /></a></div>'))
-
- @with_png_app
- def test_height_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :height: 97
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><a class="reference internal
image-reference" href="(.*?.png)">'
- '<img height="97.0" src="\\1"
width="224.0" /></a></div>'))
-
- @with_png_app
- def test_width_option_and_height_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :width: 100
- :height: 200
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><a class="reference internal
image-reference" href="(.*?.png)">'
- '<img height="200.0" src="\\1"
width="100.0" /></a></div>'))
-
- @with_png_app
- def test_scale_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :scale: 25%
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><a class="reference internal
image-reference" href="(.*?.png)">'
- '<img height="48.5" src="\\1"
width="112.0" /></a></div>'))
-
- @with_png_app
- def test_width_option_and_scale_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :width: 28
- :scale: 25%
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><a class="reference internal
image-reference" href="(.*?.png)">'
- '<img height="3.03125" src="\\1"
width="7.0" /></a></div>'))
-
- @with_png_app
- def test_align_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :align: center
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div align="center"
class="align-center"><img .*? /></div>')
-
- @with_png_app
- def test_align_option_and_width_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :align: center
- :width: 224
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div align="center"
class="align-center">'
- '<a class="reference internal
image-reference" href="(.*?.png)">'
- '<img height="97.0" src="\\1"
width="224.0" /></a></div>'))
-
- @with_png_app
- def test_name_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :name: target
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><img .*? id="target" src=".*?"
.*? /></div>')
-
- @with_png_app
- def test_name_option_and_width_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :name: target
- :width: 224
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><a class="reference internal
image-reference" href="(.*?.png)">'
- '<img height="97.0" id="target"
src="\\1" width="224.0" /></a></div>'))
-
- @with_png_app
- def test_href_and_scale_option_on_png(self, app, status, warning):
- """
- .. seqdiag::
- :scale: 50%
-
- A -> B;
- A [href = 'http://blockdiag.com/'];
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><a class="reference internal
image-reference" href="(.*?.png)">'
- '<map name="(map_\d+)">'
- '<area shape="rect"
coords="32.0,20.0,96.0,40.0" '
- 'href="http://blockdiag.com/"></map>'
- '<img .*? src="\\1" usemap="#\\2"
.*?/></a></div>'))
-
- @with_png_app
- def test_reftarget_in_href_on_png1(self, app, status, warning):
- """
- .. _target:
-
- heading2
- ---------
-
- .. seqdiag::
-
- A -> B;
- A [href = ':ref:`target`'];
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><map name="(map_\d+)">'
- '<area shape="rect"
coords="64.0,40.0,192.0,80.0" href="#target"></map>'
- '<img .*? src=".*?.png"
usemap="#\\1" .*?/></div>'))
-
- @with_png_app
- def test_reftarget_in_href_on_png2(self, app, status, warning):
- """
- .. _hello world:
-
- heading2
- ---------
-
- .. seqdiag::
-
- A -> B;
- A [href = ':ref:`hello world`'];
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><map name="(map_\d+)">'
- '<area shape="rect"
coords="64.0,40.0,192.0,80.0" href="#hello-world">'
- '</map><img .*? src=".*?.png"
usemap="#\\1" .*?/></div>'))
-
- @with_png_app
- def test_missing_reftarget_in_href_on_png(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- A [href = ':ref:`unknown_target`'];
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, ('<div><img .*? src=".*?.png"
.*?/></div>'))
- self.assertIn('undefined label: unknown_target', warning.getvalue())
-
- @with_svg_app
- def test_build_svg_image(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><svg .*?>')
-
- @with_svg_app
- def test_width_option_on_svg(self, app, status, warning):
- """
- .. seqdiag::
- :width: 224
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><svg height="97.0" viewBox="0 0
448 194" width="224.0" .*?>')
-
- @with_svg_app
- def test_height_option_on_svg(self, app, status, warning):
- """
- .. seqdiag::
- :height: 97
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><svg height="97.0" viewBox="0 0
448 194" width="224.0" .*?>')
-
- @with_svg_app
- def test_width_option_and_height_option_on_svg(self, app, status, warning):
- """
- .. seqdiag::
- :width: 100
- :height: 200
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><svg height="200.0" viewBox="0
0 448 194" width="100.0" .*?>')
-
- @with_svg_app
- def test_scale_option_on_svg(self, app, status, warning):
- """
- .. seqdiag::
- :scale: 25%
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><svg height="48.5" viewBox="0 0
448 194" width="112.0" .*?>')
-
- @with_svg_app
- def test_width_option_and_scale_option_on_svg(self, app, status, warning):
- """
- .. seqdiag::
- :width: 28
- :scale: 25%
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><svg height="3.03125"
viewBox="0 0 448 194" width="7.0" .*?>')
-
- @with_svg_app
- def test_align_option_on_svg(self, app, status, warning):
- """
- .. seqdiag::
- :align: center
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div align="center"
class="align-center"><svg .*?>')
-
- @with_svg_app
- def test_name_option_on_svg(self, app, status, warning):
- """
- .. seqdiag::
- :name: target
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<div><span id="target"></span><svg
.*?>')
-
- @with_svg_app
- def test_reftarget_in_href_on_svg1(self, app, status, warning):
- """
- .. _target:
-
- heading2
- ---------
-
- .. seqdiag::
-
- A -> B;
- A [href = ':ref:`target`'];
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<a xlink:href="#target">\\n\\s*<rect
.*?>\\n\\s*</a>')
-
- @with_svg_app
- def test_reftarget_in_href_on_svg2(self, app, status, warning):
- """
- .. _hello world:
-
- heading2
- ---------
-
- .. seqdiag::
-
- A -> B;
- A [href = ':ref:`hello world`'];
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<a
xlink:href="#hello-world">\\n\\s*<rect .*?>\\n\\s*</a>')
-
- @with_svg_app
- def test_missing_reftarget_in_href_on_svg(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- A [href = ':ref:`unknown_target`'];
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- if sys.version_info < (3, 0):
- self.assertNotRegexpMatches(source, '<a
xlink:href="#hello-world">\\n\\s*<rect .*?>\\n\\s*</a>')
- else:
- self.assertNotRegex(source, '<a
xlink:href="#hello-world">\\n\\s*<rect .*?>\\n\\s*</a>')
- self.assertIn('undefined label: unknown_target', warning.getvalue())
-
- @with_svg_app
- def test_autoclass_should_not_effect_to_other_diagram(self, app, status,
warning):
- """
- This testcase checks that autoclass plugin is unloaded correctly (and
it does not effect to other diagram).
-
- .. seqdiag::
-
- plugin autoclass;
- class foo [color = red];
- A_foo;
-
- .. seqdiag::
-
- class foo [color = red];
- A_foo;
- """
- app.builder.build_all()
- source = (app.outdir / 'index.html').read_text(encoding='utf-8')
- self.assertRegexpMatches(source, '<text[^>]+>A_foo</text>') # 2nd
diagram has a node labeled 'A_foo'.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sphinxcontrib-seqdiag-0.8.5/tests/test_latex.py
new/sphinxcontrib-seqdiag-2.0.0/tests/test_latex.py
--- old/sphinxcontrib-seqdiag-0.8.5/tests/test_latex.py 2015-11-30
16:18:01.000000000 +0100
+++ new/sphinxcontrib-seqdiag-2.0.0/tests/test_latex.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,192 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import os
-import re
-from sphinx_testing import with_app
-from blockdiag.utils.compat import u
-
-import sys
-if sys.version_info < (2, 7):
- import unittest2 as unittest
-else:
- import unittest
-
-seqdiag_fontpath = '/usr/share/fonts/truetype/ipafont/ipagp.ttf'
-with_png_app = with_app(srcdir='tests/docs/basic',
- buildername='latex',
- write_docstring=True,
- confoverrides={
- 'latex_documents': [('index', 'test.tex', u(''),
u('test'), 'manual')],
- })
-with_pdf_app = with_app(srcdir='tests/docs/basic',
- buildername='latex',
- write_docstring=True,
- confoverrides={
- 'seqdiag_latex_image_format': 'PDF',
- 'latex_documents': [('index', 'test.tex', u(''),
u('test'), 'manual')],
- 'seqdiag_fontpath': seqdiag_fontpath,
- })
-with_oldpdf_app = with_app(srcdir='tests/docs/basic',
- buildername='latex',
- write_docstring=True,
- confoverrides={
- 'seqdiag_tex_image_format': 'PDF',
- 'latex_documents': [('index', 'test.tex',
u(''), u('test'), 'manual')],
- 'seqdiag_fontpath': seqdiag_fontpath,
- })
-
-
-class TestSphinxcontribSeqdiagLatex(unittest.TestCase):
- @with_png_app
- def test_build_png_image(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics{seqdiag-.*?.png}')
-
- @unittest.skipUnless(os.path.exists(seqdiag_fontpath), "TrueType font not
found")
- @unittest.skipIf(sys.version_info[:2] == (3, 2), "reportlab does not
support python 3.2")
- @with_pdf_app
- def test_build_pdf_image1(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics{seqdiag-.*?.pdf}')
-
- @unittest.skipUnless(os.path.exists(seqdiag_fontpath), "TrueType font not
found")
- @unittest.skipIf(sys.version_info[:2] == (3, 2), "reportlab does not
support python 3.2")
- @with_oldpdf_app
- def test_build_pdf_image2(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics{seqdiag-.*?.pdf}')
-
- @with_png_app
- def test_width_option(self, app, status, warning):
- """
- .. seqdiag::
- :width: 3cm
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics\\[width=3cm\\]{seqdiag-.*?.png}')
-
- @with_png_app
- def test_height_option(self, app, status, warning):
- """
- .. seqdiag::
- :height: 4cm
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics\\[height=4cm\\]{seqdiag-.*?.png}')
-
- @with_png_app
- def test_scale_option(self, app, status, warning):
- """
- .. seqdiag::
- :scale: 50%
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\scalebox{0.500000}{\\\\includegraphics{seqdiag-.*?.png}}')
-
- @with_png_app
- def test_align_option_left(self, app, status, warning):
- """
- .. seqdiag::
- :align: left
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'{\\\\includegraphics{seqdiag-.*?.png}\\\\hfill}')
-
- @with_png_app
- def test_align_option_center(self, app, status, warning):
- """
- .. seqdiag::
- :align: center
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'{\\\\hfill\\\\includegraphics{seqdiag-.*?.png}\\\\hfill}')
-
- @with_png_app
- def test_align_option_right(self, app, status, warning):
- """
- .. seqdiag::
- :align: right
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'{\\\\hfill\\\\includegraphics{seqdiag-.*?.png}}')
-
- @with_png_app
- def test_caption_option(self, app, status, warning):
- """
- .. seqdiag::
- :caption: hello world
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics{seqdiag-.*?.png}')
-
- figure = re.compile('\\\\begin{figure}\\[htbp\\]\r?\n\\\\centering.*?'
- '\\\\caption{hello world}\\\\end{figure}',
re.DOTALL)
- self.assertRegexpMatches(source, figure)
-
- @with_png_app
- def test_caption_option_and_align_option(self, app, status, warning):
- """
- .. seqdiag::
- :align: left
- :caption: hello world
-
- A -> B;
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics{seqdiag-.*?.png}')
-
- figure =
re.compile('\\\\begin{figure}\\[htbp\\]\\\\begin{flushleft}.*?'
- '\\\\caption{hello
world}\\\\end{flushleft}\\\\end{figure}', re.DOTALL)
- self.assertRegexpMatches(source, figure)
-
- @with_png_app
- def test_href(self, app, status, warning):
- """
- .. seqdiag::
-
- A -> B;
- A [href=":ref:`target`"];
- """
- app.builder.build_all()
- source = (app.outdir / 'test.tex').read_text(encoding='utf-8')
- self.assertRegexpMatches(source,
'\\\\includegraphics{seqdiag-.*?.png}')