From 16920f06571b4f05aa12364595f65157d57de729 Mon Sep 17 00:00:00 2001 From: David Megginson Date: Mon, 25 Sep 2023 11:30:17 -0400 Subject: [PATCH 1/7] Update Makefile for PyPi --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 9302c9d..ebff06f 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ test-install: publish-pypi: $(VENV) rm -rf dist/* git checkout upstream/prod + git pull upstream prod . $(VENV) \ && pip install twine \ && python setup.py sdist && twine upload dist/* From e6f2bee707027c6b59bc5b8f0c5065fba5af70bd Mon Sep 17 00:00:00 2001 From: David Megginson Date: Wed, 10 Jan 2024 09:31:56 -0500 Subject: [PATCH 2/7] Fixed test URLs for remote files on GitHub --- tests/test_input.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_input.py b/tests/test_input.py index 78583e8..cefcf29 100644 --- a/tests/test_input.py +++ b/tests/test_input.py @@ -62,11 +62,11 @@ def _resolve_file(filename): FILE_NOTAG2 = _resolve_file('./files/test_io/input-notag2.html') FILE_BINARY_INVALID = _resolve_file('./files/test_io/input-invalid.png') -URL_CSV = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/main/tests/files/test_io/input-valid.csv' +URL_CSV = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/prod/tests/files/test_io/input-valid.csv' URL_CSV_HXL_EXT = 'https://ourairports.com/countries/CA/airports.hxl' -URL_XLSX = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/main/tests/files/test_io/input-valid.xlsx' -URL_XLS = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/test/tests/files/test_io/input-valid.xls' -URL_JSON = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/main/tests/files/test_io/input-valid.json' +URL_XLSX = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/prod/tests/files/test_io/input-valid.xlsx' +URL_XLS = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/prod/tests/files/test_io/input-valid.xls' +URL_JSON = 'https://raw.githubusercontent.com/HXLStandard/libhxl-python/prod/tests/files/test_io/input-valid.json' URL_GOOGLE_SHEET_NOHASH = 'https://docs.google.com/spreadsheets/d/1VTswL-w9EI0IdGIBFZoZ-2RmIiebXKsrhv03yd7LlIg/edit' URL_GOOGLE_SHEET_HASH = 'https://docs.google.com/spreadsheets/d/1VTswL-w9EI0IdGIBFZoZ-2RmIiebXKsrhv03yd7LlIg/edit#gid=299366282' URL_GOOGLE_FILE = 'https://drive.google.com/file/d/1iA0QU0CEywwCr-zDswg7C_RwZgLqS3gb/view' From 748f8e972fb31b2e0072dd46a44f048a7991d7fb Mon Sep 17 00:00:00 2001 From: David Megginson Date: Wed, 10 Jan 2024 09:33:12 -0500 Subject: [PATCH 3/7] Fixed test URLs for remote files on GitHub --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a8e51d5..d862b28 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Release 5.2 + - update URLs for test files on GitHub + 2023-09-25 Release 5.1 - reduce log level for failed number conversion from INFO to DEBUG From 105ddfc069aa87113f3e902247e3de8ce02a6495 Mon Sep 17 00:00:00 2001 From: David Megginson Date: Wed, 10 Jan 2024 09:36:49 -0500 Subject: [PATCH 4/7] Successfully reproduced HDX-9473 in unit test. --- tests/test_filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_filters.py b/tests/test_filters.py index 92f0e57..fb05215 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -131,7 +131,7 @@ def test_count(self): filtered = self.source.recipe({ 'filter': 'count', 'patterns': 'sector', - 'aggregators': 'sum(affected)' + 'aggregators': 'sum(#affected!)' }) self.assertEqual(type(filtered).__name__, 'CountFilter') From 5902bcd7cab21b675885b95b8f75bda3c550fb4d Mon Sep 17 00:00:00 2001 From: David Megginson Date: Wed, 10 Jan 2024 09:39:31 -0500 Subject: [PATCH 5/7] Accept "!" in tag patterns for aggregators. Fixes HDX-9473 --- hxl/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hxl/filters.py b/hxl/filters.py index 2ce3050..7eb1239 100644 --- a/hxl/filters.py +++ b/hxl/filters.py @@ -512,7 +512,7 @@ def lt(a, b): else: raise HXLFilterException("Bad aggregator type for count filter: {}".format(type)) - TAG_PATTERN = r'#?{token}(?:\s*[+-]{token})*'.format(token=hxl.datatypes.TOKEN_PATTERN) + TAG_PATTERN = r'#?{token}(?:\s*[+-]{token})*!?'.format(token=hxl.datatypes.TOKEN_PATTERN) """Regular expression for a tag pattern""" COL_PATTERN = r'#{token}(?:\s*\+{token})*'.format(token=hxl.datatypes.TOKEN_PATTERN) From 2f62f9e171eb68541d65298cc967d05934fc3710 Mon Sep 17 00:00:00 2001 From: David Megginson Date: Wed, 10 Jan 2024 09:41:52 -0500 Subject: [PATCH 6/7] Update CHANGELOG for HDX-9473 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index d862b28..0984589 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ Release 5.2 - update URLs for test files on GitHub + - fixed bug in aggregators that excluded tag patterns ending in "!" 2023-09-25 Release 5.1 - reduce log level for failed number conversion from INFO to DEBUG From b768c3010326ea45c8f8a46a32fb5a70c28b306e Mon Sep 17 00:00:00 2001 From: David Megginson Date: Wed, 10 Jan 2024 09:50:15 -0500 Subject: [PATCH 7/7] Update for 5.2 release. --- CHANGELOG | 2 +- hxl/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0984589..c298c4a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Release 5.2 +2024-01-10 Release 5.2 - update URLs for test files on GitHub - fixed bug in aggregators that excluded tag patterns ending in "!" diff --git a/hxl/__init__.py b/hxl/__init__.py index c270c74..d9d1fd4 100644 --- a/hxl/__init__.py +++ b/hxl/__init__.py @@ -81,7 +81,7 @@ if sys.version_info < (3,): raise RuntimeError("libhxl requires Python 3 or higher") -__version__="5.1" +__version__="5.2" """Module version number see https://www.python.org/dev/peps/pep-0396/ """ diff --git a/setup.py b/setup.py index 021931b..417f32a 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='libhxl', - version="5.1", + version="5.2", description='Python support library for the Humanitarian Exchange Language (HXL). See http://hxlstandard.org and https://github.com/HXLStandard/libhxl-python', long_description=long_description, long_description_content_type="text/markdown",