Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- `pathlib.Path` is now supported by default.
([#81](https://github.com/python-attrs/cattrs/issues/81))
- Add `cbor2` serialization library to the `cattr.preconf` package.
- Add optional dependencies for `cattrs.preconf` third-party libraries. ([#337](https://github.com/python-attrs/cattrs/pull/337))

## 22.2.0 (2022-10-03)

Expand Down
11 changes: 11 additions & 0 deletions docs/preconf.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ All preconf converters now have `loads` and `dumps` methods, which combine un/st

Particular libraries may have additional constraints documented below.

Third-party libraries can be specified as optional (extra) dependencies on `cattrs` during installation.
Optional install targets should match the name of the {mod}`cattrs.preconf` modules.

```console
# Using pip
pip install cattrs[ujson]

# Using poetry
poetry add --extras tomlkit cattrs
```

## Standard Library _json_

Found at {mod}`cattrs.preconf.json`.
Expand Down
43 changes: 26 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 17 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,24 @@ python = ">= 3.7"
attrs = ">= 20"
typing_extensions = { version = "*", python = "< 3.8" }
exceptiongroup = { version = "*", python = "< 3.11" }
ujson = { version = "^5.4.0", optional = true }
orjson = { version = "^3.5.2", markers = "implementation_name == 'cpython'", optional = true }
msgpack = { version = "^1.0.2", optional = true }
PyYAML = { version = "^6.0", optional = true }
tomlkit = { version = "^0.11.4", python = "<4", optional = true }
cbor2 = { version = "^5.4.6", optional = true }
pymongo = { version = "^4.2.0", optional = true }

[tool.poetry.extras]
ujson = ["ujson"]
orjson = ["orjson"]
msgpack = ["msgpack"]
pyyaml = ["PyYAML"]
tomlkit = ["tomlkit"]
cbor2 = ["cbor2"]
bson = ["pymongo"]

[tool.poetry.group.dev.dependencies]
pymongo = "^4.2.0"
flake8 = {version = "^5.0.4", python = "^3.8"}
tox = "^3.26.0"
Sphinx = "^5.3.0"
Expand All @@ -38,17 +53,11 @@ pendulum = "^2.1.2"
isort = { version = "5.10.1", python = "<4" }
black = "^22.8.0"
immutables = "^0.18"
ujson = "^5.4.0"
orjson = { version = "^3.5.2", markers = "implementation_name == 'cpython'" }
msgpack = "^1.0.2"
PyYAML = "^6.0"
tomlkit = { version = "^0.11.4", python = "<4" }
furo = "^2022.9.29"
coverage = "^6.2"
urllib3 = { version = "^1.26.12", python = "<4" }
sphinx-copybutton = "^0.5.0"
myst-parser = "^0.18.1"
cbor2 = "^5.4.6"

[tool.poetry.urls]
"Changelog" = "https://catt.rs/en/latest/history.html"
Expand Down Expand Up @@ -77,4 +86,4 @@ build-backend = "poetry.core.masonry.api"

[tool.mypy]
plugins = "unionize.py"
strict = true
strict = true
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ setenv =
extras = dev
allowlist_externals = poetry
commands =
poetry install -v
poetry install -v --all-extras
coverage run --source cattrs -m pytest tests {posargs}
passenv = CI

Expand All @@ -44,7 +44,7 @@ setenv =
extras = dev
allowlist_externals = poetry
commands =
poetry install -v
poetry install -v --all-extras
coverage run --source cattrs -m pytest tests {posargs}
passenv = CI

Expand Down