Skip to content

Commit

Permalink
Merge databind.core and databind.json into databind package (#61)
Browse files Browse the repository at this point in the history
* Merge `databind.core` and `databind.json` into `databind` package

* fmt

* move changelogs to root

* breaking change: Drop support for Python 3.6 and 3.7

* update docs

* update docs

* add repo_url/repo_name

* disable broken changelog-update job
  • Loading branch information
NiklasRosenstein authored Mar 19, 2024
1 parent a976fb2 commit acfc438
Show file tree
Hide file tree
Showing 156 changed files with 725 additions and 654 deletions.
22 changes: 22 additions & 0 deletions .changelog/0.10.0.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
release-date = "2020-12-30"

[[entries]]
id = "941943f9-5cf7-48fb-beea-2c341bc01907"
type = "improvement"
description = "classes decorated with `@uniontype(container=True)` must now be constructed using a single keyword argument as in `MyUnion(member1=Member1Value())`\n"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "0cb46581-98b5-40ad-82f1-eba64a2d498a"
type = "fix"
description = "add missing `to_stream` and `from_stream` to `__all__`"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "b65cd60e-3b8f-42c0-b4d8-37e5257bc269"
type = "feature"
description = "add `cast()` function"
author = "@NiklasRosenstein"
component = "databind.json"
20 changes: 19 additions & 1 deletion databind.core/.changelog/0.11.0.toml → .changelog/0.11.0.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
release-date = "2021-04-08"
release-date = "2021-03-05"

[[entries]]
id = "5fdfb706-e8fd-4277-a4fa-8bc9fd894336"
type = "feature"
description = "`enumerate_fields()` now works with uniontype instances and classes"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "58571d4d-65a2-46c7-949d-60f8eb219e56"
type = "improvement"
description = "update `@uniontype` generated `__repr__()` method"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "8585b0f1-6d33-4f1c-8637-c4186e456786"
type = "feature"
description = "add support for member aliasing in `UnionResolver`"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "9a23ae46-60fd-4f4f-950b-bb6966aa0003"
type = "feature"
description = "add `Context.closed_field_metadata()` function"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "65f5c1ef-ae7f-4802-af8c-c5e5460f602d"
type = "improvement"
description = "Update union construction during deserialization"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "779fedda-841f-4e00-bed0-e3ccab1ad836"
type = "improvement"
description = "minimum version of `databind.core` is `^0.10.0`"
author = "@NiklasRosenstein"
component = "databind.json"
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,39 @@ id = "f718e1bd-f235-4a48-81c4-379f5469c9de"
type = "feature"
description = "Add `uniontype(single_key_discriminator)` argument"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "6349c88c-cedf-4d8f-95f5-441ae9c96486"
type = "fix"
description = "Generated `__eq__()` method for `uniontype(container=True)` is now injective to avoid issue when `type(other)` is `object`"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "db67c3d6-80a9-4a61-af10-fc46bd505d6e"
type = "feature"
description = "add support for aliasing with `field(altname)` in `@uniontype` container declarations"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "8373fb43-05e2-469a-88df-76f7d6d0b083"
type = "feature"
description = "`StringConverter` can now also be relaxed, `FieldMetadata.relaxed` is now inherited from the closest metadata in the context for POD data types"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "55862c13-5599-4bb0-9f1d-d60300584e12"
type = "fix"
description = "deserializing a `List[str]` from a `str` object now results in an error"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "1ff62e50-8b99-4ee7-813b-f740870638a1"
type = "improvement"
description = "bump dependency on databind.core to ^0.11.0"
author = "@NiklasRosenstein"
component = "databind.json"
17 changes: 17 additions & 0 deletions databind.json/.changelog/0.2.0.toml → .changelog/0.2.0.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
release-date = "2020-08-29"

[[entries]]
id = "d54aa0ac-9329-4d2a-8e3a-16063491f764"
type = "improvement"
description = "update type hints to pass mypy checks"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "47206f43-6699-40ea-8210-c1a341d2b623"
type = "improvement"
description = "`FieldMetadata` now keeps a reference to the `dataclasses.Field` object and it's' metadata"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "3195561b-c5ed-4595-922b-9d76c46892f9"
type = "improvement"
description = "update type hints to pass mypy checks"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "c3458aff-e6b3-4b20-97b0-12882818b6db"
type = "improvement"
description = "add DEBUG log when `MixtypeConverter` is unable to convert a value at all to make debugging easier"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "37e0f485-54c0-4bcf-bd3e-082f629b8689"
type = "fix"
description = "accept `datetime.date`/`datetime.datetime` objects when converting to python if the target type is a respective match (rather than forcing a string as an input)"
author = "@NiklasRosenstein"
component = "databind.json"
9 changes: 9 additions & 0 deletions databind.core/.changelog/0.3.0.toml → .changelog/0.3.0.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ id = "27920260-c47e-4191-9f3a-5249584d28a3"
type = "improvement"
description = "ensure that non-default arguments do not have a class attribute of type `object` (which is used as a workaround to support non-default fields following default fields in `dataclasses`)"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "0d15905e-4810-4c08-a4d8-70aaa72ad4f0"
type = "fix"
description = "raise for uninitialized fields inherited from parent datamodels"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "71c62ec7-7d37-4461-96a3-217de03499de"
type = "improvement"
description = "`ArrayConverter` now supports subclasses of the `typing.List` generic"
author = "@NiklasRosenstein"
component = "databind.json"
10 changes: 10 additions & 0 deletions databind.core/.changelog/0.4.0.toml → .changelog/0.4.0.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@ id = "0522b7f0-4bc4-48c3-aa0a-fe3d3f96e5c5"
type = "feature"
description = "add `ModelMetadata.serialize_as` (which translates into a keyword argument for `@datamodel()`) to specify a type hint that should be used instead of the type itself when serializing/deserializing it"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "771ef7cd-2020-4504-b949-2cb0bfc08e35"
type = "feature"
description = "add `Context.coerce_errors()` context manager"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "30501a59-9860-4f3c-8ccb-d5883449f940"
type = "feature"
description = "add `TypeHint` variable which should be used in places where a type hint is expected"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "03524ec0-3644-4bd8-9a64-a1dc0e754fd7"
type = "feature"
description = "support `@datamodel(serialize_as)` in `ModelConverter`"
author = "@NiklasRosenstein"
component = "databind.json"
15 changes: 15 additions & 0 deletions .changelog/0.4.1.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
release-date = "2020-09-06"

[[entries]]
id = "8bc4f7c3-1a29-41f1-9f5d-f3f8a99897ca"
type = "fix"
description = "Re-render setup file, materializing missing dependency on `dataclasses`. This fixes using the module in Python 3.6."
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "7abbb43c-0eab-4009-9353-9de48aebc5b7"
type = "fix"
description = "conversion of values of a `List` subtype *from Python* are now converted to a built-in `list` instead of the same `List` subtype"
author = "@NiklasRosenstein"
component = "databind.json"
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ id = "6993c150-4320-4d1d-b8a9-d5763c326a34"
type = "hygiene"
description = "Move `type_repr()` declaration to `databind.core.utils` and add `find_orig_base()` function"
author = "@NiklasRosenstein"
component = "databind.core"
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ id = "bc123b73-f4d0-44a4-9e43-de56b776a7b6"
type = "feature"
description = "Add `strict` argument to `register_json_converters()` which will allow converters for plain-old-datatypes to accept string representations as well"
author = "@NiklasRosenstein"
component = "databind.json"
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ id = "c039776f-9ecc-460a-b5d4-b9cbc5bb1e46"
type = "fix"
description = "Fix Python 3.6 support for `typing.List` subclasses by reading the generic paraemter from the right object"
author = "@NiklasRosenstein"
component = "databind.json"
19 changes: 18 additions & 1 deletion databind.core/.changelog/0.6.0.toml → .changelog/0.6.0.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
release-date = "2020-09-14"
release-date = "2020-09-10"

[[entries]]
id = "da1141be-ec57-4d28-a50a-1158dca6107b"
type = "fix"
description = "`Registry.get_converter()` now looks for a converter in the base classes only if it could not find it for the normalized version of the current type, making converter resolution more predictable"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "df476ea6-934c-440c-92be-d41f4bc8422c"
type = "feature"
description = "Add `ClassUnionResolver` which evaluates type hints dynamically, allowing to use forward references in the type hints of a `@uniontype()`"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "65bd22be-4505-4b45-ad8a-b0f7f6307312"
type = "feature"
description = "Add `@interface()` and `@implementation()` decorators"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "cc7ad2d7-1ba6-428a-8f49-b7407ccdc505"
type = "feature"
description = "Add `to_stream()` and `from_stream()` functions"
author = "@NiklasRosenstein"
component = "databind.json"

[[entries]]
id = "bc0a165d-7868-415c-9b52-8f9ad9040cb9"
type = "feature"
description = "Add support for `typing.Dict` subclasses"
author = "@NiklasRosenstein"
component = "databind.json"
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ id = "b5991aa2-b0ba-4243-8529-5cb061c17cc4"
type = "fix"
description = "Fix `NameError` in `ObjectConverter`"
author = "@NiklasRosenstein"
component = "databind.json"
8 changes: 8 additions & 0 deletions databind.core/.changelog/0.7.0.toml → .changelog/0.7.0.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ id = "24bad1cf-e404-4c23-b6ad-e0b3499564c1"
type = "feature"
description = "`@dataclasses.dataclass()` classes can now be converted as a data model automatically, `BaseMetadata.for_type()` now returns an optional"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "b6a90864-ebc9-43fd-a909-4a88139eb2b7"
type = "feature"
description = "Now supports converting Sets"
author = "@NiklasRosenstein"
component = "databind.json"
9 changes: 9 additions & 0 deletions databind.core/.changelog/0.7.1.toml → .changelog/0.7.1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ id = "bc008cf1-db00-4789-9362-7b5c47af1d26"
type = "fix"
description = "Python 3.9 support in type hint normalization"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "8465d65a-3f95-4a9f-aa18-e8810999b5ec"
type = "fix"
description = "fix mypy errors"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "28477028-ec46-493a-9b8c-acf024cf953c"
type = "fix"
description = "Fix mypy errors"
author = "@NiklasRosenstein"
component = "databind.json"
8 changes: 8 additions & 0 deletions databind.core/.changelog/0.8.0.toml → .changelog/0.8.0.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ id = "71eb5eb9-8246-489d-948f-8a525b00e505"
type = "improvement"
description = "`@implementation()` now sets the databind metadata field to `None` if no explicit metadata is already set on the type. `Registry.get_converter()` recognizes this case and stops checking the base classes. This is to avoid a confusing error when the type decorated with `@implementation()` seems to inherit the `UnionMetadata` from the parent class (because of the `Registry.get_converter()` base class check) but actually does not provide a metadata. Now we see \"no converter found for type XYZ\" instead \"expected UnionMetadata to be provided by XYZ\" in `databind.json`"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "a27c60f9-6cce-4abf-8043-d081c0de33c2"
type = "feature"
description = "add converter for `typing.Any`, which by the way does not actually convert anything"
author = "@NiklasRosenstein"
component = "databind.json"
12 changes: 11 additions & 1 deletion databind.core/.changelog/0.9.0.toml → .changelog/0.9.0.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
release-date = "2020-12-30"
release-date = "2020-11-24"

[[entries]]
id = "b52ab6b6-b481-4bb7-9883-71adc813408e"
type = "feature"
description = "add `ImportingUnionResolver` and `EntrypointUnionResolver`, both which can also be used with the `@interface` decorator. The `resolver` argument now accepts a string which will be converted into a `UnionResolver` (supported formats are `import` and `entrypoint:<group-name>`)"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "3c1737e4-fe26-46e8-9b0c-6560cc9041bd"
type = "fix"
description = "`@implementation()` can now be used without explicitly specifying the `for_` parameter when decorating a class with multiple bases where only one base is a `@uniontype`"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "896fee89-6413-4f92-8ffd-130e27bc27de"
type = "fix"
description = "fix inheritance of fields from `@dataclass` parent classes"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "4436d541-f7a8-4c1b-9292-0bc1d6624a15"
type = "feature"
description = "handle `FieldMetadata.relaxed` and `FieldMetadata.strict` in Bool, Integer and String converters"
author = "@NiklasRosenstein"
component = "databind.json"
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ id = "4c779cd4-3aeb-4ab8-b9cf-178dce76db85"
type = "breaking change"
description = "Full rewrite"
author = "@NiklasRosenstein"
component = "databind.core"
6 changes: 0 additions & 6 deletions .changelog/1.0.0.yml

This file was deleted.

2 changes: 2 additions & 0 deletions databind.core/.changelog/1.0.1.toml → .changelog/1.0.1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ id = "047bcdde-be03-419a-b2ff-351c1519e69b"
type = "improvement"
description = "import `dataclass_to_schema` into `databind.core` top-level package"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "cd9d09c1-7801-4125-8274-4745295c584a"
type = "fix"
description = "fix type hints to pass mypy checks"
author = "@NiklasRosenstein"
component = "databind.core"
5 changes: 5 additions & 0 deletions databind.core/.changelog/1.1.0.toml → .changelog/1.1.0.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,28 @@ id = "6fe4210a-2ee5-4311-8152-c6b4164486a4"
type = "improvement"
description = "remove `AnnotatedType`, add `BaseType.annotations` instead."
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "b864f8a6-fa00-49e3-b23e-cf290e8aee0b"
type = "breaking change"
description = "Reorganize a lot of internal APIs and some public APIs (e.g. renamed `ITypeHintConverter` to `TypeHintAdapter`, `IConverter` to `Converter` + respective module name changes, deprecated `ObjectMapper.default()`, remove `IObjectMapper` and replace `Context.mapper` with `Context.converters` and `Context.annotations`."
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "a7f89cac-61a3-42bd-acec-6b25ed363f4f"
type = "breaking change"
description = "replace `Schema.flat_fields()` with `Schema.flattened()`"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "aaff65b7-df9f-4e90-b7c0-86b0b7762479"
type = "improvement"
description = "only import members from sub-modules where they are expected to be used from (ie. `databind.core`, `databind.core.annotations`, `databind.core.dataclasses`, `databind.json`)"
author = "@NiklasRosenstein"
component = "databind.core"

[[entries]]
id = "8d8029c3-7fb9-4017-ae24-61f7099e73fb"
Expand All @@ -32,3 +36,4 @@ author = "@NiklasRosenstein"
issues = [
"https://github.com/NiklasRosenstein/databind/issues/7",
]
component = "databind.core"
Loading

0 comments on commit acfc438

Please sign in to comment.