liquid-xml-objects-runtime 21.6.2__tar.gz → 21.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.github/workflows/release.yml +3 -3
  2. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.gitignore +1 -1
  3. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/PKG-INFO +11 -10
  4. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/README.md +10 -9
  5. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/pyproject.toml +2 -2
  6. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/__init__.py +1 -1
  7. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/_version.py +2 -2
  8. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/attribution/__init__.py +1 -1
  9. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/attribution/attributes.py +2 -2
  10. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/convert_string_to_xsd.py +2 -2
  11. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/licensing.py +7 -7
  12. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/lx_reader_settings.py +1 -1
  13. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/lx_settings.py +1 -1
  14. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/lx_writer_settings.py +1 -1
  15. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/meta_data_extensions.py +1 -1
  16. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/conftest.py +1 -1
  17. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/models/bookstore.py +3 -3
  18. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/run_generated.py +1 -1
  19. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/test_convert_string_to_xsd.py +3 -3
  20. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/test_licensing.py +12 -12
  21. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/test_number_formatting.py +1 -1
  22. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/test_runtime_requirements.py +3 -3
  23. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/test_serializer.py +3 -3
  24. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/test_version.py +5 -5
  25. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/test_whitespace_and_regex.py +3 -3
  26. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.gitattributes +0 -0
  27. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.github/workflows/ci.yml +0 -0
  28. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.vscode/extensions.json +0 -0
  29. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.vscode/launch.json +0 -0
  30. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.vscode/settings.json +0 -0
  31. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/.vscode/tasks.json +0 -0
  32. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/CHANGELOG.md +0 -0
  33. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/LICENSE.txt +0 -0
  34. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/MANIFEST.in +0 -0
  35. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/requirements-dev.txt +0 -0
  36. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/attribution/enums.py +0 -0
  37. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/constants.py +0 -0
  38. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/convert_xsd_to_string.py +0 -0
  39. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/deserializer/__init__.py +0 -0
  40. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/deserializer/look_ahead_mode.py +0 -0
  41. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/deserializer/lx_compositor_readers.py +0 -0
  42. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/deserializer/lx_element_reader.py +0 -0
  43. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/deserializer/lx_reader.py +0 -0
  44. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/deserializer/type_deserialization_order.py +0 -0
  45. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/deserializer/xpath_alternatives.py +0 -0
  46. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/errors.py +0 -0
  47. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/lx_extensions.py +0 -0
  48. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/lx_nillable.py +0 -0
  49. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/lx_serializer.py +0 -0
  50. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/lx_union.py +0 -0
  51. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/metadata_type_info_cache.py +0 -0
  52. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/number_formatting.py +0 -0
  53. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/py.typed +0 -0
  54. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/qname.py +0 -0
  55. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/__init__.py +0 -0
  56. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/conversion_error_type.py +0 -0
  57. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/conversion_result.py +0 -0
  58. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/metadata_class.py +0 -0
  59. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/metadata_class_compositor.py +0 -0
  60. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/metadata_class_container.py +0 -0
  61. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/metadata_class_union.py +0 -0
  62. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/schema_model/parsed_simple_type_data.py +0 -0
  63. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer/__init__.py +0 -0
  64. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer/class_element_writers.py +0 -0
  65. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer/document_writer.py +0 -0
  66. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer/element_writers.py +0 -0
  67. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer/lx_writer.py +0 -0
  68. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer/namespace_manager.py +0 -0
  69. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer/writer_factory.py +0 -0
  70. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/serializer_base.py +0 -0
  71. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/string_utilities.py +0 -0
  72. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/types/__init__.py +0 -0
  73. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/types/lx_date_time.py +0 -0
  74. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/types/lx_duration.py +0 -0
  75. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/whitespace_utilities.py +0 -0
  76. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xml/__init__.py +0 -0
  77. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xml/x_element.py +0 -0
  78. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xml/xml_reader.py +0 -0
  79. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xml/xml_writer.py +0 -0
  80. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xsd_names.py +0 -0
  81. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xsd_regex.py +0 -0
  82. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xsd_type_info.py +0 -0
  83. {liquid_xml_objects_runtime-21.6.2/src/liquid_xml_objects → liquid_xml_objects_runtime-21.6.4/src/liquid_xml_objects_runtime}/xsd_value_comparer.py +0 -0
  84. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/__init__.py +0 -0
  85. {liquid_xml_objects_runtime-21.6.2 → liquid_xml_objects_runtime-21.6.4}/tests/models/__init__.py +0 -0
@@ -5,13 +5,13 @@ name: Build and publish
5
5
  # It checks the code (lint, types, tests) and builds the distribution, which is attached to the run as the artifact 'dist'. Then, if you ask for them :
6
6
  # publish uploads the distribution to the package index
7
7
  # github_release creates the GitHub release (and the tag) v<version> with the distribution attached
8
- # The version is the one in src/liquid_xml_objects/_version.py (the only place it is written), change it before you publish :
8
+ # The version is the one in src/liquid_xml_objects_runtime/_version.py (the only place it is written), change it before you publish :
9
9
  # an index does not accept the same version twice.
10
10
  #
11
11
  # Configuration (repository settings > Secrets and variables > Actions)
12
12
  # Variables
13
13
  # PYPI_REPOSITORY_URL where to publish, i.e. https://test.pypi.org/legacy/ (https://upload.pypi.org/legacy/ for the real PyPI)
14
- # PYPI_PROJECT_URL optional, shown as the environment url, i.e. https://test.pypi.org/project/liquid-xml-objects/
14
+ # PYPI_PROJECT_URL optional, shown as the environment url, i.e. (https://test.pypi.org/project/liquid-xml-objects-runtime/ or https://pypi.org/project/liquid-xml-objects/)
15
15
  # Secrets
16
16
  # PYPI_API_TOKEN the API token for the index named by PYPI_REPOSITORY_URL (it must be a token of that index: a token from
17
17
  # pypi.org does not work on test.pypi.org, and a token limited to one project can only be created after
@@ -65,7 +65,7 @@ jobs:
65
65
  run: python -m pytest -q
66
66
  - name: Version
67
67
  id: version
68
- run: echo "version=$(python -c 'import liquid_xml_objects; print(liquid_xml_objects.__version__)')" >> "$GITHUB_OUTPUT"
68
+ run: echo "version=$(python -c 'import liquid_xml_objects_runtime; print(liquid_xml_objects_runtime.__version__)')" >> "$GITHUB_OUTPUT"
69
69
  - name: Build
70
70
  run: |
71
71
  python -m build
@@ -25,7 +25,7 @@ share/python-wheels/
25
25
  .installed.cfg
26
26
  *.egg
27
27
  MANIFEST
28
- src/liquid_xml_objects/_version.py
28
+ src/liquid_xml_objects_runtime/_version.py
29
29
 
30
30
  # PyInstaller
31
31
  # Usually these files are written by a python script from a template
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: liquid-xml-objects-runtime
3
- Version: 21.6.2
3
+ Version: 21.6.4
4
4
  Summary: Liquid XML Objects runtime for Python: read and write XML as typed Python objects generated from an XSD.
5
5
  Author: Liquid Technologies Ltd
6
6
  License: LIQUID TECHNOLOGIES LIMITED END-USER LICENSE AGREEMENT FOR LIQUID STUDIO AND LIQUID XML DATA BINDER
@@ -88,7 +88,7 @@ Description-Content-Type: text/markdown
88
88
 
89
89
  # Liquid XML Objects for Python
90
90
 
91
- Read and write XML as typed Python objects. The classes are generated from an XSD, and the runtime (`liquid_xml_objects`) turns them into
91
+ Read and write XML as typed Python objects. The classes are generated from an XSD, and the runtime (`liquid_xml_objects_runtime`) turns them into
92
92
  XML and back again, validating the data against the schema (facets, cardinality, `xs:choice`, `xs:alternative`, `xsi:nil`, `xsi:type` ...).
93
93
 
94
94
  This is a port of the C# `LiquidTechnologies.XmlObjects.Runtime`, the classes have the same names (in Python style) wherever that makes sense.
@@ -129,8 +129,8 @@ LxGen /Language:Python /OutputFolder:out /OutputNamespace:my_company.bookstore b
129
129
  | `README.md`, `.gitignore` | How to set the project up, test, check and build it |
130
130
 
131
131
  The two differ in the `pyproject.toml` (`setuptools.build_meta` or `hatchling.build` as the build backend, with the configuration of that tool) and in how the environments are managed (tox, or hatch).
132
- The runtime is installed with `pip install -i https://test.pypi.org/simple/ liquid-xml-objects`, then `pip install -e ".[dev]"` installs the project and the development tools.
133
- The project depends on `liquid-xml-objects~=X.Y.Z`, the version of the generator, because the runtime only works with code generated by the same major and minor version.
132
+ `pip install -e ".[dev]"` installs the project and the development tools, and with them the runtime (`pip install liquid-xml-objects-runtime`, which is imported as `liquid_xml_objects_runtime`).
133
+ The project depends on `liquid-xml-objects-runtime~=X.Y.Z`, the version of the generator, because the runtime only works with code generated by the same major and minor version.
134
134
  The tests that read and write XML need the license to be chosen with `LIQUID_XML_OBJECTS_LICENSE=agpl` (or `commercial`), otherwise they are skipped.
135
135
 
136
136
  All the schemas are generated into a single module (a base class has to be declared before the classes derived from it, and schemas often refer
@@ -142,19 +142,19 @@ The library can not be used until you have registered the license it is used und
142
142
  the first `serialize` / `deserialize`), otherwise a `LxLicenseException` is raised that explains what to do and summarizes the AGPL terms:
143
143
 
144
144
  ```python
145
- import liquid_xml_objects
145
+ import liquid_xml_objects_runtime
146
146
 
147
147
  # Open source use, under the terms of the GNU Affero General Public License v3 (AGPL-3.0)
148
- liquid_xml_objects.register_liquid_xml_object_license_agpl()
148
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()
149
149
 
150
150
  # or, with a commercial license
151
- liquid_xml_objects.register_liquid_xml_object_license_commercial("My Company Ltd", "<license key>")
151
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial("My Company Ltd", "<license key>")
152
152
  ```
153
153
 
154
154
  ## Using the classes
155
155
 
156
156
  ```python
157
- from liquid_xml_objects import LxSerializer
157
+ from liquid_xml_objects_runtime import LxSerializer
158
158
  import my_company.bookstore as bookstore
159
159
 
160
160
  serializer = LxSerializer(bookstore)
@@ -180,7 +180,7 @@ collect the errors and carry on, the handler is called with `(message, severity,
180
180
  `(message, severity, error_code, target_object)` when writing:
181
181
 
182
182
  ```python
183
- from liquid_xml_objects import LxReaderSettings
183
+ from liquid_xml_objects_runtime import LxReaderSettings
184
184
 
185
185
  errors = []
186
186
  settings = LxReaderSettings()
@@ -253,12 +253,13 @@ The packages are written to `RegressionTests/Temp/Python`.
253
253
 
254
254
  The version is not written in the code, it is taken from the git tag when the package is built (hatch-vcs). The tag `v21.5.8` is version `21.5.8`. A commit that is not
255
255
  a tag has a development version (`21.5.9.dev3+gabc1234`), which can be built and tested but not published (an index does not accept a version twice either).
256
- `src/liquid_xml_objects/_version.py` is written by the build and is not kept in git, in development run `uv build` (or `pip install -e .`) to re-create it.
256
+ `src/liquid_xml_objects_runtime/_version.py` is written by the build and is not kept in git, in development run `uv build` (or `pip install -e .`) to re-create it.
257
257
 
258
258
  To make a release, create a tag and push it. The workflow *Build and publish* then runs on its own, it checks the code, builds the distribution, uploads it to the package index
259
259
  (`PYPI_REPOSITORY_URL`, see the comments in `.github/workflows/release.yml` for the secrets), and creates the GitHub release for the tag with the distribution attached.
260
260
 
261
261
  ```
262
+ git pull
262
263
  git tag v21.5.8
263
264
  git push origin v21.5.8
264
265
  ```
@@ -1,6 +1,6 @@
1
1
  # Liquid XML Objects for Python
2
2
 
3
- Read and write XML as typed Python objects. The classes are generated from an XSD, and the runtime (`liquid_xml_objects`) turns them into
3
+ Read and write XML as typed Python objects. The classes are generated from an XSD, and the runtime (`liquid_xml_objects_runtime`) turns them into
4
4
  XML and back again, validating the data against the schema (facets, cardinality, `xs:choice`, `xs:alternative`, `xsi:nil`, `xsi:type` ...).
5
5
 
6
6
  This is a port of the C# `LiquidTechnologies.XmlObjects.Runtime`, the classes have the same names (in Python style) wherever that makes sense.
@@ -41,8 +41,8 @@ LxGen /Language:Python /OutputFolder:out /OutputNamespace:my_company.bookstore b
41
41
  | `README.md`, `.gitignore` | How to set the project up, test, check and build it |
42
42
 
43
43
  The two differ in the `pyproject.toml` (`setuptools.build_meta` or `hatchling.build` as the build backend, with the configuration of that tool) and in how the environments are managed (tox, or hatch).
44
- The runtime is installed with `pip install -i https://test.pypi.org/simple/ liquid-xml-objects`, then `pip install -e ".[dev]"` installs the project and the development tools.
45
- The project depends on `liquid-xml-objects~=X.Y.Z`, the version of the generator, because the runtime only works with code generated by the same major and minor version.
44
+ `pip install -e ".[dev]"` installs the project and the development tools, and with them the runtime (`pip install liquid-xml-objects-runtime`, which is imported as `liquid_xml_objects_runtime`).
45
+ The project depends on `liquid-xml-objects-runtime~=X.Y.Z`, the version of the generator, because the runtime only works with code generated by the same major and minor version.
46
46
  The tests that read and write XML need the license to be chosen with `LIQUID_XML_OBJECTS_LICENSE=agpl` (or `commercial`), otherwise they are skipped.
47
47
 
48
48
  All the schemas are generated into a single module (a base class has to be declared before the classes derived from it, and schemas often refer
@@ -54,19 +54,19 @@ The library can not be used until you have registered the license it is used und
54
54
  the first `serialize` / `deserialize`), otherwise a `LxLicenseException` is raised that explains what to do and summarizes the AGPL terms:
55
55
 
56
56
  ```python
57
- import liquid_xml_objects
57
+ import liquid_xml_objects_runtime
58
58
 
59
59
  # Open source use, under the terms of the GNU Affero General Public License v3 (AGPL-3.0)
60
- liquid_xml_objects.register_liquid_xml_object_license_agpl()
60
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()
61
61
 
62
62
  # or, with a commercial license
63
- liquid_xml_objects.register_liquid_xml_object_license_commercial("My Company Ltd", "<license key>")
63
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial("My Company Ltd", "<license key>")
64
64
  ```
65
65
 
66
66
  ## Using the classes
67
67
 
68
68
  ```python
69
- from liquid_xml_objects import LxSerializer
69
+ from liquid_xml_objects_runtime import LxSerializer
70
70
  import my_company.bookstore as bookstore
71
71
 
72
72
  serializer = LxSerializer(bookstore)
@@ -92,7 +92,7 @@ collect the errors and carry on, the handler is called with `(message, severity,
92
92
  `(message, severity, error_code, target_object)` when writing:
93
93
 
94
94
  ```python
95
- from liquid_xml_objects import LxReaderSettings
95
+ from liquid_xml_objects_runtime import LxReaderSettings
96
96
 
97
97
  errors = []
98
98
  settings = LxReaderSettings()
@@ -165,12 +165,13 @@ The packages are written to `RegressionTests/Temp/Python`.
165
165
 
166
166
  The version is not written in the code, it is taken from the git tag when the package is built (hatch-vcs). The tag `v21.5.8` is version `21.5.8`. A commit that is not
167
167
  a tag has a development version (`21.5.9.dev3+gabc1234`), which can be built and tested but not published (an index does not accept a version twice either).
168
- `src/liquid_xml_objects/_version.py` is written by the build and is not kept in git, in development run `uv build` (or `pip install -e .`) to re-create it.
168
+ `src/liquid_xml_objects_runtime/_version.py` is written by the build and is not kept in git, in development run `uv build` (or `pip install -e .`) to re-create it.
169
169
 
170
170
  To make a release, create a tag and push it. The workflow *Build and publish* then runs on its own, it checks the code, builds the distribution, uploads it to the package index
171
171
  (`PYPI_REPOSITORY_URL`, see the comments in `.github/workflows/release.yml` for the secrets), and creates the GitHub release for the tag with the distribution attached.
172
172
 
173
173
  ```
174
+ git pull
174
175
  git tag v21.5.8
175
176
  git push origin v21.5.8
176
177
  ```
@@ -21,13 +21,13 @@ dependencies = []
21
21
  source = "vcs" # get it from git
22
22
 
23
23
  [tool.hatch.build.hooks.vcs]
24
- version-file = "src/liquid_xml_objects/_version.py" # write it into the package at build time
24
+ version-file = "src/liquid_xml_objects_runtime/_version.py" # write it into the package at build time
25
25
 
26
26
  [tool.setuptools.packages.find]
27
27
  where = ["src"]
28
28
 
29
29
  [tool.setuptools.package-data]
30
- liquid_xml_objects = ["py.typed"]
30
+ liquid_xml_objects_runtime = ["py.typed"]
31
31
 
32
32
  [tool.pytest.ini_options]
33
33
  testpaths = ["tests"]
@@ -2,7 +2,7 @@
2
2
 
3
3
  Generate the classes from a schema with the Liquid XML Objects generator (``LxGen -L:Python``), then::
4
4
 
5
- from liquid_xml_objects import LxSerializer
5
+ from liquid_xml_objects_runtime import LxSerializer
6
6
  import my_generated_package
7
7
 
8
8
  serializer = LxSerializer(my_generated_package)
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '21.6.2'
22
- __version_tuple__ = version_tuple = (21, 6, 2)
21
+ __version__ = version = '21.6.4'
22
+ __version_tuple__ = version_tuple = (21, 6, 4)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -2,7 +2,7 @@
2
2
 
3
3
  Generated code uses it like this::
4
4
 
5
- from liquid_xml_objects import attribution as lx
5
+ from liquid_xml_objects_runtime import attribution as lx
6
6
 
7
7
  @lx.simple_element_definition("Book", "urn:books", lx.ElementScopeType.GLOBAL_ELEMENT)
8
8
  @dataclass(kw_only=True)
@@ -27,7 +27,7 @@ if TYPE_CHECKING:
27
27
  from ..schema_model.parsed_simple_type_data import ParsedSimpleTypeData
28
28
  from ..serializer_base import Serializer
29
29
 
30
- LX_METADATA_KEY = "liquid_xml_objects"
30
+ LX_METADATA_KEY = "liquid_xml_objects_runtime"
31
31
  """The key of the attribute object in a dataclass field's ``metadata``."""
32
32
 
33
33
  TypeRef = type | Callable[[], type] | None
@@ -672,7 +672,7 @@ def simple_type_definition(name: str, namespace: str, base_type: XsdType = XsdTy
672
672
 
673
673
 
674
674
  def union_definition(*members: LxUnionAttribute) -> Callable[[type], type]:
675
- """Marks a subclass of :class:`~liquid_xml_objects.lx_union.LxUnion` as an xs:union of the given types."""
675
+ """Marks a subclass of :class:`~liquid_xml_objects_runtime.lx_union.LxUnion` as an xs:union of the given types."""
676
676
 
677
677
  def decorate(cls: type) -> type:
678
678
  for member in members:
@@ -1,7 +1,7 @@
1
1
  """Conversion of the text of XML values to python values, for each XSD built in type (C#: ConvertStringToXsd).
2
2
 
3
3
  Every ``try_parse_*`` function returns the value, or ``None`` if the text is not valid for the type (``None`` is never a valid value).
4
- :func:`try_parse` picks the function from an :class:`~liquid_xml_objects.attribution.enums.XsdType`.
4
+ :func:`try_parse` picks the function from an :class:`~liquid_xml_objects_runtime.attribution.enums.XsdType`.
5
5
  """
6
6
 
7
7
  from __future__ import annotations
@@ -377,7 +377,7 @@ _PARSERS: dict[XsdType, Callable[[str], object]] = {
377
377
 
378
378
 
379
379
  def try_parse(xsd_type: XsdType, text: str) -> object:
380
- """Parses the text as the XSD type. Returns the value (see :func:`~liquid_xml_objects.xsd_type_info.to_native_type`) or ``None``."""
380
+ """Parses the text as the XSD type. Returns the value (see :func:`~liquid_xml_objects_runtime.xsd_type_info.to_native_type`) or ``None``."""
381
381
  try:
382
382
  parser = _PARSERS[xsd_type]
383
383
  except KeyError:
@@ -2,11 +2,11 @@
2
2
 
3
3
  The library can not be used until one of the ``register_liquid_xml_object_license_*`` functions has been called, once, when the program starts::
4
4
 
5
- import liquid_xml_objects
5
+ import liquid_xml_objects_runtime
6
6
 
7
- liquid_xml_objects.register_liquid_xml_object_license_agpl()
7
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()
8
8
  # or
9
- liquid_xml_objects.register_liquid_xml_object_license_commercial("My Company Ltd", "XXXX-XXXX-XXXX-XXXX")
9
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial("My Company Ltd", "XXXX-XXXX-XXXX-XXXX")
10
10
  """
11
11
 
12
12
  from __future__ import annotations
@@ -90,15 +90,15 @@ def get_license_not_registered_message() -> str:
90
90
  "",
91
91
  " Open source (AGPL-3.0) :",
92
92
  "",
93
- " import liquid_xml_objects",
93
+ " import liquid_xml_objects_runtime",
94
94
  "",
95
- " liquid_xml_objects.register_liquid_xml_object_license_agpl()",
95
+ " liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()",
96
96
  "",
97
97
  " Commercial license :",
98
98
  "",
99
- " import liquid_xml_objects",
99
+ " import liquid_xml_objects_runtime",
100
100
  "",
101
- ' liquid_xml_objects.register_liquid_xml_object_license_commercial("<licensee>", "<license key>")',
101
+ ' liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial("<licensee>", "<license key>")',
102
102
  "",
103
103
  line,
104
104
  " The AGPL-3.0 license, in summary (this is not legal advice, the full text is at " + AGPL_URL + ")",
@@ -9,7 +9,7 @@ from .errors import LxErrorCode, LxErrorSeverity, LxInvalidAttributionException,
9
9
  from .lx_settings import LxSettings
10
10
  from .qname import XmlQualifiedName
11
11
 
12
- _log = logging.getLogger("liquid_xml_objects")
12
+ _log = logging.getLogger("liquid_xml_objects_runtime")
13
13
 
14
14
  LxDeserializerErrorHandler = Callable[[str, LxErrorSeverity, LxErrorCode, TextLocation | None, object], None]
15
15
  """``handler(message, severity, error_code, location, target_object)``. If it returns, the error is ignored and reading continues."""
@@ -6,7 +6,7 @@ from datetime import timezone, tzinfo
6
6
 
7
7
 
8
8
  class LxSettings:
9
- """The base of :class:`~liquid_xml_objects.lx_reader_settings.LxReaderSettings` and :class:`~liquid_xml_objects.lx_writer_settings.LxWriterSettings`."""
9
+ """The base of :class:`~liquid_xml_objects_runtime.lx_reader_settings.LxReaderSettings` and :class:`~liquid_xml_objects_runtime.lx_writer_settings.LxWriterSettings`."""
10
10
 
11
11
  def __init__(self) -> None:
12
12
  self.default_time_zone: tzinfo = timezone.utc
@@ -9,7 +9,7 @@ from enum import Enum
9
9
  from .errors import LxErrorCode, LxErrorSeverity, LxSerializationException
10
10
  from .lx_settings import LxSettings
11
11
 
12
- _log = logging.getLogger("liquid_xml_objects")
12
+ _log = logging.getLogger("liquid_xml_objects_runtime")
13
13
 
14
14
  LxSerializerErrorHandler = Callable[[str, LxErrorSeverity, LxErrorCode, object], None]
15
15
  """``handler(message, severity, error_code, target_object)``. If it returns, the error is ignored and writing continues."""
@@ -1,7 +1,7 @@
1
1
  """Helpers for finding the attributed properties of a generated class (C#: MetaDataExtensions).
2
2
 
3
3
  The C# runtime finds the attributes by reflection over the properties. Here the properties are the fields of a dataclass, and the attribute of
4
- each field is in its ``metadata`` (see :mod:`liquid_xml_objects.attribution.attributes`).
4
+ each field is in its ``metadata`` (see :mod:`liquid_xml_objects_runtime.attribution.attributes`).
5
5
  """
6
6
 
7
7
  from __future__ import annotations
@@ -6,7 +6,7 @@ from collections.abc import Iterator
6
6
 
7
7
  import pytest
8
8
 
9
- from liquid_xml_objects import licensing
9
+ from liquid_xml_objects_runtime import licensing
10
10
 
11
11
 
12
12
  @pytest.fixture(autouse=True)
@@ -5,9 +5,9 @@ from __future__ import annotations
5
5
  from dataclasses import dataclass
6
6
  from decimal import Decimal
7
7
 
8
- from liquid_xml_objects import UNBOUNDED, LxDateTime, XAttribute, XElement, __version__
9
- from liquid_xml_objects import attribution as lx
10
- from liquid_xml_objects.attribution import ElementScopeType, LxValueType, XsdType
8
+ from liquid_xml_objects_runtime import UNBOUNDED, LxDateTime, XAttribute, XElement, __version__
9
+ from liquid_xml_objects_runtime import attribution as lx
10
+ from liquid_xml_objects_runtime.attribution import ElementScopeType, LxValueType, XsdType
11
11
 
12
12
  BS_NS = "http://www.liquid-technologies.com/sample/bookstore"
13
13
  OTHER_NS = "http://test/other"
@@ -76,7 +76,7 @@ def worker(folder: Path) -> int:
76
76
 
77
77
  sys.path.insert(0, str(RUNTIME_DIR / "src"))
78
78
  sys.path.insert(0, str(folder / "src"))
79
- from liquid_xml_objects import (
79
+ from liquid_xml_objects_runtime import (
80
80
  LxException,
81
81
  LxInvalidAttributionException,
82
82
  LxReaderSettings,
@@ -7,9 +7,9 @@ from decimal import Decimal
7
7
 
8
8
  import pytest
9
9
 
10
- from liquid_xml_objects import convert_string_to_xsd as conv
11
- from liquid_xml_objects.attribution import XsdType
12
- from liquid_xml_objects.convert_string_to_xsd import try_parse
10
+ from liquid_xml_objects_runtime import convert_string_to_xsd as conv
11
+ from liquid_xml_objects_runtime.attribution import XsdType
12
+ from liquid_xml_objects_runtime.convert_string_to_xsd import try_parse
13
13
 
14
14
 
15
15
  def valid(xsd_type: XsdType, text: str, expected: object) -> None:
@@ -4,8 +4,8 @@ from __future__ import annotations
4
4
 
5
5
  import pytest
6
6
 
7
- import liquid_xml_objects
8
- from liquid_xml_objects import LxLicenseException, LxSerializer, XmlReader, licensing
7
+ import liquid_xml_objects_runtime
8
+ from liquid_xml_objects_runtime import LxLicenseException, LxSerializer, XmlReader, licensing
9
9
  from tests.models import bookstore as bs
10
10
 
11
11
  XML = f'<Company xmlns="{bs.BS_NS}"><Catalog /></Company>'
@@ -17,8 +17,8 @@ def unregistered() -> None:
17
17
 
18
18
 
19
19
  def test_the_registration_functions_are_exported() -> None:
20
- assert callable(liquid_xml_objects.register_liquid_xml_object_license_agpl)
21
- assert callable(liquid_xml_objects.register_liquid_xml_object_license_commercial)
20
+ assert callable(liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl)
21
+ assert callable(liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial)
22
22
 
23
23
 
24
24
  @pytest.mark.usefixtures("unregistered")
@@ -28,8 +28,8 @@ def test_deserializing_without_a_license_explains_how_to_register() -> None:
28
28
  serializer.deserialize_from_string(XML)
29
29
  message = str(info.value)
30
30
  assert "NO LICENSE HAS BEEN REGISTERED" in message
31
- assert "liquid_xml_objects.register_liquid_xml_object_license_agpl()" in message
32
- assert 'liquid_xml_objects.register_liquid_xml_object_license_commercial("<licensee>", "<license key>")' in message
31
+ assert "liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()" in message
32
+ assert 'liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial("<licensee>", "<license key>")' in message
33
33
  assert "Affero" in message
34
34
  assert "source code" in message
35
35
 
@@ -46,14 +46,14 @@ def test_every_entry_point_checks_the_license() -> None:
46
46
  serializer.deserialize_snippet(XmlReader.from_string(XML), bs.CompanyElm)
47
47
  with pytest.raises(LxLicenseException):
48
48
  serializer.serialize_snippet(
49
- company, liquid_xml_objects.XmlWriter(), bs.CompanyElm, liquid_xml_objects.XmlQualifiedName("Company", bs.BS_NS)
49
+ company, liquid_xml_objects_runtime.XmlWriter(), bs.CompanyElm, liquid_xml_objects_runtime.XmlQualifiedName("Company", bs.BS_NS)
50
50
  )
51
51
 
52
52
 
53
53
  @pytest.mark.usefixtures("unregistered")
54
54
  def test_agpl_registration_enables_the_library() -> None:
55
55
  serializer = LxSerializer(bs)
56
- liquid_xml_objects.register_liquid_xml_object_license_agpl()
56
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()
57
57
  assert serializer.deserialize_from_string(XML) is not None
58
58
  registration = licensing.get_registered_license()
59
59
  assert registration is not None
@@ -62,7 +62,7 @@ def test_agpl_registration_enables_the_library() -> None:
62
62
 
63
63
  @pytest.mark.usefixtures("unregistered")
64
64
  def test_commercial_registration_enables_the_library() -> None:
65
- liquid_xml_objects.register_liquid_xml_object_license_commercial(" My Company Ltd ", "ABCD-1234")
65
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial(" My Company Ltd ", "ABCD-1234")
66
66
  assert LxSerializer(bs).deserialize_from_string(XML) is not None
67
67
  registration = licensing.get_registered_license()
68
68
  assert registration == licensing.LicenseRegistration(licensing.LicenseType.COMMERCIAL, "My Company Ltd", "ABCD-1234")
@@ -72,12 +72,12 @@ def test_commercial_registration_enables_the_library() -> None:
72
72
  @pytest.mark.parametrize(("licensee", "key"), [("", "key"), (" ", "key"), ("me", ""), ("me", " ")])
73
73
  def test_commercial_registration_requires_a_licensee_and_key(licensee: str, key: str) -> None:
74
74
  with pytest.raises(ValueError):
75
- liquid_xml_objects.register_liquid_xml_object_license_commercial(licensee, key)
75
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_commercial(licensee, key)
76
76
  assert licensing.get_registered_license() is None
77
77
 
78
78
 
79
79
  @pytest.mark.usefixtures("unregistered")
80
80
  def test_registering_more_than_once_is_harmless() -> None:
81
- liquid_xml_objects.register_liquid_xml_object_license_agpl()
82
- liquid_xml_objects.register_liquid_xml_object_license_agpl()
81
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()
82
+ liquid_xml_objects_runtime.register_liquid_xml_object_license_agpl()
83
83
  assert LxSerializer(bs).deserialize_from_string(XML) is not None
@@ -7,7 +7,7 @@ import struct
7
7
 
8
8
  import pytest
9
9
 
10
- from liquid_xml_objects.number_formatting import format_double, format_float
10
+ from liquid_xml_objects_runtime.number_formatting import format_double, format_float
11
11
 
12
12
 
13
13
  def as_float32(value: float) -> float:
@@ -8,9 +8,9 @@ from collections.abc import Iterator
8
8
 
9
9
  import pytest
10
10
 
11
- from liquid_xml_objects import LxInvalidAttributionException, LxSerializer, __version__
12
- from liquid_xml_objects import attribution as lx
13
- from liquid_xml_objects.attribution import attributes
11
+ from liquid_xml_objects_runtime import LxInvalidAttributionException, LxSerializer, __version__
12
+ from liquid_xml_objects_runtime import attribution as lx
13
+ from liquid_xml_objects_runtime.attribution import attributes
14
14
  from tests.models import bookstore as bs
15
15
 
16
16
 
@@ -9,7 +9,7 @@ from xml.etree import ElementTree as ET
9
9
 
10
10
  import pytest
11
11
 
12
- from liquid_xml_objects import (
12
+ from liquid_xml_objects_runtime import (
13
13
  LxDateTime,
14
14
  LxErrorCode,
15
15
  LxErrorSeverity,
@@ -403,7 +403,7 @@ def test_read_simple_model_accepts_elements_in_any_order(serializer: LxSerialize
403
403
 
404
404
 
405
405
  def test_read_wrong_root_element_and_namespace(serializer: LxSerializer) -> None:
406
- from liquid_xml_objects import LxException
406
+ from liquid_xml_objects_runtime import LxException
407
407
 
408
408
  with pytest.raises(LxException, match="NotCompany"):
409
409
  serializer.deserialize_from_string(f'<NotCompany xmlns="{BS_NS}"><Catalog /></NotCompany>')
@@ -412,7 +412,7 @@ def test_read_wrong_root_element_and_namespace(serializer: LxSerializer) -> None
412
412
 
413
413
 
414
414
  def test_read_malformed_xml(serializer: LxSerializer) -> None:
415
- from liquid_xml_objects import LxException
415
+ from liquid_xml_objects_runtime import LxException
416
416
 
417
417
  with pytest.raises(LxException):
418
418
  serializer.deserialize_from_string(f'<Company xmlns="{BS_NS}"><Catalog></Company>')
@@ -1,17 +1,17 @@
1
- """The version is written once (src/liquid_xml_objects/_version.py), everything else takes it from there."""
1
+ """The version is written once (src/liquid_xml_objects_runtime/_version.py), everything else takes it from there."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
5
  import re
6
6
  from pathlib import Path
7
7
 
8
- import liquid_xml_objects
9
- from liquid_xml_objects import _version
10
- from liquid_xml_objects.lx_serializer import VERSION, LxSerializer
8
+ import liquid_xml_objects_runtime
9
+ from liquid_xml_objects_runtime import _version
10
+ from liquid_xml_objects_runtime.lx_serializer import VERSION, LxSerializer
11
11
 
12
12
 
13
13
  def test_the_package_and_the_serializer_have_the_version_from_the_version_file() -> None:
14
- assert liquid_xml_objects.__version__ == _version.__version__
14
+ assert liquid_xml_objects_runtime.__version__ == _version.__version__
15
15
  # assert _version.__version__ == VERSION
16
16
  assert LxSerializer.version() == VERSION # _version.__version__
17
17
 
@@ -4,9 +4,9 @@ from __future__ import annotations
4
4
 
5
5
  import pytest
6
6
 
7
- from liquid_xml_objects import whitespace_utilities as ws
8
- from liquid_xml_objects.attribution import WhiteSpaceType
9
- from liquid_xml_objects.xsd_regex import XsdRegex, XsdRegexError, translate
7
+ from liquid_xml_objects_runtime import whitespace_utilities as ws
8
+ from liquid_xml_objects_runtime.attribution import WhiteSpaceType
9
+ from liquid_xml_objects_runtime.xsd_regex import XsdRegex, XsdRegexError, translate
10
10
 
11
11
 
12
12
  def test_preserve_leaves_the_text_alone() -> None: