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

Bas Couwenberg gitlab at salsa.debian.org
Sat Jul 4 07:21:51 BST 2020



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


Commits:
0b54c681 by Bas Couwenberg at 2020-07-04T08:12:13+02:00
New upstream version 4.2.6
- - - - -


9 changed files:

- .travis.yml
- VERSION.txt
- debian/changelog
- pywps/app/Process.py
- pywps/configuration.py
- pywps/inout/formats/__init__.py
- pywps/validator/__init__.py
- pywps/validator/complexvalidator.py
- setup.py


Changes:

=====================================
.travis.yml
=====================================
@@ -1,7 +1,8 @@
 language: python
 
-sudo: required
-dist: trusty
+# sudo: required
+os: linux
+dist: xenial
 
 python:
   - "3.6"
@@ -14,6 +15,8 @@ addons:
     sources:
       - sourceline: 'ppa:ubuntugis/ppa'
     packages:
+      - libnetcdf-dev
+      - libhdf5-dev
       - gdal-bin
       - libgdal-dev
       - devscripts


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


=====================================
debian/changelog
=====================================
@@ -1,3 +1,19 @@
+pywps (4.2.6) trusty; urgency=medium
+
+  * Fixed tests on travis (#541).
+  * Fixed imports in gpx validator (#540).
+
+ -- Carsten Ehbrecht <ehbrecht at dkrz.de>  Fri, 03 Jul 2020 18:00:00 +0000
+
+pywps (4.2.5) trusty; urgency=medium
+
+  * Added validation for GPX files (#535).
+  * Added encoding in `configparser` (#532).
+  * Fixed long_description_content_type in `setup.py` needed by pypi (#534).
+  * Fixed init of process.status_store ... needed by scheduler extension (#539).
+
+ -- Carsten Ehbrecht <ehbrecht at dkrz.de>  Fri, 03 Jul 2020 12:00:00 +0000
+
 pywps (4.2.4) trusty; urgency=medium
 
   * Added support for multiple languages (#510).


=====================================
pywps/app/Process.py
=====================================
@@ -69,7 +69,7 @@ class Process(object):
         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 @@ class Process(object):
             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):


=====================================
pywps/configuration.py
=====================================
@@ -148,7 +148,10 @@ def load_configuration(cfgfiles=None):
     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:


=====================================
pywps/inout/formats/__init__.py
=====================================
@@ -15,7 +15,7 @@ from collections import namedtuple
 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 @@ FORMATS = _FORMATS(
     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'),


=====================================
pywps/validator/__init__.py
=====================================
@@ -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 @@ _VALIDATORS = {
     '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,


=====================================
pywps/validator/complexvalidator.py
=====================================
@@ -14,6 +14,12 @@ from pywps.inout.formats import FORMATS
 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 @@ def validategml(data_input, mode):
 
         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 @@ def validategml(data_input, mode):
     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 <http://gdal.org/>`_ 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 @@ def validatexml(data_input, mode):
     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)


=====================================
setup.py
=====================================
@@ -32,6 +32,7 @@ CONFIG = {
     'version': VERSION,
     'description': DESCRIPTION,
     'long_description': LONG_DESCRIPTION,
+    'long_description_content_type': 'text/markdown',
     'keywords': KEYWORDS,
     'license': 'MIT',
     'platforms': 'all',
@@ -49,6 +50,9 @@ CONFIG = {
         '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,



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

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pywps/-/commit/0b54c68108d5f87811910b00e7a3c62021c05c58
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/20200704/41e675b1/attachment-0001.html>


More information about the Pkg-grass-devel mailing list