diff -Nru pywps-4.2.4/debian/changelog pywps-4.2.7/debian/changelog --- pywps-4.2.4/debian/changelog 2020-02-10 04:46:51.000000000 +0000 +++ pywps-4.2.7/debian/changelog 2020-09-12 11:00:00.000000000 +0000 @@ -1,3 +1,33 @@ +pywps (4.2.7-1~focal0) focal; urgency=medium + + * No change rebuild. + + -- Angelos Tzotsos Sat, 12 Sep 2020 14:00:00 +0300 + +pywps (4.2.7-1) unstable; urgency=medium + + * New upstream release. + * Add lintian override for redundant-globbing-patterns. + * Drop unused override for embedded-javascript-library. + + -- Bas Couwenberg Wed, 05 Aug 2020 16:07:33 +0200 + +pywps (4.2.6-2) unstable; urgency=medium + + * Switch libapache2-mod-wsgi dependency to libapache2-mod-wsgi-py3. + * Mark patches as Forwarded: not-needed. + * Add lintian override for embedded-javascript-library. + + -- Bas Couwenberg Tue, 28 Jul 2020 05:49:06 +0200 + +pywps (4.2.6-1) unstable; urgency=medium + + * New upstream release. + * Bump debhelper compat to 10, changes: + - Drop --parallel option, enabled by default + + -- Bas Couwenberg Sat, 04 Jul 2020 08:13:14 +0200 + pywps (4.2.4-1) unstable; urgency=medium * New upstream release. diff -Nru pywps-4.2.4/debian/compat pywps-4.2.7/debian/compat --- pywps-4.2.4/debian/compat 2016-09-04 08:55:20.000000000 +0000 +++ pywps-4.2.7/debian/compat 2020-03-19 19:37:41.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru pywps-4.2.4/debian/control pywps-4.2.7/debian/control --- pywps-4.2.4/debian/control 2020-01-25 10:11:08.000000000 +0000 +++ pywps-4.2.7/debian/control 2020-07-28 03:48:07.000000000 +0000 @@ -4,7 +4,7 @@ Angelos Tzotsos Section: python Priority: optional -Build-Depends: debhelper (>= 9), +Build-Depends: debhelper (>= 10~), dh-apache2, dh-python, libjs-mathjax, @@ -75,7 +75,7 @@ Package: pywps-wsgi Architecture: all Section: web -Depends: libapache2-mod-wsgi | httpd-wsgi, +Depends: libapache2-mod-wsgi-py3 | httpd-wsgi, ${misc:Depends} Recommends: ${misc:Recommends} Breaks: pywps (<< 4.0.0-2~) diff -Nru pywps-4.2.4/debian/patches/offline-tests.patch pywps-4.2.7/debian/patches/offline-tests.patch --- pywps-4.2.4/debian/patches/offline-tests.patch 2020-02-10 04:45:42.000000000 +0000 +++ pywps-4.2.7/debian/patches/offline-tests.patch 2020-07-28 03:58:37.000000000 +0000 @@ -1,5 +1,6 @@ Description: Disable tests that require network. Author: Bas Couwenberg +Forwarded: not-needed --- a/tests/test_ows.py +++ b/tests/test_ows.py diff -Nru pywps-4.2.4/debian/rules pywps-4.2.7/debian/rules --- pywps-4.2.4/debian/rules 2019-07-16 11:50:09.000000000 +0000 +++ pywps-4.2.7/debian/rules 2020-03-19 19:37:55.000000000 +0000 @@ -23,7 +23,7 @@ endif %: - dh $@ --with apache2,python3,sphinxdoc --buildsystem=pybuild --parallel + dh $@ --with apache2,python3,sphinxdoc --buildsystem=pybuild override_auto_clean: dh_auto_clean diff -Nru pywps-4.2.4/debian/source/lintian-overrides pywps-4.2.7/debian/source/lintian-overrides --- pywps-4.2.4/debian/source/lintian-overrides 2019-03-30 20:30:23.000000000 +0000 +++ pywps-4.2.7/debian/source/lintian-overrides 2020-08-05 14:07:33.000000000 +0000 @@ -1,3 +1,6 @@ # Not worth the effort testsuite-autopkgtest-missing +# False positive +redundant-globbing-patterns * + diff -Nru pywps-4.2.4/pywps/app/Process.py pywps-4.2.7/pywps/app/Process.py --- pywps-4.2.4/pywps/app/Process.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/app/Process.py 2020-08-05 09:54:25.000000000 +0000 @@ -69,7 +69,7 @@ self.inputs = inputs self.outputs = outputs self.uuid = None - self.status_store = None + self._status_store = None # self.status_location = '' # self.status_url = '' self.workdir = None @@ -161,7 +161,13 @@ outpt.uuid = uuid def _setup_status_storage(self): - self.status_store = StorageBuilder.buildStorage() + self._status_store = StorageBuilder.buildStorage() + + @property + def status_store(self): + if self._status_store is None: + self._setup_status_storage() + return self._status_store @property def status_location(self): diff -Nru pywps-4.2.4/pywps/configuration.py pywps-4.2.7/pywps/configuration.py --- pywps-4.2.4/pywps/configuration.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/configuration.py 2020-08-05 09:54:25.000000000 +0000 @@ -148,7 +148,10 @@ if isinstance(cfgfiles, str): cfgfiles = [cfgfiles] - loaded_files = CONFIG.read(cfgfiles) + if 'PYWPS_CFG' in os.environ: + cfgfiles.append(os.environ['PYWPS_CFG']) + + loaded_files = CONFIG.read(cfgfiles, encoding='utf-8') if loaded_files: LOGGER.info('Configuration file(s) {} loaded'.format(loaded_files)) else: diff -Nru pywps-4.2.4/pywps/ext_autodoc.py pywps-4.2.7/pywps/ext_autodoc.py --- pywps-4.2.4/pywps/ext_autodoc.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/ext_autodoc.py 2020-08-05 09:54:25.000000000 +0000 @@ -8,6 +8,21 @@ 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 @@ 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('') diff -Nru pywps-4.2.4/pywps/__init__.py pywps-4.2.7/pywps/__init__.py --- pywps-4.2.4/pywps/__init__.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/__init__.py 2020-08-05 09:54:25.000000000 +0000 @@ -9,7 +9,7 @@ from lxml.builder import ElementMaker -__version__ = '4.2.2' +__version__ = '4.2.7' LOGGER = logging.getLogger('PYWPS') LOGGER.debug('setting core variables') diff -Nru pywps-4.2.4/pywps/inout/formats/__init__.py pywps-4.2.7/pywps/inout/formats/__init__.py --- pywps-4.2.4/pywps/inout/formats/__init__.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/inout/formats/__init__.py 2020-08-05 09:54:25.000000000 +0000 @@ -15,7 +15,7 @@ import mimetypes -_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP, GML, METALINK, META4, KML, KMZ, GEOTIFF,' +_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP, GML, GPX, METALINK, META4, KML, KMZ, GEOTIFF,' 'WCS, WCS100, WCS110, WCS20, WFS, WFS100,' 'WFS110, WFS20, WMS, WMS130, WMS110,' 'WMS100, TEXT, DODS, NETCDF, LAZ, LAS, ZIP,' @@ -167,6 +167,7 @@ Format('application/json', extension='.json'), Format('application/x-zipped-shp', extension='.zip', encoding='base64'), Format('application/gml+xml', extension='.gml'), + Format('application/gpx+xml', extension='.gpx'), Format('application/metalink+xml; version=3.0', extension='.metalink', schema="metalink/3.0/metalink.xsd"), Format('application/metalink+xml; version=4.0', extension='.meta4', schema="metalink/4.0/metalink4.xsd"), Format('application/vnd.google-earth.kml+xml', extension='.kml'), diff -Nru pywps-4.2.4/pywps/tests.py pywps-4.2.7/pywps/tests.py --- pywps-4.2.4/pywps/tests.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/tests.py 2020-08-05 09:54:25.000000000 +0000 @@ -12,6 +12,7 @@ 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 @@ 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, ) diff -Nru pywps-4.2.4/pywps/validator/complexvalidator.py pywps-4.2.7/pywps/validator/complexvalidator.py --- pywps-4.2.4/pywps/validator/complexvalidator.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/validator/complexvalidator.py 2020-08-05 09:54:25.000000000 +0000 @@ -14,6 +14,12 @@ import mimetypes import os +from pywps._compat import PY2 +if PY2: + from urllib2 import urlopen +else: + from urllib.request import urlopen + LOGGER = logging.getLogger('PYWPS') @@ -62,12 +68,6 @@ from lxml import etree - from pywps._compat import PY2 - if PY2: - from urllib2 import urlopen - else: - from urllib.request import urlopen - try: schema_url = data_input.data_format.schema gmlschema_doc = etree.parse(urlopen(schema_url)) @@ -80,6 +80,63 @@ return passed +def validategpx(data_input, mode): + """GPX validation function + + :param data_input: :class:`ComplexInput` + :param pywps.validator.mode.MODE mode: + + This function validates GPX input based on given validation mode. Following + happens, if `mode` parameter is given: + + `MODE.NONE` + it will return always `True` + `MODE.SIMPLE` + the mimetype will be checked + `MODE.STRICT` + `GDAL/OGR `_ is used for getting the proper format. + `MODE.VERYSTRICT` + the :class:`lxml.etree` is used along with given input `schema` and the + GPX file is properly validated against given schema. + """ + + LOGGER.info('validating GPX; Mode: {}'.format(mode)) + passed = False + + if mode >= MODE.NONE: + passed = True + + if mode >= MODE.SIMPLE: + + name = data_input.file + (mtype, encoding) = mimetypes.guess_type(name, strict=False) + passed = data_input.data_format.mime_type in {mtype, FORMATS.GPX.mime_type} + + if mode >= MODE.STRICT: + + from pywps.dependencies import ogr + data_source = ogr.Open(data_input.file) + if data_source: + passed = (data_source.GetDriver().GetName() == "GPX") + else: + passed = False + + if mode >= MODE.VERYSTRICT: + + from lxml import etree + + try: + schema_url = data_input.data_format.schema + gpxschema_doc = etree.parse(urlopen(schema_url)) + gpxschema = etree.XMLSchema(gpxschema_doc) + passed = gpxschema.validate(etree.parse(data_input.stream)) + except Exception as e: + LOGGER.warning(e) + passed = False + + return passed + + def validatexml(data_input, mode): """XML validation function @@ -113,12 +170,6 @@ if mode >= MODE.STRICT: from lxml import etree - from pywps._compat import PY2 - if PY2: - from urllib2 import urlopen - else: - from urllib.request import urlopen - # TODO: Raise the actual validation exception to make it easier to spot the error. # xml = etree.parse(data_input.file) # schema.assertValid(xml) diff -Nru pywps-4.2.4/pywps/validator/__init__.py pywps-4.2.7/pywps/validator/__init__.py --- pywps-4.2.4/pywps/validator/__init__.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/pywps/validator/__init__.py 2020-08-05 09:54:25.000000000 +0000 @@ -9,7 +9,7 @@ import logging from pywps.validator.complexvalidator import validategml, validateshapefile, validatejson, validategeojson, \ - validategeotiff, validatenetcdf, validatedods + validategeotiff, validatenetcdf, validatedods, validategpx from pywps.validator.base import emptyvalidator LOGGER = logging.getLogger('PYWPS') @@ -19,6 +19,7 @@ 'application/json': validatejson, 'application/x-zipped-shp': validateshapefile, 'application/gml+xml': validategml, + 'application/gpx+xml': validategpx, 'image/tiff; subtype=geotiff': validategeotiff, 'application/x-netcdf': validatenetcdf, 'application/x-ogc-dods': validatedods, diff -Nru pywps-4.2.4/setup.py pywps-4.2.7/setup.py --- pywps-4.2.4/setup.py 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/setup.py 2020-08-05 09:54:25.000000000 +0000 @@ -32,6 +32,7 @@ 'version': VERSION, 'description': DESCRIPTION, 'long_description': LONG_DESCRIPTION, + 'long_description_content_type': 'text/markdown', 'keywords': KEYWORDS, 'license': 'MIT', 'platforms': 'all', @@ -49,6 +50,9 @@ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", 'Topic :: Scientific/Engineering :: GIS' ], 'install_requires': INSTALL_REQUIRES, diff -Nru pywps-4.2.4/.travis.yml pywps-4.2.7/.travis.yml --- pywps-4.2.4/.travis.yml 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/.travis.yml 2020-08-05 09:54:25.000000000 +0000 @@ -1,7 +1,8 @@ language: python -sudo: required -dist: trusty +# sudo: required +os: linux +dist: xenial python: - "3.6" @@ -14,6 +15,8 @@ sources: - sourceline: 'ppa:ubuntugis/ppa' packages: + - libnetcdf-dev + - libhdf5-dev - gdal-bin - libgdal-dev - devscripts diff -Nru pywps-4.2.4/VERSION.txt pywps-4.2.7/VERSION.txt --- pywps-4.2.4/VERSION.txt 2020-02-09 14:50:22.000000000 +0000 +++ pywps-4.2.7/VERSION.txt 2020-08-05 09:54:25.000000000 +0000 @@ -1 +1 @@ -4.2.4 +4.2.7