[Git][debian-gis-team/pywps][upstream] New upstream version 4.2.7

Bas Couwenberg gitlab at salsa.debian.org
Wed Aug 5 15:22:20 BST 2020



Bas Couwenberg pushed to branch upstream at Debian GIS Project / pywps


Commits:
d5e9e98f by Bas Couwenberg at 2020-08-05T16:06:45+02:00
New upstream version 4.2.7
- - - - -


5 changed files:

- VERSION.txt
- debian/changelog
- pywps/__init__.py
- pywps/ext_autodoc.py
- pywps/tests.py


Changes:

=====================================
VERSION.txt
=====================================
@@ -1 +1 @@
-4.2.6
+4.2.7


=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+pywps (4.2.7) trusty; urgency=medium
+
+  * ext_autodoc: support RST anonymous link (#542).
+
+ -- Carsten Ehbrecht <ehbrecht at dkrz.de>  Tue, 04 Aug 2020 18:00:00 +0000
+
+
 pywps (4.2.6) trusty; urgency=medium
 
   * Fixed tests on travis (#541).


=====================================
pywps/__init__.py
=====================================
@@ -9,7 +9,7 @@ import os
 
 from lxml.builder import ElementMaker
 
-__version__ = '4.2.2'
+__version__ = '4.2.7'
 
 LOGGER = logging.getLogger('PYWPS')
 LOGGER.debug('setting core variables')


=====================================
pywps/ext_autodoc.py
=====================================
@@ -8,6 +8,21 @@ from pywps import Process
 from pywps.app.Common import Metadata
 
 
+class MetadataUrl(Metadata):
+    """Metadata subclass to allow anonymous links generation.
+
+    Useful to avoid Sphinx "Duplicate explicit target name" warning.
+
+    See https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#anonymous-hyperlinks.
+    """
+
+    def __init__(self, title, href=None, role=None, type_='simple',
+                 anonymous=False):
+        super().__init__(title, href=href, role=role, type_=type_)
+        self.anonymous = anonymous
+        "Whether to create anonymous link (boolean)."
+
+
 class ProcessDocumenter(ClassDocumenter):
     """Sphinx autodoc ClassDocumenter subclass that understands the
     pywps.Process class.
@@ -126,8 +141,11 @@ class ProcessDocumenter(ClassDocumenter):
                 title, href = m['title'], m['href']
             else:
                 title, href = None, None
+            extra_underscore = ""
+            if isinstance(m, MetadataUrl):
+                extra_underscore = "_" if m.anonymous else ""
             if title and href:
-                ref.append(u" - `{} <{}>`_".format(title, href))
+                ref.append(u" - `{} <{}>`_{}".format(title, href, extra_underscore))
                 hasref = True
 
         ref.append('')


=====================================
pywps/tests.py
=====================================
@@ -12,6 +12,7 @@ from pywps import Process
 from pywps.inout import LiteralInput, LiteralOutput, ComplexInput, ComplexOutput, BoundingBoxInput, BoundingBoxOutput
 from pywps.inout import Format
 from pywps.app.Common import Metadata
+from pywps.ext_autodoc import MetadataUrl
 
 import re
 
@@ -75,7 +76,10 @@ class DocExampleProcess(Process):
             version="4.0",
             metadata=[Metadata('PyWPS docs', 'https://pywps.org'),
                       Metadata('NumPy docstring conventions',
-                               'https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt')],
+                               'https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt'),
+                      MetadataUrl('Duplicate label', 'http://one.example.com', anonymous=True),
+                      MetadataUrl('Duplicate label', 'http://two.example.com', anonymous=True),
+                      ],
             inputs=inputs,
             outputs=outputs,
         )



View it on GitLab: https://salsa.debian.org/debian-gis-team/pywps/-/commit/d5e9e98f48f093ce238d9f2de4391f7d6f1ab469

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pywps/-/commit/d5e9e98f48f093ce238d9f2de4391f7d6f1ab469
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20200805/8785a03c/attachment-0001.html>


More information about the Pkg-grass-devel mailing list