Skip to content

Commit

Permalink
Merge pull request #161 from python-odin/development
Browse files Browse the repository at this point in the history
Release 2.10rc1
  • Loading branch information
timsavage authored Mar 12, 2024
2 parents 58cc902 + 416a49a commit 9a29fdd
Show file tree
Hide file tree
Showing 15 changed files with 278 additions and 302 deletions.
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: timsavage
47 changes: 8 additions & 39 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,11 @@
default_language_version:
python: python3.10
repos:
#- repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v4.4.0
# hooks:
# - id: check-added-large-files
# - id: check-toml
# - id: check-yaml
# args:
# - --unsafe
# - id: end-of-file-fixer
# - id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args:
- --py38-plus
- --keep-runtime-typing
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.270
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.1
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
21 changes: 21 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
2.10rc1
=======

Changes
-------

- Simplify the internals of the Resource metaclass to make it easier to understand
and maintain. Greater sharing of code between Resource and AnnotatedResource

This change has not effect on the public API.

Removes some compatibility code with versions prior to Python 3.8.

- Support shadowing of fields on a resource. To enabled this feature set the
``allow_field_shadowing`` meta option to ``True``. This allows for fields to be
overridden on a resource.

ResourceObjects now includes a shadow_fields listing all fields shadowed by this
resource.


2.9
===

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Odin also comes with built in serialisation tools for importing and exporting da
| | :alt: Python package |
+---------+-------------------------------------------------------------------------------------------------------------+
| Quality | .. image:: https://sonarcloud.io/api/project_badges/measure?project=python-odin_odin&metric=sqale_rating |
| | :target: https://sonarcloud.io/dashboard?id=python-odin/odin |
| | :target: https://sonarcloud.io/dashboard?id=python-odin_odin |
| | :alt: Maintainability |
| | .. image:: https://sonarcloud.io/api/project_badges/measure?project=python-odin_odin&metric=security_rating |
| | :target: https://sonarcloud.io/project/security_hotspots |
Expand Down
10 changes: 8 additions & 2 deletions docs/ref/resources/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Meta Options
to sort fields in the child resource before appending the fields from the parent
resource(s).

Settings this option to ``True`` will cause field sorting to happen after all of
Setting this option to ``True`` will cause field sorting to happen after all of
the fields have been attached using the default sort method. The default method
sorts the fields by the order they are defined.

Expand All @@ -112,4 +112,10 @@ Meta Options
class Meta:
user_data = {
"custom": "my-custom-value",
}
}

``allow_field_shadowing``
Allow fields to be shadow fields with the same name in a parent resource.

Setting this option to ``True`` will allow fields to be shadowed without an exception
being raised. The default behaviour is to raise an exception if a field is shadowed.
Loading

0 comments on commit 9a29fdd

Please sign in to comment.