Skip to content

Commit 9a29fdd

Browse files
authored
Merge pull request #161 from python-odin/development
Release 2.10rc1
2 parents 58cc902 + 416a49a commit 9a29fdd

15 files changed

+278
-302
lines changed

.coveragerc

-5
This file was deleted.

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: timsavage

.pre-commit-config.yaml

+8-39
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,11 @@
33
default_language_version:
44
python: python3.10
55
repos:
6-
#- repo: https://github.com/pre-commit/pre-commit-hooks
7-
# rev: v4.4.0
8-
# hooks:
9-
# - id: check-added-large-files
10-
# - id: check-toml
11-
# - id: check-yaml
12-
# args:
13-
# - --unsafe
14-
# - id: end-of-file-fixer
15-
# - id: trailing-whitespace
16-
- repo: https://github.com/asottile/pyupgrade
17-
rev: v3.3.1
18-
hooks:
19-
- id: pyupgrade
20-
args:
21-
- --py38-plus
22-
- --keep-runtime-typing
23-
- repo: https://github.com/charliermarsh/ruff-pre-commit
24-
rev: v0.0.270
25-
hooks:
26-
- id: ruff
27-
args:
28-
- --fix
29-
- --exit-non-zero-on-fix
30-
- repo: https://github.com/pycqa/isort
31-
rev: 5.12.0
32-
hooks:
33-
- id: isort
34-
name: isort (python)
35-
- id: isort
36-
name: isort (cython)
37-
types: [cython]
38-
- id: isort
39-
name: isort (pyi)
40-
types: [pyi]
41-
- repo: https://github.com/psf/black
42-
rev: 23.1.0
43-
hooks:
44-
- id: black
6+
- repo: https://github.com/astral-sh/ruff-pre-commit
7+
# Ruff version.
8+
rev: v0.2.1
9+
hooks:
10+
# Run the linter.
11+
- id: ruff
12+
# Run the formatter.
13+
- id: ruff-format

HISTORY

+21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2.10rc1
2+
=======
3+
4+
Changes
5+
-------
6+
7+
- Simplify the internals of the Resource metaclass to make it easier to understand
8+
and maintain. Greater sharing of code between Resource and AnnotatedResource
9+
10+
This change has not effect on the public API.
11+
12+
Removes some compatibility code with versions prior to Python 3.8.
13+
14+
- Support shadowing of fields on a resource. To enabled this feature set the
15+
``allow_field_shadowing`` meta option to ``True``. This allows for fields to be
16+
overridden on a resource.
17+
18+
ResourceObjects now includes a shadow_fields listing all fields shadowed by this
19+
resource.
20+
21+
122
2.9
223
===
324

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Odin also comes with built in serialisation tools for importing and exporting da
2121
| | :alt: Python package |
2222
+---------+-------------------------------------------------------------------------------------------------------------+
2323
| Quality | .. image:: https://sonarcloud.io/api/project_badges/measure?project=python-odin_odin&metric=sqale_rating |
24-
| | :target: https://sonarcloud.io/dashboard?id=python-odin/odin |
24+
| | :target: https://sonarcloud.io/dashboard?id=python-odin_odin |
2525
| | :alt: Maintainability |
2626
| | .. image:: https://sonarcloud.io/api/project_badges/measure?project=python-odin_odin&metric=security_rating |
2727
| | :target: https://sonarcloud.io/project/security_hotspots |

docs/ref/resources/options.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Meta Options
8585
to sort fields in the child resource before appending the fields from the parent
8686
resource(s).
8787

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

@@ -112,4 +112,10 @@ Meta Options
112112
class Meta:
113113
user_data = {
114114
"custom": "my-custom-value",
115-
}
115+
}
116+
117+
``allow_field_shadowing``
118+
Allow fields to be shadow fields with the same name in a parent resource.
119+
120+
Setting this option to ``True`` will allow fields to be shadowed without an exception
121+
being raised. The default behaviour is to raise an exception if a field is shadowed.

0 commit comments

Comments
 (0)