Skip to content

Commit f719550

Browse files
authored
Merge pull request #676 from lognaturel/release-v2
Prepare for v2.0.0 release
2 parents 61a4a7d + 4448d92 commit f719550

14 files changed

+65
-60
lines changed

CHANGES.txt

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
Pyxform Changelog
22

3+
v2.0.0, 2023-12-05
4+
* Always generate secondary instance for selects by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/614
5+
* Fix or_other + translations + group or repeat by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/650
6+
* Detect instance() expressions in notes and make them into outputs by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/648
7+
* Upgrade Validate by @lognaturel in https://github.com/XLSForm/pyxform/pull/658
8+
* Add support for specifying a custom camera app for image questions by @grzesiek2010 in https://github.com/XLSForm/pyxform/pull/659
9+
* Add rows to parameters column for text type by @grzesiek2010 in https://github.com/XLSForm/pyxform/pull/667
10+
* Reject form with unknown columns in entities sheet by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/671
11+
* Nicer error about choices sheet when extension omitted in select_.._from_file by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/673
12+
* Fix _count suffix name clash with repeats targeting another item by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/674
13+
* Preserve order of columns when building secondary instance by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/672
14+
* Detection of multilanguage choices only works if first choice list is multilanguage by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/666
15+
* Tidy up is_label_dynamic to return condition directly by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/675
16+
317
v1.12.2, 2023-09-15
418
* Alias list_name to dataset in entities sheet by @lognaturel in https://github.com/XLSForm/pyxform/pull/654
519

pyxform/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Collect easy.
55
"""
66

7-
__version__ = "1.12.1"
7+
__version__ = "2.0.0"
88

99
from pyxform.builder import (
1010
SurveyElementBuilder,

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name="pyxform",
10-
version="1.12.1",
10+
version="2.0.0",
1111
author="github.com/xlsform",
1212
author_email="[email protected]",
1313
packages=find_packages(exclude=["tests", "tests.*"]),

tests/test_bug_round_calculation.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ def test_non_existent_itext_reference(self):
1616
| | calculate | rounded | Rounded | round(${amount}, 0) |
1717
""", # noqa
1818
xml__contains=["""<instance>"""],
19-
run_odk_validate=True,
2019
)

tests/test_dynamic_default.py

-1
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ def test_dynamic_default_xform_structure(self):
768768
)
769769
self.assertPyxformXform(
770770
md=md,
771-
run_odk_validate=True,
772771
# Exclude if single quote in value, to avoid comparison and escaping issues.
773772
xml__xpath_match=[
774773
xpaths

tests/test_entities_create.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,14 @@ def test_list_name_alias_to_dataset(self):
395395
def test_entities_columns__all_expected(self):
396396
self.assertPyxformXform(
397397
md="""
398-
| survey | | | |
399-
| | type | name | label |
400-
| | text | id | Treid |
401-
| | text | a | A |
402-
| entities | | | |
403-
| | dataset | label | update_if | create_if | entity_id |
404-
| | trees | a | id != '' | id = '' | ${a} |
398+
| survey | | | |
399+
| | type | name | label |
400+
| | text | id | Treid |
401+
| | text | a | A |
402+
| | csv-external | trees | |
403+
| entities | | | |
404+
| | dataset | label | update_if | create_if | entity_id |
405+
| | trees | a | id != '' | id = '' | ${a} |
405406
""",
406407
errored=False,
407408
warnings_count=0,

tests/test_entities_update.py

+40-35
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ def test_basic_entity_update_building_blocks(self):
77
self.assertPyxformXform(
88
name="data",
99
md="""
10-
| survey | | | |
11-
| | type | name | label |
12-
| | text | id | Tree id |
13-
| | text | a | A |
14-
| entities | | | |
15-
| | dataset | entity_id | |
16-
| | trees | ${id} | |
10+
| survey | | | |
11+
| | type | name | label |
12+
| | text | id | Tree id |
13+
| | text | a | A |
14+
| | csv-external | trees | |
15+
| entities | | | |
16+
| | dataset | entity_id | |
17+
| | trees | ${id} | |
1718
""",
1819
xml__xpath_match=[
1920
"/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
9293
self.assertPyxformXform(
9394
name="data",
9495
md="""
95-
| survey | | | |
96-
| | type | name | label |
97-
| | text | id | Tree id |
98-
| | text | a | A |
99-
| entities | | | |
100-
| | dataset | update_if | entity_id |
101-
| | trees | string-length(a) > 3 | ${id} |
96+
| survey | | | |
97+
| | type | name | label |
98+
| | text | id | Tree id |
99+
| | text | a | A |
100+
| | csv-external | trees | |
101+
| entities | | | |
102+
| | dataset | update_if | entity_id |
103+
| | trees | string-length(a) > 3 | ${id} |
102104
""",
103105
xml__xpath_match=[
104106
'/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
116118
self.assertPyxformXform(
117119
name="data",
118120
md="""
119-
| survey | | | | |
120-
| | type | name | label | |
121-
| | text | id | Tree id | |
122-
| | integer | a | A | |
123-
| entities | | | | |
124-
| | dataset | update_if | create_if | entity_id |
125-
| | trees | id != '' | id = '' | ${id} |
121+
| survey | | | | |
122+
| | type | name | label | |
123+
| | text | id | Tree id | |
124+
| | integer | a | A | |
125+
| | csv-external | trees | | |
126+
| entities | | | | |
127+
| | dataset | update_if | create_if | entity_id |
128+
| | trees | id != '' | id = '' | ${id} |
126129
""",
127130
xml__xpath_match=[
128131
'/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):
140143
self.assertPyxformXform(
141144
name="data",
142145
md="""
143-
| survey | | | |
144-
| | type | name | label |
145-
| | text | id | Tree id |
146-
| | text | a | A |
147-
| entities | | | |
148-
| | dataset | entity_id | label |
149-
| | trees | ${id} | a |
146+
| survey | | | |
147+
| | type | name | label |
148+
| | text | id | Tree id |
149+
| | text | a | A |
150+
| | csv-external | trees | |
151+
| entities | | | |
152+
| | dataset | entity_id | label |
153+
| | trees | ${id} | a |
150154
""",
151155
xml__xpath_match=[
152156
"/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):
158162
self.assertPyxformXform(
159163
name="data",
160164
md="""
161-
| survey | | | | |
162-
| | type | name | label | save_to |
163-
| | text | id | Tree id | |
164-
| | text | a | A | foo |
165-
| entities | | | | |
166-
| | dataset | entity_id | | |
167-
| | trees | ${id} | | |
165+
| survey | | | | |
166+
| | type | name | label | save_to |
167+
| | text | id | Tree id | |
168+
| | text | a | A | foo |
169+
| | csv-external | trees | | |
170+
| entities | | | | |
171+
| | dataset | entity_id | | |
172+
| | trees | ${id} | | |
168173
""",
169174
xml__xpath_match=[
170175
'/h:html/h:head/x:model/x:bind[@nodeset = "/data/a" and @entities:saveto = "foo"]'

tests/test_external_instances.py

-6
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ def test_pulldata_calculate_multi_line_expression__one_call(self):
425425
xml__contains=[
426426
"""<instance id="my_data_b" src="jr://file-csv/my_data_b.csv"/>"""
427427
],
428-
# Is Validate OK with the multi-line expression.
429-
run_odk_validate=True,
430428
)
431429

432430
def test_pulldata_calculate_multi_line_expression__multiple_calls(self):
@@ -455,8 +453,6 @@ def test_pulldata_calculate_multi_line_expression__multiple_calls(self):
455453
"""<instance id="my_data_b" src="jr://file-csv/my_data_b.csv"/>""",
456454
"""<instance id="my_data_c" src="jr://file-csv/my_data_c.csv"/>""",
457455
],
458-
# Is Validate OK with the multi-line expression and multiple instances.
459-
run_odk_validate=True,
460456
)
461457

462458
def test_pulldata_calculate_single_line_expression__multiple_calls(self):
@@ -479,8 +475,6 @@ def test_pulldata_calculate_single_line_expression__multiple_calls(self):
479475
"""<instance id="my_data_b" src="jr://file-csv/my_data_b.csv"/>""",
480476
"""<instance id="my_data_c" src="jr://file-csv/my_data_c.csv"/>""",
481477
],
482-
# Is Validate OK with the multiple instances.
483-
run_odk_validate=True,
484478
)
485479

486480
def test_external_instance_pulldata_readonly(self):

tests/test_guidance_hint.py

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def test_guidance_hint_and_label(self):
3434
'<value form="guidance">as shown on birth certificate</value>',
3535
"<hint ref=\"jr:itext('/data/name:hint')\"/>",
3636
],
37-
run_odk_validate=True,
3837
)
3938

4039
def test_hint_and_guidance_one_language(self): # pylint: disable=C0103

tests/test_osm.py

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class OSMWidgetsTest(PyxformTestCase):
2424
def test_osm_type(self):
2525
self.assertPyxformXform(
2626
name="osm",
27-
run_odk_validate=True,
2827
md="""
2928
| survey | | | |
3029
| | type | name | label |

tests/test_repeat.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def test_hints_are_present_within_groups(self):
307307
</input>
308308
</group>""" # noqa
309309

310-
self.assertPyxformXform(md=md, xml__contains=[expected], run_odk_validate=True)
310+
self.assertPyxformXform(md=md, xml__contains=[expected])
311311

312312
def test_choice_from_previous_repeat_answers(self):
313313
"""Select one choices from previous repeat answers."""
@@ -1023,5 +1023,4 @@ def test_repeat_count_item_with_same_suffix_as_repeat_is_ok(self):
10231023
/h:html/h:head/x:model/x:instance/x:test_name/x:a_count
10241024
""",
10251025
],
1026-
run_odk_validate=True,
10271026
)

tests/test_set_geopoint.py

-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ def test_setgeopoint(self):
2121
'<odk:setgeopoint event="odk-instance-first-load" ref="/data/my-location"/>',
2222
"",
2323
],
24-
run_odk_validate=True,
2524
)

tests/test_validate_unicode_exception.py

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def test_validate_unicode_exception(self):
1919
| | type | name | label | calculation |
2020
| | calculate | bad | bad | $(myField)='1' |
2121
""",
22-
run_odk_validate=True,
2322
odk_validate_error__contains=[
2423
'Invalid calculate for the bind attached to "${bad}" : Couldn\'t '
2524
"understand the expression starting at this point:"
@@ -33,7 +32,6 @@ def test_validate_with_more_unicode(self):
3332
| | type | name | label | calculation |
3433
| | calculate | bad | bad | £¥§©®₱₩ |
3534
""",
36-
run_odk_validate=True,
3735
odk_validate_error__contains=[
3836
'Invalid calculate for the bind attached to "${bad}" : Couldn\'t '
3937
"understand the expression starting at this point:"

tests/test_whitespace.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def test_values_without_whitespaces_are_processed_successfully(self):
2929
"""
3030
self.assertPyxformXform(
3131
md=md,
32-
run_odk_validate=True,
3332
xml__xpath_contains=[
3433
"""
3534
/h:html/h:head/x:model/x:submission[

0 commit comments

Comments
 (0)