Skip to content

Commit

Permalink
Fix for Python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rnag committed Nov 23, 2024
1 parent b12a93d commit f6c2d3d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
21 changes: 9 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,32 @@ interacting with the Python ``dataclasses`` module.
Installation
------------

The Dataclass Wizard library is available `on PyPI`_, and can be installed with ``pip``:
Dataclass Wizard is available on `PyPI`_. Install with ``pip``:

.. code-block:: shell
$ pip install dataclass-wizard
Alternatively, this library is available `on conda`_ under the `conda-forge`_ channel:
Also available on `conda`_ via `conda-forge`_. Install with ``conda``:

.. code-block:: shell
$ conda install dataclass-wizard -c conda-forge
The ``dataclass-wizard`` library officially supports **Python 3.9** or higher.
This library supports **Python 3.9** or higher.

.. _on conda: https://anaconda.org/conda-forge/dataclass-wizard
.. _PyPI: https://pypi.org/project/dataclass-wizard/
.. _conda: https://anaconda.org/conda-forge/dataclass-wizard
.. _conda-forge: https://conda-forge.org/

Features
--------

Here are the supported features that ``dataclass-wizard`` currently provides:
Here are the key features that ``dataclass-wizard`` offers:

- *JSON/YAML (de)serialization*: marshal dataclasses to/from JSON, YAML, and Python
``dict`` objects.
- *Field properties*: support for using properties with default
values in dataclass instances.
- *JSON to Dataclass generation*: construct a dataclass schema with a JSON file
or string input.
- *Flexible (de)serialization*: Marshal dataclasses to/from JSON, TOML, YAML, or ``dict``.
- *Field properties*: Use properties with default values in dataclass instances.
- *JSON to Dataclass generation*: Auto-generate a dataclass schema from a JSON file or string.


Wizard Mixins
Expand Down Expand Up @@ -1086,7 +1084,6 @@ This package was created with Cookiecutter_ and the `rnag/cookiecutter-pypackage

.. _Read The Docs: https://dataclass-wizard.readthedocs.io
.. _Installation: https://dataclass-wizard.readthedocs.io/en/latest/installation.html
.. _on PyPI: https://pypi.org/project/dataclass-wizard/
.. _Cookiecutter: https://github.com/cookiecutter/cookiecutter
.. _`rnag/cookiecutter-pypackage`: https://github.com/rnag/cookiecutter-pypackage
.. _`Contributing`: https://dataclass-wizard.readthedocs.io/en/latest/contributing.html
Expand Down
2 changes: 1 addition & 1 deletion dataclass_wizard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, keys, all: bool, dump: bool,
compare, metadata)

if isinstance(keys, str):
keys = (keys, )
keys = split_object_path(keys) if path else (keys,)

self.json = JSON(*keys, all=all, dump=dump, path=path)

Expand Down
6 changes: 4 additions & 2 deletions docs/_templates/sidebarintro.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
<h1 class="logo"><a href="{{ pathto(master_doc) }}">Dataclass Wizard</a></h1>

<p class="blurb">
A set of simple, yet elegant <i>wizarding</i> tools for interacting with the
Python <code>dataclasses</code> module.
Bring Python <code>dataclasses</code> to life — the <i>wizard</i> way!

<!-- A set of simple, yet elegant <i>wizarding</i> tools for interacting with the-->
<!-- Python <code>dataclasses</code> module.-->
</p>

<h3>Useful Links</h3>
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,6 @@ class _(JSONWizard.Meta):
}

a = A.from_dict(d)
print(repr(a))
assert repr(a).endswith("A(an_int=1, a_bool=False, my_str='xyz1', other_bool=False)")

d = a.to_dict()
Expand Down

0 comments on commit f6c2d3d

Please sign in to comment.