Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-sphinxcontrib-plantuml for 
openSUSE:Factory checked in at 2022-10-11 18:02:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sphinxcontrib-plantuml (Old)
 and      /work/SRC/openSUSE:Factory/.python-sphinxcontrib-plantuml.new.2275 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-sphinxcontrib-plantuml"

Tue Oct 11 18:02:25 2022 rev:5 rq:1009256 version:0.24

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-sphinxcontrib-plantuml/python-sphinxcontrib-plantuml.changes
      2021-06-29 22:44:16.890954554 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-sphinxcontrib-plantuml.new.2275/python-sphinxcontrib-plantuml.changes
    2022-10-11 18:04:59.986031456 +0200
@@ -1,0 +2,11 @@
+Fri Oct  7 16:27:47 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to version to 0.24
+  * allow whitespace in arguments (fixes #66)
+
+- Update to version to 0.23
+  * work around native/non-native sphinxcontrib package conflicts on github CI
+  * Add adjustbox to change width, height and scale
+  * Initial attempt to add TikZ
+
+-------------------------------------------------------------------

Old:
----
  sphinxcontrib-plantuml-0.21.tar.gz

New:
----
  sphinxcontrib-plantuml-0.24.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-sphinxcontrib-plantuml.spec ++++++
--- /var/tmp/diff_new_pack.xjGk13/_old  2022-10-11 18:05:00.422032161 +0200
+++ /var/tmp/diff_new_pack.xjGk13/_new  2022-10-11 18:05:00.426032167 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-sphinxcontrib-plantuml
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 %{?!python_module:%define python_module() python3-%{**}}
 
 Name:           python-sphinxcontrib-plantuml
-Version:        0.21
+Version:        0.24
 Release:        0
 Summary:        Sphinx API for Web Apps
 License:        BSD-2-Clause

++++++ sphinxcontrib-plantuml-0.21.tar.gz -> sphinxcontrib-plantuml-0.24.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/.github/workflows/python-package.yml 
new/plantuml-0.24/.github/workflows/python-package.yml
--- old/plantuml-0.21/.github/workflows/python-package.yml      1970-01-01 
01:00:00.000000000 +0100
+++ new/plantuml-0.24/.github/workflows/python-package.yml      2022-07-05 
13:55:37.000000000 +0200
@@ -0,0 +1,52 @@
+# This workflow will install Python dependencies, run tests and lint with a 
variety of Python versions
+# For more information see: 
https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Python package
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: [3.7, 3.8, 3.9]
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        # also install epstopdf, latexmk, pdflatex, etc.
+        sudo apt install latexmk plantuml texlive texlive-font-utils 
texlive-latex-extra
+        python -m pip install --upgrade pip
+        python -m pip install Pillow flake8 pytest sphinx
+        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+    - name: Work around sphinxcontrib namespace package conflicts
+      run: |
+        # if we had sphinxcontrib/ directory with no __init__.py in the 
sys.path,
+        # importing non-native namespace package would fail even if our local
+        # module should precede the native namespace package.
+        # 
https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages
+        python -c 'import sphinxcontrib.plantuml' || rm -f 
sphinxcontrib/__init__.py*
+    - name: Lint with flake8
+      run: |
+        # stop the build if there are Python syntax errors or undefined names
+        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+        flake8 . --count --max-complexity=10 --statistics
+    - name: Test with pytest
+      run: |
+        python -m pytest
+    - name: Build example docs
+      run: |
+        make -C tests/fixture html
+        make -C tests/fixture latexpdf
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/.gitignore new/plantuml-0.24/.gitignore
--- old/plantuml-0.21/.gitignore        2021-05-11 12:04:36.000000000 +0200
+++ new/plantuml-0.24/.gitignore        2022-07-05 13:55:37.000000000 +0200
@@ -1,5 +1,6 @@
 *.pyc
 *~
+/tests/fixture/_build/
 build/
 dist/
 sphinxcontrib_plantuml.egg-info/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/README.rst new/plantuml-0.24/README.rst
--- old/plantuml-0.21/README.rst        2021-05-11 12:04:36.000000000 +0200
+++ new/plantuml-0.24/README.rst        2022-07-05 13:55:37.000000000 +0200
@@ -92,6 +92,7 @@
   :eps: generate .eps (not supported by `pdflatex`)
   :pdf: generate .eps and convert it to .pdf (requires `epstopdf`)
   :png: generate .png
+  :tikz: generate .latex in the TikZ format
   :none: do not generate any images (ignore uml directive)
 
   Because embedded png looks pretty bad, it is recommended to choose `pdf`
@@ -118,3 +119,26 @@
   runtime and allows plantuml to leverage multiple CPU cores.
 
   To enable batch rendering, set the size to 100-1000.
+
+Developing
+----------
+
+Install the python test dependencies with
+
+.. code-block::
+
+   pip install sphinxcontrib-plantuml[test]
+
+In addition the following non-python dependencies are required in order to run 
the tests:
+
+* `latexmk`
+* `plantuml`
+* `texlive`
+* `texlive-font-utils`
+* `texlive-latex-extra`
+
+The tests can be executed using `pytest`
+
+.. code-block::
+
+    pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/setup.cfg new/plantuml-0.24/setup.cfg
--- old/plantuml-0.21/setup.cfg 2021-05-11 12:04:36.000000000 +0200
+++ new/plantuml-0.24/setup.cfg 2022-07-05 13:55:37.000000000 +0200
@@ -4,3 +4,21 @@
 
 [aliases]
 release = egg_info -RDb ''
+
+[flake8]
+exclude =
+    tests/fixture
+# E741: ambiguous variable name 'l'
+# W503: line break before binary operator
+ignore = E741, W503
+max-line-length = 80
+
+[options]
+install_requires =
+    Sphinx>=1.6
+
+[options.extras_require]
+test =
+    pytest
+    Pillow
+    flake8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/setup.py new/plantuml-0.24/setup.py
--- old/plantuml-0.21/setup.py  2021-05-11 12:04:36.000000000 +0200
+++ new/plantuml-0.24/setup.py  2022-07-05 13:55:37.000000000 +0200
@@ -4,11 +4,9 @@
 
 long_desc = open('README.rst').read()
 
-requires = ['Sphinx>=1.6']
-
 setup(
     name='sphinxcontrib-plantuml',
-    version='0.21',
+    version='0.24',
     url='https://github.com/sphinx-contrib/plantuml/',
     download_url='https://pypi.python.org/pypi/sphinxcontrib-plantuml',
     license='BSD',
@@ -31,6 +29,5 @@
     platforms='any',
     packages=find_packages(),
     include_package_data=True,
-    install_requires=requires,
     namespace_packages=['sphinxcontrib'],
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/sphinxcontrib/__init__.py 
new/plantuml-0.24/sphinxcontrib/__init__.py
--- old/plantuml-0.21/sphinxcontrib/__init__.py 2021-05-11 12:04:36.000000000 
+0200
+++ new/plantuml-0.24/sphinxcontrib/__init__.py 2022-07-05 13:55:37.000000000 
+0200
@@ -11,4 +11,3 @@
 """
 
 __import__('pkg_resources').declare_namespace(__name__)
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/sphinxcontrib/plantuml.py 
new/plantuml-0.24/sphinxcontrib/plantuml.py
--- old/plantuml-0.21/sphinxcontrib/plantuml.py 2021-05-11 12:04:36.000000000 
+0200
+++ new/plantuml-0.24/sphinxcontrib/plantuml.py 2022-07-05 13:55:37.000000000 
+0200
@@ -93,6 +93,7 @@
     has_content = True
     required_arguments = 0
     optional_arguments = 1
+    final_argument_whitespace = True  # allow whitespace in arguments[-1]
     option_spec = {
         'alt': directives.unchanged,
         'align': align,
@@ -199,6 +200,7 @@
     'png': [],
     'svg': ['-tsvg'],
     'txt': ['-ttxt'],
+    'latex': ['-tlatex:nopreamble'],
 }
 
 
@@ -541,6 +543,7 @@
     'eps': ('eps', lambda self, refname, fname: (refname, fname)),
     'pdf': ('eps', _convert_eps_to_pdf),
     'png': ('png', lambda self, refname, fname: (refname, fname)),
+    'tikz': ('latex', lambda self, refname, fname: (refname, fname)),
 }
 
 
@@ -553,6 +556,37 @@
             % (', '.join(map(repr, _KNOWN_LATEX_FORMATS)), fmt))
 
 
+def _latex_adjustbox_options(self, node):
+    adjustbox_options = []
+    if 'width' in node:
+        if 'scale' in node:
+            w = self.latex_image_length(node['width'], node['scale'])
+        else:
+            w = self.latex_image_length(node['width'])
+        if w:
+            adjustbox_options.append('width=%s' % w)
+    if 'height' in node:
+        if 'scale' in node:
+            h = self.latex_image_length(node['height'], node['scale'])
+        else:
+            h = self.latex_image_length(node['height'])
+        if h:
+            adjustbox_options.append('height=%s' % h)
+    if 'scale' in node:
+        if not adjustbox_options:
+            adjustbox_options.append('scale=%s'
+                                     % (float(node['scale']) / 100.0))
+    return adjustbox_options
+
+
+def _latex_add_package(self, package):
+    # TODO: Currently modifying the preamble to add a package, there may be
+    # a cleaner solution
+    package = '\\usepackage{%s}' % (package,)
+    if package not in self.elements['preamble']:
+        self.elements['preamble'] += package + '\n'
+
+
 def latex_visit_plantuml(self, node):
     _render_batches_on_vist(self)
     if 'latex_format' in node:
@@ -569,23 +603,50 @@
         logger.warning(str(err))
         raise nodes.SkipNode
 
-    # put node representing rendered image
-    img_node = nodes.image(uri=refname, **node.attributes)
-    img_node.delattr('uml')
-    if not img_node.hasattr('alt'):
-        img_node['alt'] = node['uml']
-    node.append(img_node)
+    if fmt == 'tikz':
+        _latex_add_package(self, 'tikz')
+
+        base, ext = os.path.splitext(refname)
+        input_macro = '\\input{{%s}%s}' % (base, ext)
+
+        adjustbox_options = _latex_adjustbox_options(self, node)
+        if adjustbox_options:
+            _latex_add_package(self, 'adjustbox')
+            options = ','.join(adjustbox_options)
+            self.body.append('\\adjustbox{%s}{%s}' % (options, input_macro))
+        else:
+            self.body.append(input_macro)
+    else:
+        # put node representing rendered image
+        img_node = nodes.image(uri=refname, **node.attributes)
+        img_node.delattr('uml')
+        if not img_node.hasattr('alt'):
+            img_node['alt'] = node['uml']
+        node.append(img_node)
 
 
 def latex_depart_plantuml(self, node):
     pass
 
 
+_KNOWN_CONFLUENCE_FORMATS = [
+    'png',
+    'svg',
+]
+
+
 def confluence_visit_plantuml(self, node):
     _render_batches_on_vist(self)
     fmt = self.builder.config.plantuml_output_format
-    with _prepare_html_render(self, fmt) as (fileformats, _):
-        _, outfname = render_plantuml(self, node, fileformats[0])
+    if fmt == 'none':
+        raise nodes.SkipNode
+
+    if fmt not in _KNOWN_CONFLUENCE_FORMATS:
+        raise PlantUmlError(
+            'plantuml_output_format must be one of %s, but is %r'
+            % (', '.join(map(repr, _KNOWN_CONFLUENCE_FORMATS)), fmt))
+
+    _, outfname = render_plantuml(self, node, fmt)
 
     # put node representing rendered image
     img_node = nodes.image(uri=outfname, alt=node.get('alt', node['uml']))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/tests/fakecmd.py 
new/plantuml-0.24/tests/fakecmd.py
--- old/plantuml-0.21/tests/fakecmd.py  2021-05-11 12:04:36.000000000 +0200
+++ new/plantuml-0.24/tests/fakecmd.py  2022-07-05 13:55:37.000000000 +0200
@@ -1,12 +1,14 @@
 #!/usr/bin/env python
 import sys
 
+
 def dump(fout, fin):
     # embed as PostScript comment
     fout.write('% ' + ' '.join(sys.argv) + '\n')
     for line in fin:
         fout.write('% ' + line)
 
+
 if '-pipe' in sys.argv:
     dump(sys.stdout, sys.stdin)
 else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/tests/test_functional.py 
new/plantuml-0.24/tests/test_functional.py
--- old/plantuml-0.21/tests/test_functional.py  2021-05-11 12:04:36.000000000 
+0200
+++ new/plantuml-0.24/tests/test_functional.py  2022-07-05 13:55:37.000000000 
+0200
@@ -11,6 +11,7 @@
 _fixturedir = os.path.join(os.path.dirname(__file__), 'fixture')
 _fakecmd = os.path.join(os.path.dirname(__file__), 'fakecmd.py')
 
+
 def setup():
     global _tempdir, _srcdir, _outdir
     _tempdir = tempfile.mkdtemp()
@@ -18,9 +19,11 @@
     _outdir = os.path.join(_tempdir, 'out')
     os.mkdir(_srcdir)
 
+
 def teardown():
     shutil.rmtree(_tempdir)
 
+
 def readfile(fname):
     f = open(os.path.join(_outdir, fname), 'rb')
     try:
@@ -28,6 +31,7 @@
     finally:
         f.close()
 
+
 def runsphinx(text, builder, confoverrides):
     f = open(os.path.join(_srcdir, 'index.rst'), 'wb')
     try:
@@ -38,9 +42,11 @@
                  confoverrides, status=sys.stdout, warning=sys.stdout)
     app.build()
 
+
 def with_runsphinx(builder, **kwargs):
     confoverrides = {'plantuml': [sys.executable, _fakecmd]}
     confoverrides.update(kwargs)
+
     def wrapfunc(func):
         def test():
             if builder == 'pdf':
@@ -59,8 +65,10 @@
                 shutil.rmtree(_outdir)
         test.__name__ = func.__name__
         return test
+
     return wrapfunc
 
+
 @with_runsphinx('html', plantuml_output_format='svg')
 def test_buildhtml_simple_with_svg():
     """Generate simple HTML
@@ -84,6 +92,7 @@
     assert b'-tsvg' in svgcontent[0]
     assert svgcontent[1][2:] == b'Hello'
 
+
 @with_runsphinx('html', plantuml_output_format='none')
 def test_buildhtml_no_output():
     """Generate simple HTML with uml directive disabled
@@ -94,6 +103,7 @@
     """
     assert b'<img ' not in readfile('index.html')
 
+
 @with_runsphinx('html')
 def test_buildhtml_samediagram():
     """Same diagram should be same file
@@ -112,6 +122,7 @@
                if b'<img src="_images/plantuml' in l]
     assert len(imgtags) == 2
 
+
 @with_runsphinx('html')
 def test_buildhtml_alt():
     """Generate HTML with alt specified
@@ -123,6 +134,7 @@
     """
     assert b'alt="Foo &lt;Bar&gt;"' in readfile('index.html')
 
+
 @with_runsphinx('html')
 def test_buildhtml_caption():
     """Generate HTML with caption specified
@@ -135,6 +147,7 @@
     assert (b'Caption with <strong>bold</strong> and <em>italic</em>'
             in readfile('index.html'))
 
+
 @with_runsphinx('html')
 def test_buildhtml_name():
     """Generate HTML with name specified
@@ -147,6 +160,7 @@
     """
     re.search(br'<div class="figure[^"]*" id="label">', readfile('index.html'))
 
+
 @with_runsphinx('html')
 def test_buildhtml_nonascii():
     u"""Generate simple HTML of non-ascii diagram
@@ -160,6 +174,7 @@
     assert b'-charset utf-8' in content[0]
     assert content[1][2:].decode('utf-8') == u'\u3042'
 
+
 @with_runsphinx('html', plantuml_batch_size=2)
 def test_buildhtml_in_batches():
     """Render in batches
@@ -200,6 +215,7 @@
     assert sorted(sum(c.endswith(b'.puml') for c in cmd.split())
                   for cmd in set(png_commands)) == [0, 1, 2]
 
+
 @with_runsphinx('latex')
 def test_buildlatex_simple():
     """Generate simple LaTeX
@@ -217,6 +233,7 @@
     assert b'-pipe' in content[0]
     assert content[1][2:] == b'Hello'
 
+
 @with_runsphinx('latex', plantuml_latex_output_format='eps')
 def test_buildlatex_simple_with_eps():
     """Generate simple LaTeX with EPS
@@ -234,6 +251,64 @@
     assert b'-teps' in content[0]
     assert content[1][2:] == b'Hello'
 
+
+@with_runsphinx('latex', plantuml_latex_output_format='tikz')
+def test_buildlatex_simple_with_tikz():
+    """Generate simple LaTeX with TikZ
+
+    .. uml::
+
+       Hello
+    """
+    files = glob.glob(os.path.join(_outdir, 'plantuml-*.latex'))
+    assert len(files) == 1
+    assert re.search(br'\\input\{+plantuml-',
+                     readfile('plantuml_fixture.tex'))
+
+    content = readfile(files[0]).splitlines()
+    assert b'-tlatex:nopreamble' in content[0]
+    assert content[1][2:] == b'Hello'
+
+
+@with_runsphinx('latex', plantuml_latex_output_format='tikz')
+def test_buildlatex_simple_scale_with_tikz():
+    """Generate simple LaTeX with TikZ
+
+    .. uml::
+       :scale: 20%
+
+       Hello
+    """
+    assert re.search(br'\\adjustbox\{scale=0.2\}\{\\input\{+plantuml-',
+                     readfile('plantuml_fixture.tex'))
+
+
+@with_runsphinx('latex', plantuml_latex_output_format='tikz')
+def test_buildlatex_simple_width_with_tikz():
+    """Generate simple LaTeX with TikZ
+
+    .. uml::
+       :width: 50mm
+
+       Hello
+    """
+    assert re.search(br'\\adjustbox\{width=50mm\}\{\\input\{+plantuml-',
+                     readfile('plantuml_fixture.tex'))
+
+
+@with_runsphinx('latex', plantuml_latex_output_format='tikz')
+def test_buildlatex_simple_height_with_tikz():
+    """Generate simple LaTeX with TikZ
+
+    .. uml::
+       :height: 50mm
+
+       Hello
+    """
+    assert re.search(br'\\adjustbox\{height=50mm\}\{\\input\{+plantuml-',
+                     readfile('plantuml_fixture.tex'))
+
+
 @with_runsphinx('latex', plantuml_latex_output_format='pdf')
 def test_buildlatex_simple_with_pdf():
     """Generate simple LaTeX with PDF
@@ -253,6 +328,7 @@
     assert b'-teps' in epscontent[0]
     assert epscontent[1][2:] == b'Hello'
 
+
 @with_runsphinx('latex', plantuml_latex_output_format='none')
 def test_buildlatex_no_output():
     """Generate simple LaTeX with uml directive disabled
@@ -264,6 +340,7 @@
     assert not re.search(br'\\(sphinx)?includegraphics\{+plantuml-',
                          readfile('plantuml_fixture.tex'))
 
+
 @with_runsphinx('latex')
 def test_buildlatex_with_caption():
     """Generate LaTeX with caption
@@ -278,6 +355,7 @@
     assert re.search(br'\\begin\{figure\}\[htbp\]', out)
     assert not re.search(br'\\begin\{flushNone', out)  # issue #136
 
+
 @with_runsphinx('latex')
 def test_buildlatex_with_align():
     """Generate LaTeX with caption
@@ -291,6 +369,7 @@
     assert (re.search(br'\\begin\{figure\}\[htbp\]\\begin\{flushright\}', out)
             or re.search(br'\\begin\{wrapfigure\}\{r\}', out))
 
+
 @with_runsphinx('pdf')
 def test_buildpdf_simple():
     """Generate simple PDF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/plantuml-0.21/tests/test_svgstyle.py 
new/plantuml-0.24/tests/test_svgstyle.py
--- old/plantuml-0.21/tests/test_svgstyle.py    2021-05-11 12:04:36.000000000 
+0200
+++ new/plantuml-0.24/tests/test_svgstyle.py    2022-07-05 13:55:37.000000000 
+0200
@@ -4,13 +4,16 @@
 
 from sphinxcontrib import plantuml
 
+
 def setup():
     global _tempdir
     _tempdir = tempfile.mkdtemp()
 
+
 def teardown():
     shutil.rmtree(_tempdir)
 
+
 def writefile(fname, data):
     f = open(fname, 'w')
     try:
@@ -18,6 +21,7 @@
     finally:
         f.close()
 
+
 def test_get_svg_style():
     fname = os.path.join(_tempdir, 'a.svg')
     writefile(

Reply via email to