Skip to content

Commit

Permalink
Merge pull request #352 from reagento/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
zhPavel authored Dec 14, 2024
2 parents 21b4ec1 + ec5f344 commit ae7f63b
Show file tree
Hide file tree
Showing 81 changed files with 936 additions and 513 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ updates:
directory: "/"
schedule:
interval: "weekly"
target-branch: develop
2 changes: 1 addition & 1 deletion .github/workflows/coverage_external_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# DO NOT run actions/checkout here, for security reasons
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
- name: Post comment
uses: py-cov-action/python-coverage-comment-action@44f4df022ec3c3cbb61e56e0b550a490bde8aa73
uses: py-cov-action/python-coverage-comment-action@b2eb38dd175bf053189b35f738f9207278b00925
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
13 changes: 7 additions & 6 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
timeout-minutes: 3

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Set up Python 3.11
uses: actions/setup-python@v5
Expand Down Expand Up @@ -58,14 +58,15 @@ jobs:
- { setup: '3.10', tox: 'py310', cov: true }
- { setup: '3.11', tox: 'py311', cov: true }
- { setup: '3.12.3', tox: 'py312', cov: true } # (1)
- { setup: '3.13', tox: 'py313', cov: true }
- { setup: 'pypy3.9', tox: 'pypy39', cov: false }
- { setup: 'pypy3.10', tox: 'pypy310', cov: false }

# (1): 3.12.4 contains backwards-incompatible changes of ForwardRef._evaluate()
os: ['ubuntu-latest']

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Set up Python 3.11
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
Expand All @@ -91,7 +92,7 @@ jobs:
--cov-output .coverage.${{ matrix.python_version.tox }}

- name: Store coverage file
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
if: ${{ (matrix.python_version.cov && github.event_name == 'pull_request') }}
with:
name: coverage-${{ matrix.python_version.tox }}
Expand All @@ -115,7 +116,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
id: download
Expand All @@ -125,14 +126,14 @@ jobs:

- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@44f4df022ec3c3cbb61e56e0b550a490bde8aa73
uses: py-cov-action/python-coverage-comment-action@b2eb38dd175bf053189b35f738f9207278b00925
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_COVERAGE_FILES: true
MINIMUM_GREEN: 90

- name: Store Pull Request comment to be posted (for external pr)
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_all_oses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Set up Python 3.11
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ files: |-
)$
default_stages:
- commit
- push
- pre-commit
- pre-push

repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: debug-statements
Expand All @@ -33,7 +33,7 @@ repos:
args: ['-e'] # remove default --in-place argument and emit error

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
rev: v0.8.3
hooks:
- id: ruff
args: [ --fix-only ]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ An extremely flexible and configurable data model conversion library.

Install
```bash
pip install adaptix==3.0.0b8
pip install adaptix==3.0.0b9
```

Use for model loading and dumping.
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/benchmarks/pybench/director_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
from benchmarks.pybench.utils import get_function_object_ref, load_by_object_ref

__all__ = (
"BenchmarkDirector",
"BenchSchema",
"PlotParams",
"CheckParams",
"BenchAccessor",
"BenchChecker",
"BenchSchema",
"BenchmarkDirector",
"CheckParams",
"PlotParams",
)

EnvSpec = Mapping[str, str]
Expand Down
37 changes: 37 additions & 0 deletions docs/changelog/changelog_body.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
----------------------------------------------------


.. _v3.0.0b9:

`3.0.0b9 <https://github.com/reagento/adaptix/tree/v3.0.0b9>`__ -- 2024-12-15
=============================================================================

.. _v3.0.0b9-Features:

Features
--------

- Add support for all Python 3.13 new features.

.. _v3.0.0b9-Breaking Changes:

Breaking Changes
----------------

- All iterables now are dumped to tuple (or list for list children). `#348 <https://github.com/reagento/adaptix/issues/348>`__

.. _v3.0.0b9-Bug Fixes:

Bug Fixes
---------

- Fix ``NoRequiredFieldsLoadError`` raising for fields generated by name flattening.
- ``hide_traceback=False`` shows traceback now.

.. _v3.0.0b9-Other:

Other
-----

- Add "Why not Pydantic?" article.

----------------------------------------------------


.. _v3.0.0b8:

`3.0.0b8 <https://github.com/reagento/adaptix/tree/v3.0.0b8>`__ -- 2024-09-02
Expand Down
6 changes: 3 additions & 3 deletions docs/common/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Just use pip to install the library

.. code-block:: text
pip install adaptix==3.0.0b8
pip install adaptix==3.0.0b9
Integrations with 3-rd party libraries are turned on automatically,
Expand All @@ -20,5 +20,5 @@ So, this is valid installation variants:

.. code-block:: text
pip install adaptix[attrs-strict]==3.0.0b8
pip install adaptix[attrs, sqlalchemy-strict]==3.0.0b8
pip install adaptix[attrs-strict]==3.0.0b9
pip install adaptix[attrs, sqlalchemy-strict]==3.0.0b9
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: F821
from dataclasses import dataclass
from datetime import datetime

Expand Down
8 changes: 3 additions & 5 deletions docs/loading-and-dumping/specific-types-behavior.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,10 @@ Iterable subclasses
If ``strict_coercion`` is enabled, the loader takes any iterable excluding ``str`` and ``Mapping``.
If ``strict_coercion`` is disabled, any iterable are accepted.

Dumper produces the same iterable with dumped elements.
Dumper produces the ``tuple`` (or ``list`` for list children) with dumped elements.

If you require a dumper or loader for abstract type, a minimal suitable type will be used.
For example, if you need a dumper for type ``Iterable[int]``, retort will use ``tuple``.
So if a field with ``Iterable[int]`` type will contain ``List[int]``,
the list will be converted to a tuple while dumping.
If you require a loader for abstract type, a minimal suitable type will be used.
For type ``Iterable[int]`` retort will use ``tuple``.

Tuple of dynamic length like ``*tuple[int, ...]`` isn't supported yet.
This doesn't applies for tuples like ``*tuple[int, str]`` (constant length tuples).
Expand Down
1 change: 1 addition & 0 deletions docs/loading-and-dumping/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ is replaced by standard `ExceptionGroup <https://docs.python.org/3/library/excep
For the dumping process any exception is unexpected, so it always will be wrapped with ``ExceptionGroup``

.. literalinclude:: /examples/loading-and-dumping/tutorial/unexpected_error.py
:lines: 2-

Trail of exception is stored at a special private attribute and could be accessed via :class:`~.struct_trail.get_trail`.

Expand Down
2 changes: 1 addition & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Installation

.. code-block:: text
pip install adaptix==3.0.0b8
pip install adaptix==3.0.0b9
Example
Expand Down
20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ['setuptools==74.1.0']
requires = ['setuptools==75.6.0']
build-backend = 'setuptools.build_meta'

[project]
name = 'adaptix'
version = '3.0.0b8'
version = '3.0.0b9'
description = 'An extremely flexible and configurable data model conversion library'
readme = 'README.md'
requires-python = '>=3.9'
Expand All @@ -15,11 +15,11 @@ dependencies = [
classifiers = [
'Development Status :: 3 - Alpha',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Operating System :: OS Independent',
Expand All @@ -36,9 +36,9 @@ classifiers = [
attrs = ['attrs >= 21.3.0']
attrs-strict = ['attrs >= 21.3.0, <= 24.2.0']
sqlalchemy = ['sqlalchemy >= 2.0.0']
sqlalchemy-strict = ['sqlalchemy >= 2.0.0, <= 2.0.32']
sqlalchemy-strict = ['sqlalchemy >= 2.0.0, <= 2.0.36']
pydantic = ['pydantic >= 2.0.0']
pydantic-strict = ['pydantic >= 2.0.0, <= 2.8.2']
pydantic-strict = ['pydantic >= 2.0.0, <= 2.10.3']

[project.urls]
'Homepage' = 'https://github.com/reagento/adaptix'
Expand Down Expand Up @@ -127,6 +127,8 @@ fixable = [
'COM812',
'D400',
'PT001',
'RUF023',
'RUF022',
]
ignore = [
# Rules that should be turned on in the near future
Expand All @@ -141,6 +143,7 @@ ignore = [
'B008',
'BLE001',
'RUF009',
'PD011',

# Rules that are not applicable in the project for now
'TID252',
Expand All @@ -150,20 +153,19 @@ ignore = [
'ARG',
'D100',
'PLR0913',
'TCH002',
'TC002',

# Strange and obscure rules that will never be turned on
'ANN101',
'FA100',
'TRY003',
'TRY201',
'EM',
'PERF203',
'TCH001',
'TC001',
'TD002',
'PTH201',
'RSE102',
'TCH003',
'TC003',
'PYI025',

# Rules conflictin with other tools
Expand Down
8 changes: 4 additions & 4 deletions requirements/bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mashumaro==3.10
# via -r requirements/raw/bench.txt
msgspec==0.18.4 ; implementation_name != 'pypy'
# via -r requirements/raw/bench.txt
packaging==24.1
packaging==24.2
# via
# marshmallow
# pytest
Expand All @@ -28,13 +28,13 @@ psutil==5.9.5
# via
# -r requirements/raw/bench.txt
# pyperf
pydantic==2.8.2
pydantic==2.10.3
# via -r requirements/raw/bench.txt
pydantic-core==2.20.1
pydantic-core==2.27.1
# via pydantic
pyperf==2.6.1
# via -r requirements/raw/bench.txt
pytest==7.4.2
pytest==8.3.4
# via -r requirements/raw/bench.txt
schematics==2.1.1
# via -r requirements/raw/bench.txt
Expand Down
Loading

0 comments on commit ae7f63b

Please sign in to comment.