Hello community, here is the log from the commit of package python-sphinxcontrib-actdiag for openSUSE:Factory checked in at 2020-02-26 15:04:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-sphinxcontrib-actdiag (Old) and /work/SRC/openSUSE:Factory/.python-sphinxcontrib-actdiag.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-sphinxcontrib-actdiag" Wed Feb 26 15:04:05 2020 rev:4 rq:779143 version:2.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-sphinxcontrib-actdiag/python-sphinxcontrib-actdiag.changes 2018-12-10 12:29:12.490474812 +0100 +++ /work/SRC/openSUSE:Factory/.python-sphinxcontrib-actdiag.new.26092/python-sphinxcontrib-actdiag.changes 2020-02-26 15:04:08.669083207 +0100 @@ -1,0 +2,13 @@ +Tue Feb 25 15:59:53 UTC 2020 - Thomas Bechtold <tbecht...@suse.com> + +- update to version 2.0.0 + * Bump v2.0.0 + * blockdiag.utils.compat has been no longer needed + * Fix flake8 violations + * Drop old Sphinx support + * Update CI settings + * Add .mypy_cache to gitignore + * Drop codes for old pythons + * Update package metadata + +---------------------------------------------------------------- Old: ---- sphinxcontrib-actdiag-0.8.5.tar.gz New: ---- sphinxcontrib-actdiag-2.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-sphinxcontrib-actdiag.spec ++++++ --- /var/tmp/diff_new_pack.TpMXGs/_old 2020-02-26 15:04:09.533084931 +0100 +++ /var/tmp/diff_new_pack.TpMXGs/_new 2020-02-26 15:04:09.533084931 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-sphinxcontrib-actdiag # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,11 +16,12 @@ # +%define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} # Test files missing gh#blockdiag/sphinxcontrib-actdiag#1 %bcond_with test Name: python-sphinxcontrib-actdiag -Version: 0.8.5 +Version: 2.0.0 Release: 0 Summary: Sphinx actdiag extension License: BSD-2-Clause ++++++ sphinxcontrib-actdiag-0.8.5.tar.gz -> sphinxcontrib-actdiag-2.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-actdiag-0.8.5/PKG-INFO new/sphinxcontrib-actdiag-2.0.0/PKG-INFO --- old/sphinxcontrib-actdiag-0.8.5/PKG-INFO 2015-12-01 16:02:00.000000000 +0100 +++ new/sphinxcontrib-actdiag-2.0.0/PKG-INFO 2019-12-08 17:37:04.974846000 +0100 @@ -1,8 +1,8 @@ Metadata-Version: 1.1 Name: sphinxcontrib-actdiag -Version: 0.8.5 +Version: 2.0.0 Summary: Sphinx "actdiag" extension -Home-page: http://github.com/blockdiag/sphinxcontrib-actdiag +Home-page: https://github.com/blockdiag/sphinxcontrib-actdiag Author: Takeshi KOMIYA Author-email: i.tkom...@gmail.com License: BSD @@ -53,12 +53,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-actdiag-0.8.5/setup.cfg new/sphinxcontrib-actdiag-2.0.0/setup.cfg --- old/sphinxcontrib-actdiag-0.8.5/setup.cfg 2015-12-01 16:02:00.000000000 +0100 +++ new/sphinxcontrib-actdiag-2.0.0/setup.cfg 2019-12-08 17:37:04.975345100 +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-actdiag-0.8.5/setup.py new/sphinxcontrib-actdiag-2.0.0/setup.py --- old/sphinxcontrib-actdiag-0.8.5/setup.py 2015-12-01 15:59:50.000000000 +0100 +++ new/sphinxcontrib-actdiag-2.0.0/setup.py 2019-12-08 17:36:58.000000000 +0100 @@ -2,12 +2,12 @@ from setuptools import setup, find_packages -requires = ['blockdiag>=1.5.0', 'actdiag>=0.5.3', 'Sphinx>=0.6'] +requires = ['blockdiag>=1.5.0', 'actdiag>=0.5.3', 'Sphinx>=2.0'] setup( name='sphinxcontrib-actdiag', - version='0.8.5', - url='http://github.com/blockdiag/sphinxcontrib-actdiag', + version='2.0.0', + url='https://github.com/blockdiag/sphinxcontrib-actdiag', license='BSD', author='Takeshi KOMIYA', author_email='i.tkom...@gmail.com', @@ -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-actdiag-0.8.5/sphinxcontrib/actdiag.py new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib/actdiag.py --- old/sphinxcontrib-actdiag-0.8.5/sphinxcontrib/actdiag.py 2015-11-30 16:18:11.000000000 +0100 +++ new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib/actdiag.py 2019-12-08 17:36:40.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 actdiag.utils.rst.nodes import actdiag.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 actdiag_node(actdiag.utils.rst.nodes.actdiag): 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 = ("actdiag 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.actdiag_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.actdiag_tex_image_format: - self.builder.warn('actdiag_tex_image_format is deprecated. Use actdiag_latex_image_format.') + logger.warning('actdiag_tex_image_format is deprecated. Use actdiag_latex_image_format.') # initialize fontmap global fontmap @@ -261,19 +263,19 @@ try: fontmappath = self.builder.config.actdiag_fontmap fontmap = FontMap(fontmappath) - except: + except Exception: fontmap = FontMap(None) try: fontpath = self.builder.config.actdiag_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.actdiag_debug: traceback.print_exc() - self.builder.warn('actdiag error: %s' % exc) + logger.warning('actdiag error: %s', exc) for node in doctree.traverse(actdiag_node): node.parent.remove(node) @@ -308,7 +310,7 @@ if self.builder.config.actdiag_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-actdiag-0.8.5/sphinxcontrib_actdiag.egg-info/PKG-INFO new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib_actdiag.egg-info/PKG-INFO --- old/sphinxcontrib-actdiag-0.8.5/sphinxcontrib_actdiag.egg-info/PKG-INFO 2015-12-01 16:01:23.000000000 +0100 +++ new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib_actdiag.egg-info/PKG-INFO 2019-12-08 17:37:04.000000000 +0100 @@ -1,8 +1,8 @@ Metadata-Version: 1.1 Name: sphinxcontrib-actdiag -Version: 0.8.5 +Version: 2.0.0 Summary: Sphinx "actdiag" extension -Home-page: http://github.com/blockdiag/sphinxcontrib-actdiag +Home-page: https://github.com/blockdiag/sphinxcontrib-actdiag Author: Takeshi KOMIYA Author-email: i.tkom...@gmail.com License: BSD @@ -53,12 +53,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-actdiag-0.8.5/sphinxcontrib_actdiag.egg-info/SOURCES.txt new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib_actdiag.egg-info/SOURCES.txt --- old/sphinxcontrib-actdiag-0.8.5/sphinxcontrib_actdiag.egg-info/SOURCES.txt 2015-12-01 16:01:24.000000000 +0100 +++ new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib_actdiag.egg-info/SOURCES.txt 2019-12-08 17:37:04.000000000 +0100 @@ -12,9 +12,4 @@ sphinxcontrib_actdiag.egg-info/namespace_packages.txt sphinxcontrib_actdiag.egg-info/not-zip-safe sphinxcontrib_actdiag.egg-info/requires.txt -sphinxcontrib_actdiag.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_actdiag.egg-info/top_level.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-actdiag-0.8.5/sphinxcontrib_actdiag.egg-info/requires.txt new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib_actdiag.egg-info/requires.txt --- old/sphinxcontrib-actdiag-0.8.5/sphinxcontrib_actdiag.egg-info/requires.txt 2015-12-01 16:01:23.000000000 +0100 +++ new/sphinxcontrib-actdiag-2.0.0/sphinxcontrib_actdiag.egg-info/requires.txt 2019-12-08 17:37:04.000000000 +0100 @@ -1,3 +1,3 @@ blockdiag>=1.5.0 actdiag>=0.5.3 -Sphinx>=0.6 +Sphinx>=2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sphinxcontrib-actdiag-0.8.5/tests/test_basic.py new/sphinxcontrib-actdiag-2.0.0/tests/test_basic.py --- old/sphinxcontrib-actdiag-0.8.5/tests/test_basic.py 2015-11-30 16:18:11.000000000 +0100 +++ new/sphinxcontrib-actdiag-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-actdiag-0.8.5/tests/test_errors.py new/sphinxcontrib-actdiag-2.0.0/tests/test_errors.py --- old/sphinxcontrib-actdiag-0.8.5/tests/test_errors.py 2015-11-30 16:18:11.000000000 +0100 +++ new/sphinxcontrib-actdiag-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 TestSphinxcontribActdiagErrors(unittest.TestCase): - @with_app(srcdir='tests/docs/basic', write_docstring=True) - def test_parse_error(self, app, status, warning): - """ - .. actdiag:: - - { A -> B; - """ - app.builder.build_all() - self.assertIn('got unexpected token:', warning.getvalue()) - - @with_app(srcdir='tests/docs/basic', confoverrides=dict(actdiag_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(actdiag_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("actdiag.utils.rst.nodes.actdiag.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.actdiag.actdiag.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-actdiag-0.8.5/tests/test_html.py new/sphinxcontrib-actdiag-2.0.0/tests/test_html.py --- old/sphinxcontrib-actdiag-0.8.5/tests/test_html.py 2015-11-30 16:18:11.000000000 +0100 +++ new/sphinxcontrib-actdiag-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={ - 'actdiag_html_image_format': 'SVG', - }) - - -class TestSphinxcontribActdiagHTML(unittest.TestCase): - @with_png_app - def test_build_png_image(self, app, status, warning): - """ - .. actdiag:: - - 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): - """ - .. actdiag:: - - 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): - """ - .. actdiag:: - :width: 128 - - 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="140.0" src="\\1" width="128.0" /></a></div>')) - - @with_png_app - def test_height_option_on_png(self, app, status, warning): - """ - .. actdiag:: - :height: 140 - - 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="140.0" src="\\1" width="128.0" /></a></div>')) - - @with_png_app - def test_width_option_and_height_option_on_png(self, app, status, warning): - """ - .. actdiag:: - :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): - """ - .. actdiag:: - :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="70.0" src="\\1" width="64.0" /></a></div>')) - - @with_png_app - def test_width_option_and_scale_option_on_png(self, app, status, warning): - """ - .. actdiag:: - :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="7.65625" src="\\1" width="7.0" /></a></div>')) - - @with_png_app - def test_align_option_on_png(self, app, status, warning): - """ - .. actdiag:: - :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): - """ - .. actdiag:: - :align: center - :width: 128 - - 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="140.0" src="\\1" width="128.0" /></a></div>')) - - @with_png_app - def test_name_option_on_png(self, app, status, warning): - """ - .. actdiag:: - :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): - """ - .. actdiag:: - :name: target - :width: 128 - - 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="140.0" id="target" src="\\1" width="128.0" /></a></div>')) - - @with_png_app - def test_href_and_scale_option_on_png(self, app, status, warning): - """ - .. actdiag:: - :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,60.0,96.0,80.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 - --------- - - .. actdiag:: - - 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,120.0,192.0,160.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 - --------- - - .. actdiag:: - - 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,120.0,192.0,160.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): - """ - .. actdiag:: - - 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): - """ - .. actdiag:: - - 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): - """ - .. actdiag:: - :width: 128 - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'index.html').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '<div><svg height="140.0" viewBox="0 0 256 280" width="128.0" .*?>') - - @with_svg_app - def test_height_option_on_svg(self, app, status, warning): - """ - .. actdiag:: - :height: 140 - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'index.html').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '<div><svg height="140.0" viewBox="0 0 256 280" width="128.0" .*?>') - - @with_svg_app - def test_width_option_and_height_option_on_svg(self, app, status, warning): - """ - .. actdiag:: - :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 256 280" width="100.0" .*?>') - - @with_svg_app - def test_scale_option_on_svg(self, app, status, warning): - """ - .. actdiag:: - :scale: 25% - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'index.html').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '<div><svg height="70.0" viewBox="0 0 256 280" width="64.0" .*?>') - - @with_svg_app - def test_width_option_and_scale_option_on_svg(self, app, status, warning): - """ - .. actdiag:: - :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="7.65625" viewBox="0 0 256 280" width="7.0" .*?>') - - @with_svg_app - def test_align_option_on_svg(self, app, status, warning): - """ - .. actdiag:: - :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): - """ - .. actdiag:: - :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 - --------- - - .. actdiag:: - - 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 - --------- - - .. actdiag:: - - 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): - """ - .. actdiag:: - - 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). - - .. actdiag:: - - plugin autoclass; - class foo [color = red]; - A_foo; - - .. actdiag:: - - 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-actdiag-0.8.5/tests/test_latex.py new/sphinxcontrib-actdiag-2.0.0/tests/test_latex.py --- old/sphinxcontrib-actdiag-0.8.5/tests/test_latex.py 2015-11-30 16:18:11.000000000 +0100 +++ new/sphinxcontrib-actdiag-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 - -actdiag_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={ - 'latex_documents': [('index', 'test.tex', u(''), u('test'), 'manual')], - 'actdiag_latex_image_format': 'PDF', - 'actdiag_fontpath': actdiag_fontpath, - }) -with_oldpdf_app = with_app(srcdir='tests/docs/basic', - buildername='latex', - write_docstring=True, - confoverrides={ - 'latex_documents': [('index', 'test.tex', u(''), u('test'), 'manual')], - 'actdiag_tex_image_format': 'PDF', - 'actdiag_fontpath': actdiag_fontpath, - }) - - -class TestSphinxcontribActdiagLatex(unittest.TestCase): - @with_png_app - def test_build_png_image(self, app, status, warning): - """ - .. actdiag:: - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '\\\\includegraphics{actdiag-.*?.png}') - - @unittest.skipUnless(os.path.exists(actdiag_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): - """ - .. actdiag:: - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '\\\\includegraphics{actdiag-.*?.pdf}') - - @unittest.skipUnless(os.path.exists(actdiag_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): - """ - .. actdiag:: - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '\\\\includegraphics{actdiag-.*?.pdf}') - - @with_png_app - def test_width_option(self, app, status, warning): - """ - .. actdiag:: - :width: 3cm - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '\\\\includegraphics\\[width=3cm\\]{actdiag-.*?.png}') - - @with_png_app - def test_height_option(self, app, status, warning): - """ - .. actdiag:: - :height: 4cm - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '\\\\includegraphics\\[height=4cm\\]{actdiag-.*?.png}') - - @with_png_app - def test_scale_option(self, app, status, warning): - """ - .. actdiag:: - :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{actdiag-.*?.png}}') - - @with_png_app - def test_align_option_left(self, app, status, warning): - """ - .. actdiag:: - :align: left - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '{\\\\includegraphics{actdiag-.*?.png}\\\\hfill}') - - @with_png_app - def test_align_option_center(self, app, status, warning): - """ - .. actdiag:: - :align: center - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '{\\\\hfill\\\\includegraphics{actdiag-.*?.png}\\\\hfill}') - - @with_png_app - def test_align_option_right(self, app, status, warning): - """ - .. actdiag:: - :align: right - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '{\\\\hfill\\\\includegraphics{actdiag-.*?.png}}') - - @with_png_app - def test_caption_option(self, app, status, warning): - """ - .. actdiag:: - :caption: hello world - - A -> B; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '\\\\includegraphics{actdiag-.*?.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): - """ - .. actdiag:: - :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{actdiag-.*?.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): - """ - .. actdiag:: - - A -> B; - A [href=":ref:`target`"]; - """ - app.builder.build_all() - source = (app.outdir / 'test.tex').read_text(encoding='utf-8') - self.assertRegexpMatches(source, '\\\\includegraphics{actdiag-.*?.png}')