Skip to content

Commit

Permalink
Merge pull request XLSForm#720 from lognaturel/release-3
Browse files Browse the repository at this point in the history
Prepare v2.1.0 release
  • Loading branch information
lindsay-stevens authored Sep 6, 2024
2 parents d209a84 + 0e4d0a7 commit 6f85440
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 40 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Pyxform Changelog

v2.1.0, 2024-09-05
* Require Python 3.10, 3.11 or 3.12 by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/706
* Detect instance expressions with double quotes by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/709
* Library API for non-path input, accept markdown and dict input by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/712
* Allow whitespace on either side of main header delimiter by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/718
* Support offline entities spec v2024.1.0 via opt-in setting by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/719

v2.0.3, 2024-04-18
* Don't use regex to clean up XML following pretty-printing by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/681
* dev: update dependencies, testing, packaging, and linting/formatting by @lindsay-stevens in https://github.com/XLSForm/pyxform/pull/685
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Releasing pyxform

pyxform_validator_update odk update ODK-Validate-vx.x.x.jar

2. Run all tests through Validate by setting the default for ``run_odk_validate`` to ``kwargs.get("run_odk_validate", True)`` in ``tests/pyxform_test_case.py``.
2. Run all tests through Validate by setting the default for ``run_odk_validate`` to ``True`` in ``tests/pyxform_test_case.py``.
3. Draft a new GitHub release with the list of merged PRs. Follow the title and description pattern of the previous release.
4. Checkout a release branch from latest upstream master.
5. Update ``CHANGES.txt`` with the text of the draft release.
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyxform"
version = "2.0.3"
version = "2.1.0"
authors = [
{name = "github.com/xlsform", email = "support@getodk.org"},
]
Expand All @@ -9,17 +9,17 @@ readme = "README.rst"
requires-python = ">=3.10"
dependencies = [
"xlrd==2.0.1", # Read XLS files
"openpyxl==3.1.2", # Read XLSX files
"openpyxl==3.1.3", # Read XLSX files
"defusedxml==0.7.1", # Parse XML
]

[project.optional-dependencies]
# Install with `pip install pyxform[dev]`.
dev = [
"formencode==2.1.0", # Compare XML
"lxml==5.2.2", # XPath test expressions
"psutil==5.9.8", # Process info for performance tests
"ruff==0.4.5", # Format and lint
"lxml==5.3.0", # XPath test expressions
"psutil==6.0.0", # Process info for performance tests
"ruff==0.6.4", # Format and lint
]

[project.urls]
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__ = "2.0.3"
__version__ = "2.1.0"

from pyxform.builder import (
SurveyElementBuilder,
Expand Down
2 changes: 1 addition & 1 deletion pyxform/validators/odk_validate/.last_check
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-09-19T16:41:46Z
2024-09-05T21:15:02Z
Binary file modified pyxform/validators/odk_validate/bin/ODK_Validate.jar
Binary file not shown.
44 changes: 22 additions & 22 deletions pyxform/validators/odk_validate/bin/installed.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"assets": [
{
"browser_download_url": "https://github.com/getodk/validate/releases/download/v1.18.0/ODK-Validate-v1.18.0.jar",
"browser_download_url": "https://github.com/getodk/validate/releases/download/v1.19.0/ODK-Validate-v1.19.0.jar",
"content_type": "application/java-archive",
"created_at": "2023-09-16T04:28:56Z",
"download_count": 2,
"id": 126294873,
"created_at": "2024-09-05T21:10:16Z",
"download_count": 0,
"id": 190700570,
"label": null,
"name": "ODK-Validate-v1.18.0.jar",
"node_id": "RA_kwDOAmc2ms4HhxtZ",
"size": 5618270,
"name": "ODK-Validate-v1.19.0.jar",
"node_id": "RA_kwDOAmc2ms4LXdwa",
"size": 13416248,
"state": "uploaded",
"updated_at": "2023-09-16T04:28:57Z",
"updated_at": "2024-09-05T21:10:18Z",
"uploader": {
"avatar_url": "https://avatars.githubusercontent.com/u/967540?v=4",
"events_url": "https://api.github.com/users/lognaturel/events{/privacy}",
Expand All @@ -32,10 +32,10 @@
"type": "User",
"url": "https://api.github.com/users/lognaturel"
},
"url": "https://api.github.com/repos/getodk/validate/releases/assets/126294873"
"url": "https://api.github.com/repos/getodk/validate/releases/assets/190700570"
}
],
"assets_url": "https://api.github.com/repos/getodk/validate/releases/121394106/assets",
"assets_url": "https://api.github.com/repos/getodk/validate/releases/173732535/assets",
"author": {
"avatar_url": "https://avatars.githubusercontent.com/u/967540?v=4",
"events_url": "https://api.github.com/users/lognaturel/events{/privacy}",
Expand All @@ -56,20 +56,20 @@
"type": "User",
"url": "https://api.github.com/users/lognaturel"
},
"body": "## What's Changed\r\n* Upgrade [JavaRosa to 4.2.0](https://github.com/getodk/javarosa/releases/tag/v4.2.0) by @lognaturel in https://github.com/getodk/validate/pull/89\r\n\r\n\r\n**Full Changelog**: https://github.com/getodk/validate/compare/v1.17.0...v1.18.0",
"created_at": "2023-09-16T04:14:54Z",
"body": "## What's Changed\r\n* Upgrade [JavaRosa to 4.4.1](https://github.com/getodk/javarosa/releases/tag/v4.4.1) by @lognaturel in https://github.com/getodk/validate/pull/91\r\n\r\n\r\n**Full Changelog**: https://github.com/getodk/validate/compare/v1.18.0...v1.19.0",
"created_at": "2024-09-05T21:04:20Z",
"draft": false,
"html_url": "https://github.com/getodk/validate/releases/tag/v1.18.0",
"id": 121394106,
"html_url": "https://github.com/getodk/validate/releases/tag/v1.19.0",
"id": 173732535,
"mentions_count": 1,
"name": "v1.18.0",
"node_id": "RE_kwDOAmc2ms4HPFO6",
"name": "v1.19.0",
"node_id": "RE_kwDOAmc2ms4KWvK3",
"prerelease": false,
"published_at": "2023-09-16T04:23:43Z",
"tag_name": "v1.18.0",
"tarball_url": "https://api.github.com/repos/getodk/validate/tarball/v1.18.0",
"published_at": "2024-09-05T21:07:12Z",
"tag_name": "v1.19.0",
"tarball_url": "https://api.github.com/repos/getodk/validate/tarball/v1.19.0",
"target_commitish": "master",
"upload_url": "https://uploads.github.com/repos/getodk/validate/releases/121394106/assets{?name,label}",
"url": "https://api.github.com/repos/getodk/validate/releases/121394106",
"zipball_url": "https://api.github.com/repos/getodk/validate/zipball/v1.18.0"
"upload_url": "https://uploads.github.com/repos/getodk/validate/releases/173732535/assets{?name,label}",
"url": "https://api.github.com/repos/getodk/validate/releases/173732535",
"zipball_url": "https://api.github.com/repos/getodk/validate/zipball/v1.19.0"
}
6 changes: 2 additions & 4 deletions pyxform/xform2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@ def _get_question_from_object(self, obj, type=None):
if "label" in obj:
k, v = self._get_label(obj["label"])
if isinstance(v, dict) and "label" in v.keys() and "media" in v.keys():
for _k, _v in iter(v.items()):
question[_k] = _v
question.update(v)
else:
question[k] = v
if "autoplay" in obj or "appearance" in obj or "count" in obj or "rows" in obj:
Expand All @@ -424,8 +423,7 @@ def _get_question_from_object(self, obj, type=None):
question_params = self._get_question_params_from_bindings(ref)

if isinstance(question_params, dict):
for k, v in iter(question_params.items()):
question[k] = v
question.update(question_params)

# Some values set from bindings are incorrect or incomplete. Correct them now.
if "mediatype" in obj:
Expand Down
1 change: 0 additions & 1 deletion tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class TestSettings(PyxformTestCase):
Use the documented setting name, even if it's an alias.
"""

#
def test_form_title(self):
"""Should find the title set in the XForm."""
md = """
Expand Down
10 changes: 5 additions & 5 deletions tests/test_xls2json_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Test xls2json_backends module functionality.
"""

import datetime
import os
from datetime import datetime
from unittest import TestCase

import openpyxl
Expand Down Expand Up @@ -81,9 +81,9 @@ def test_xls_with_many_empty_cells(self):
self.maxDiff = None
# Test fixture produced by adding data at cells IV1 and A19999.
xls_path = os.path.join(bug_example_xls.PATH, "extra_columns.xls")
before = datetime.utcnow()
before = datetime.datetime.now(datetime.timezone.utc)
xls_data = xls_to_dict(xls_path)
after = datetime.utcnow()
after = datetime.datetime.now(datetime.timezone.utc)
self.assertLess((after - before).total_seconds(), 5)
wb = xlrd.open_workbook(filename=xls_path)

Expand All @@ -105,9 +105,9 @@ def test_xlsx_with_many_empty_cells(self):
self.maxDiff = None
# Test fixture produced (presumably) by a LibreOffice serialisation bug.
xlsx_path = os.path.join(bug_example_xls.PATH, "UCL_Biomass_Plot_Form.xlsx")
before = datetime.utcnow()
before = datetime.datetime.now(datetime.timezone.utc)
xlsx_data = xlsx_to_dict(xlsx_path)
after = datetime.utcnow()
after = datetime.datetime.now(datetime.timezone.utc)
self.assertLess((after - before).total_seconds(), 5)
wb = openpyxl.open(filename=xlsx_path, read_only=True, data_only=True)

Expand Down

0 comments on commit 6f85440

Please sign in to comment.