Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for v2.0.0 release #676

Merged
merged 4 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyxform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Collect easy.
"""

__version__ = "1.12.1"
__version__ = "2.0.0"

from pyxform.builder import (
SurveyElementBuilder,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"]),
Expand Down
1 change: 0 additions & 1 deletion tests/test_bug_round_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ def test_non_existent_itext_reference(self):
| | calculate | rounded | Rounded | round(${amount}, 0) |
""", # noqa
xml__contains=["""<instance>"""],
run_odk_validate=True,
)
1 change: 0 additions & 1 deletion tests/test_dynamic_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions tests/test_entities_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
75 changes: 40 additions & 35 deletions tests/test_entities_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"]',
Expand All @@ -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 != \'\'"]',
Expand All @@ -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",
Expand All @@ -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"]'
Expand Down
6 changes: 0 additions & 6 deletions tests/test_external_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,6 @@ def test_pulldata_calculate_multi_line_expression__one_call(self):
xml__contains=[
"""<instance id="my_data_b" src="jr://file-csv/my_data_b.csv"/>"""
],
# Is Validate OK with the multi-line expression.
run_odk_validate=True,
)

def test_pulldata_calculate_multi_line_expression__multiple_calls(self):
Expand Down Expand Up @@ -455,8 +453,6 @@ def test_pulldata_calculate_multi_line_expression__multiple_calls(self):
"""<instance id="my_data_b" src="jr://file-csv/my_data_b.csv"/>""",
"""<instance id="my_data_c" src="jr://file-csv/my_data_c.csv"/>""",
],
# 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):
Expand All @@ -479,8 +475,6 @@ def test_pulldata_calculate_single_line_expression__multiple_calls(self):
"""<instance id="my_data_b" src="jr://file-csv/my_data_b.csv"/>""",
"""<instance id="my_data_c" src="jr://file-csv/my_data_c.csv"/>""",
],
# Is Validate OK with the multiple instances.
run_odk_validate=True,
)

def test_external_instance_pulldata_readonly(self):
Expand Down
1 change: 0 additions & 1 deletion tests/test_guidance_hint.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def test_guidance_hint_and_label(self):
'<value form="guidance">as shown on birth certificate</value>',
"<hint ref=\"jr:itext('/data/name:hint')\"/>",
],
run_odk_validate=True,
)

def test_hint_and_guidance_one_language(self): # pylint: disable=C0103
Expand Down
1 change: 0 additions & 1 deletion tests/test_osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 1 addition & 2 deletions tests/test_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def test_hints_are_present_within_groups(self):
</input>
</group>""" # 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."""
Expand Down Expand Up @@ -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,
)
1 change: 0 additions & 1 deletion tests/test_set_geopoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ def test_setgeopoint(self):
'<odk:setgeopoint event="odk-instance-first-load" ref="/data/my-location"/>',
"",
],
run_odk_validate=True,
)
2 changes: 0 additions & 2 deletions tests/test_validate_unicode_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand All @@ -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:"
Expand Down
1 change: 0 additions & 1 deletion tests/test_whitespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down
Loading