Skip to content

Commit

Permalink
refactor: use latest version of capvalidator
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryPTB committed Aug 22, 2024
1 parent e7488a4 commit 97faa2c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flake8
paho-mqtt<2
pytest
pywis-pubsub
requests
paho-mqtt<2
requests
2 changes: 1 addition & 1 deletion wis2box-management/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN apt-get update -y && apt-get install -y ${DEBIAN_PACKAGES} \
https://github.com/geopython/pygeometa/archive/refs/tags/0.16.0.zip \
https://github.com/wmo-im/pywis-topics/archive/refs/tags/0.2.0.zip \
# install cap validator
&& pip3 install --no-cache-dir capvalidator>=0.1.0-dev2 \
&& pip3 install --no-cache-dir capvalidator>=0.1.0-dev4 \
# install shapely
&& pip3 install --no-cache-dir cython pygeos==0.13 \
&& pip3 install shapely \
Expand Down
2 changes: 1 addition & 1 deletion wis2box-management/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ pywis-pubsub
pywis-topics
PyYAML
requests
capvalidator>=0.1.0-dev3
capvalidator>=0.1.0-dev4
4 changes: 2 additions & 2 deletions wis2box-management/wis2box/data/cap_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from typing import Union

from wis2box.data.base import BaseAbstractData
from capvalidator import validate_xml, get_dates
from capvalidator import validate_cap_message, get_dates

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -75,7 +75,7 @@ def transform(self, input_data: Union[Path, bytes],
_meta['relative_filepath'] = self.get_local_filepath(_meta['data_date']) # noqa

# validate the CAP XML string content using the capvalidator package
result = validate_xml(input_bytes, strict=False)
result = validate_cap_message(input_bytes, strict=False)
if not result.passed:
LOGGER.error(
f'Invalid CAP XML, not publishing. Reason: {result.message}')
Expand Down

0 comments on commit 97faa2c

Please sign in to comment.