diff --git a/CHANGES.txt b/CHANGES.txt index b94cffc6..fe7657e5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,19 @@ Pyxform Changelog +v2.0.0, 2023-12-05 +* Always generate secondary instance for selects by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/614 +* Fix or_other + translations + group or repeat by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/650 +* Detect instance() expressions in notes and make them into outputs by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/648 +* Upgrade Validate by @lognaturel in https://github.com/XLSForm/pyxform/pull/658 +* Add support for specifying a custom camera app for image questions by @grzesiek2010 in https://github.com/XLSForm/pyxform/pull/659 +* Add rows to parameters column for text type by @grzesiek2010 in https://github.com/XLSForm/pyxform/pull/667 +* Reject form with unknown columns in entities sheet by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/671 +* Nicer error about choices sheet when extension omitted in select_.._from_file by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/673 +* Fix _count suffix name clash with repeats targeting another item by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/674 +* Preserve order of columns when building secondary instance by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/672 +* Detection of multilanguage choices only works if first choice list is multilanguage by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/666 +* Tidy up is_label_dynamic to return condition directly by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/675 + v1.12.2, 2023-09-15 * Alias list_name to dataset in entities sheet by @lognaturel in https://github.com/XLSForm/pyxform/pull/654 diff --git a/pyxform/__init__.py b/pyxform/__init__.py index ba05c54b..630bbaf9 100644 --- a/pyxform/__init__.py +++ b/pyxform/__init__.py @@ -4,7 +4,7 @@ Collect easy. """ -__version__ = "1.12.1" +__version__ = "2.0.0" from pyxform.builder import ( SurveyElementBuilder, diff --git a/setup.py b/setup.py index 6d37f9cb..dba227e6 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="pyxform", - version="1.12.1", + version="2.0.0", author="github.com/xlsform", author_email="info@xlsform.org", packages=find_packages(exclude=["tests", "tests.*"]), diff --git a/tests/test_bug_round_calculation.py b/tests/test_bug_round_calculation.py index b584de9e..8627ce33 100644 --- a/tests/test_bug_round_calculation.py +++ b/tests/test_bug_round_calculation.py @@ -16,5 +16,4 @@ def test_non_existent_itext_reference(self): | | calculate | rounded | Rounded | round(${amount}, 0) | """, # noqa xml__contains=[""""""], - run_odk_validate=True, ) diff --git a/tests/test_dynamic_default.py b/tests/test_dynamic_default.py index 1dec22d9..cd664229 100644 --- a/tests/test_dynamic_default.py +++ b/tests/test_dynamic_default.py @@ -768,7 +768,6 @@ def test_dynamic_default_xform_structure(self): ) self.assertPyxformXform( md=md, - run_odk_validate=True, # Exclude if single quote in value, to avoid comparison and escaping issues. xml__xpath_match=[ xpaths diff --git a/tests/test_entities_create.py b/tests/test_entities_create.py index 3f6b4d90..79d9154a 100644 --- a/tests/test_entities_create.py +++ b/tests/test_entities_create.py @@ -395,13 +395,14 @@ def test_list_name_alias_to_dataset(self): def test_entities_columns__all_expected(self): self.assertPyxformXform( md=""" - | survey | | | | - | | type | name | label | - | | text | id | Treid | - | | text | a | A | - | entities | | | | - | | dataset | label | update_if | create_if | entity_id | - | | trees | a | id != '' | id = '' | ${a} | + | survey | | | | + | | type | name | label | + | | text | id | Treid | + | | text | a | A | + | | csv-external | trees | | + | entities | | | | + | | dataset | label | update_if | create_if | entity_id | + | | trees | a | id != '' | id = '' | ${a} | """, errored=False, warnings_count=0, diff --git a/tests/test_entities_update.py b/tests/test_entities_update.py index 4486f163..5e326607 100644 --- a/tests/test_entities_update.py +++ b/tests/test_entities_update.py @@ -7,13 +7,14 @@ def test_basic_entity_update_building_blocks(self): self.assertPyxformXform( name="data", md=""" - | survey | | | | - | | type | name | label | - | | text | id | Tree id | - | | text | a | A | - | entities | | | | - | | dataset | entity_id | | - | | trees | ${id} | | + | survey | | | | + | | type | name | label | + | | text | id | Tree id | + | | text | a | A | + | | csv-external | trees | | + | entities | | | | + | | dataset | entity_id | | + | | trees | ${id} | | """, xml__xpath_match=[ "/h:html/h:head/x:model/x:instance/x:data/x:meta/x:entity", @@ -92,13 +93,14 @@ def test_create_if_with_entity_id_in_entities_sheet__puts_expression_on_bind(sel self.assertPyxformXform( name="data", md=""" - | survey | | | | - | | type | name | label | - | | text | id | Tree id | - | | text | a | A | - | entities | | | | - | | dataset | update_if | entity_id | - | | trees | string-length(a) > 3 | ${id} | + | survey | | | | + | | type | name | label | + | | text | id | Tree id | + | | text | a | A | + | | csv-external | trees | | + | entities | | | | + | | dataset | update_if | entity_id | + | | trees | string-length(a) > 3 | ${id} | """, xml__xpath_match=[ '/h:html/h:head/x:model/x:bind[@nodeset = "/data/meta/entity/@update" and @calculate = "string-length(a) > 3"]', @@ -116,13 +118,14 @@ def test_update_and_create_conditions_with_entity_id__puts_both_in_bind_calculat self.assertPyxformXform( name="data", md=""" - | survey | | | | | - | | type | name | label | | - | | text | id | Tree id | | - | | integer | a | A | | - | entities | | | | | - | | dataset | update_if | create_if | entity_id | - | | trees | id != '' | id = '' | ${id} | + | survey | | | | | + | | type | name | label | | + | | text | id | Tree id | | + | | integer | a | A | | + | | csv-external | trees | | | + | entities | | | | | + | | dataset | update_if | create_if | entity_id | + | | trees | id != '' | id = '' | ${id} | """, xml__xpath_match=[ '/h:html/h:head/x:model/x:bind[@nodeset = "/data/meta/entity/@update" and @calculate = "id != \'\'"]', @@ -140,13 +143,14 @@ def test_entity_id_and_label__updates_label(self): self.assertPyxformXform( name="data", md=""" - | survey | | | | - | | type | name | label | - | | text | id | Tree id | - | | text | a | A | - | entities | | | | - | | dataset | entity_id | label | - | | trees | ${id} | a | + | survey | | | | + | | type | name | label | + | | text | id | Tree id | + | | text | a | A | + | | csv-external | trees | | + | entities | | | | + | | dataset | entity_id | label | + | | trees | ${id} | a | """, xml__xpath_match=[ "/h:html/h:head/x:model/x:instance/x:data/x:meta/x:entity/x:label", @@ -158,13 +162,14 @@ def test_save_to_with_entity_id__puts_save_tos_on_bind(self): self.assertPyxformXform( name="data", md=""" - | survey | | | | | - | | type | name | label | save_to | - | | text | id | Tree id | | - | | text | a | A | foo | - | entities | | | | | - | | dataset | entity_id | | | - | | trees | ${id} | | | + | survey | | | | | + | | type | name | label | save_to | + | | text | id | Tree id | | + | | text | a | A | foo | + | | csv-external | trees | | | + | entities | | | | | + | | dataset | entity_id | | | + | | trees | ${id} | | | """, xml__xpath_match=[ '/h:html/h:head/x:model/x:bind[@nodeset = "/data/a" and @entities:saveto = "foo"]' diff --git a/tests/test_external_instances.py b/tests/test_external_instances.py index 386c5484..385cb832 100644 --- a/tests/test_external_instances.py +++ b/tests/test_external_instances.py @@ -425,8 +425,6 @@ def test_pulldata_calculate_multi_line_expression__one_call(self): xml__contains=[ """""" ], - # Is Validate OK with the multi-line expression. - run_odk_validate=True, ) def test_pulldata_calculate_multi_line_expression__multiple_calls(self): @@ -455,8 +453,6 @@ def test_pulldata_calculate_multi_line_expression__multiple_calls(self): """""", """""", ], - # Is Validate OK with the multi-line expression and multiple instances. - run_odk_validate=True, ) def test_pulldata_calculate_single_line_expression__multiple_calls(self): @@ -479,8 +475,6 @@ def test_pulldata_calculate_single_line_expression__multiple_calls(self): """""", """""", ], - # Is Validate OK with the multiple instances. - run_odk_validate=True, ) def test_external_instance_pulldata_readonly(self): diff --git a/tests/test_guidance_hint.py b/tests/test_guidance_hint.py index d066f141..d292907f 100644 --- a/tests/test_guidance_hint.py +++ b/tests/test_guidance_hint.py @@ -34,7 +34,6 @@ def test_guidance_hint_and_label(self): 'as shown on birth certificate', "", ], - run_odk_validate=True, ) def test_hint_and_guidance_one_language(self): # pylint: disable=C0103 diff --git a/tests/test_osm.py b/tests/test_osm.py index fdd1ea12..5f9d3c39 100644 --- a/tests/test_osm.py +++ b/tests/test_osm.py @@ -24,7 +24,6 @@ class OSMWidgetsTest(PyxformTestCase): def test_osm_type(self): self.assertPyxformXform( name="osm", - run_odk_validate=True, md=""" | survey | | | | | | type | name | label | diff --git a/tests/test_repeat.py b/tests/test_repeat.py index 00fcc8ea..35627b5a 100644 --- a/tests/test_repeat.py +++ b/tests/test_repeat.py @@ -307,7 +307,7 @@ def test_hints_are_present_within_groups(self): """ # noqa - self.assertPyxformXform(md=md, xml__contains=[expected], run_odk_validate=True) + self.assertPyxformXform(md=md, xml__contains=[expected]) def test_choice_from_previous_repeat_answers(self): """Select one choices from previous repeat answers.""" @@ -1023,5 +1023,4 @@ def test_repeat_count_item_with_same_suffix_as_repeat_is_ok(self): /h:html/h:head/x:model/x:instance/x:test_name/x:a_count """, ], - run_odk_validate=True, ) diff --git a/tests/test_set_geopoint.py b/tests/test_set_geopoint.py index 267c95b5..d897d063 100644 --- a/tests/test_set_geopoint.py +++ b/tests/test_set_geopoint.py @@ -21,5 +21,4 @@ def test_setgeopoint(self): '', "", ], - run_odk_validate=True, ) diff --git a/tests/test_validate_unicode_exception.py b/tests/test_validate_unicode_exception.py index 98257665..d49fcde1 100644 --- a/tests/test_validate_unicode_exception.py +++ b/tests/test_validate_unicode_exception.py @@ -19,7 +19,6 @@ def test_validate_unicode_exception(self): | | type | name | label | calculation | | | calculate | bad | bad | $(myField)='1' | """, - run_odk_validate=True, odk_validate_error__contains=[ 'Invalid calculate for the bind attached to "${bad}" : Couldn\'t ' "understand the expression starting at this point:" @@ -33,7 +32,6 @@ def test_validate_with_more_unicode(self): | | type | name | label | calculation | | | calculate | bad | bad | £¥§©®₱₩ | """, - run_odk_validate=True, odk_validate_error__contains=[ 'Invalid calculate for the bind attached to "${bad}" : Couldn\'t ' "understand the expression starting at this point:" diff --git a/tests/test_whitespace.py b/tests/test_whitespace.py index e74426e5..8b211eb3 100644 --- a/tests/test_whitespace.py +++ b/tests/test_whitespace.py @@ -29,7 +29,6 @@ def test_values_without_whitespaces_are_processed_successfully(self): """ self.assertPyxformXform( md=md, - run_odk_validate=True, xml__xpath_contains=[ """ /h:html/h:head/x:model/x:submission[