Skip to content

Commit

Permalink
Preparing v20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tefra committed Jun 1, 2021
1 parent d7a498f commit 5bf4a87
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: tests/fixtures

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.19.0
rev: v2.19.1
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand Down
26 changes: 26 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
21.6 (2021-06-01)
-----------------
- Fixed no args Dict annotation, raising an exception `#494 <https://github.com/tefra/xsdata/issues/494>`_
- Fixed original name case not working for field names `#498 <https://github.com/tefra/xsdata/issues/498>`_
- Fixed element type resolution with duplicate name conflicts `#503 <https://github.com/tefra/xsdata/issues/503>`_
- Added handler to flatten bare inner classes
- Added the ability for custom types to subclass named tuples
- Added keyword meta in the reserved words `#491 <https://github.com/tefra/xsdata/issues/491>`_
- Added new xml type `Ignore` to skip fields during binding `#504 <https://github.com/tefra/xsdata/issues/504>`_
- Updated generic model DerivedElement.substituted flag with xsi:type
- Updated core components to improve binding performance

- Converted almost all internal dataclasses to simple objects with __slots__
- Converted the internal xml date/time types to named tuples
- Reduced models metadata lookup times and memory footprint

- Updated JSON parser `#495 <https://github.com/tefra/xsdata/issues/495>`_

- Support failing on unknown properties
- Support required properties
- Support parser config
- Stricter binding process
- Enhance DerivedElement support
- Moved Definitive XML Schema tests to the samples repository


21.5 (2021-05-07)
-----------------
- Added output structure style single-package `#469 <https://github.com/tefra/xsdata/issues/469>`_
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ recursive-include xsdata *

prune docs/_build
prune docs/api/reference
prune docs/demo
exclude .readthedocs.yml
exclude .pre-commit-config.yaml

Expand Down
36 changes: 22 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,26 @@ Features
- Customize behaviour through config


Changelog: 21.5 (2021-05-07)
Changelog: 21.6 (2021-06-01)
----------------------------
- Added output structure style single-package `#469 <https://github.com/tefra/xsdata/issues/469>`_
- Added support for marshalling array of objects for json `#448 <https://github.com/tefra/xsdata/issues/448>`_
- Added support to generate code from raw json documents `#445 <https://github.com/tefra/xsdata/issues/445>`_
- Added docstring style Blank to avoid generating them `#460 <https://github.com/tefra/xsdata/issues/460>`_
- Added validations for non supported type hints
- Added support for python 3.10
- Generate package __all__ lists `#459 <https://github.com/tefra/xsdata/issues/459>`_
- Generate factory for xs:list enumeration default values `#471 <https://github.com/tefra/xsdata/issues/471>`_
- Avoid generating prohibited elements with maxOccurs==0 `#478 <https://github.com/tefra/xsdata/issues/478>`_
- Avoid generating identical overriding fields `#466 <https://github.com/tefra/xsdata/issues/466>`_
- Fixed flattening base classes if they are also subclasses `#473 <https://github.com/tefra/xsdata/issues/473>`_
- Fixed unchecked class name conflict resolution `#457 <https://github.com/tefra/xsdata/issues/457>`_
- Refactored context components to improve binding performance `#476 <https://github.com/tefra/xsdata/issues/476>`_
- Fixed no args Dict annotation, raising an exception `#494 <https://github.com/tefra/xsdata/issues/494>`_
- Fixed original name case not working for field names `#498 <https://github.com/tefra/xsdata/issues/498>`_
- Fixed element type resolution with duplicate name conflicts `#503 <https://github.com/tefra/xsdata/issues/503>`_
- Added handler to flatten bare inner classes
- Added the ability for custom types to subclass named tuples
- Added keyword meta in the reserved words `#491 <https://github.com/tefra/xsdata/issues/491>`_
- Added new xml type `Ignore` to skip fields during binding `#504 <https://github.com/tefra/xsdata/issues/504>`_
- Updated generic model DerivedElement.substituted flag with xsi:type
- Updated core components to improve binding performance

- Converted almost all internal dataclasses to simple objects with __slots__
- Converted the internal xml date/time types to named tuples
- Reduced models metadata lookup times and memory footprint

- Updated JSON parser `#495 <https://github.com/tefra/xsdata/issues/495>`_

- Support failing on unknown properties
- Support required properties
- Support parser config
- Stricter binding process
- Enhance DerivedElement support
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = xsdata
version = 21.5
version = 21.6
description = Python XML Binding
long_description = file: README.rst
long_description_content_type = text/x-rst
Expand Down
75 changes: 37 additions & 38 deletions xsdata/formats/dataclass/models/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,28 @@ def __repr__(self) -> str:


class XmlVar(MetaMixin):
"""Class field binding metadata."""
"""
Class field binding metadata.
:param index: Field ordering
:param name: Field name
:param qname: Qualified name
:param types: List of all the supported data types
:param init: Include field in the constructor
:param mixed: Field supports mixed content type values
:param tokens: Field is derived from xs:list
:param format: Value format information
:param derived: Wrap parsed values with a generic type
:param any_type: Field supports dynamic value types
:param nillable: Field supports nillable content
:param sequential: Render values in sequential mode
:param list_element: Field is a list of elements
:param default: Field default value or factory
:param xml_Type: Field xml type
:param namespaces: List of the supported namespaces
:param elements: Mapping of qname-repeatable elements
:param wildcards: List of repeatable wildcards
"""

__slots__ = (
"index",
Expand Down Expand Up @@ -107,27 +128,6 @@ def __init__(
wildcards: Sequence["XmlVar"],
**kwargs: Any,
):
"""
:param index: Field ordering
:param name: Field name
:param qname: Qualified name
:param types: List of all the supported data types
:param init: Include field in the constructor
:param mixed: Field supports mixed content type values
:param tokens: Field is derived from xs:list
:param format: Value format information
:param derived: Wrap parsed values with a generic type
:param any_type: Field supports dynamic value types
:param nillable: Field supports nillable content
:param sequential: Render values in sequential mode
:param list_element: Field is a list of elements
:param default: Field default value or factory
:param xml_Type: Field xml type
:param namespaces: List of the supported namespaces
:param elements: Mapping of qname-repeatable elements
:param wildcards: List of repeatable wildcards
"""

self.index = index
self.name = name
self.qname = qname
Expand Down Expand Up @@ -262,7 +262,21 @@ def _match_namespace(self, qname: str) -> bool:


class XmlMeta(MetaMixin):
"""Class binding metadata."""
"""
Class binding metadata.
:param clazz: The dataclass type
:param qname: The namespace qualified name.
:param source_qname: The source namespace qualified name.
:param nillable: Specifies whether an explicit empty value can be assigned.
:param mixed_content: Has a wildcard with mixed flag enabled
:param text: Text var
:param choices: List of compound vars
:param elements: Mapping of qname-element vars
:param wildcards: List of wildcard vars
:param attributes: Mapping of qname-attribute vars
:param any_attributes: List of wildcard attributes vars
"""

__slots__ = (
"clazz",
Expand Down Expand Up @@ -294,21 +308,6 @@ def __init__(
any_attributes: Sequence[XmlVar],
**kwargs: Any,
):

"""
:param clazz: The dataclass type
:param qname: The namespace qualified name.
:param source_qname: The source namespace qualified name.
:param nillable: Specifies whether an explicit empty value can be assigned.
:param mixed_content: Has a wildcard with mixed flag enabled
:param text: Text var
:param choices: List of compound vars
:param elements: Mapping of qname-element vars
:param wildcards: List of wildcard vars
:param attributes: Mapping of qname-attribute vars
:param any_attributes: List of wildcard attributes vars
"""

self.clazz = clazz
self.qname = qname
self.namespace = target_uri(qname)
Expand Down

0 comments on commit 5bf4a87

Please sign in to comment.