Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #352

Merged
merged 34 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
513fe7e
Fix hide_traceback
zhPavel Sep 8, 2024
b480923
completely drop 3.8
lubaskinc0de Sep 9, 2024
6b143d9
fix coverage on ci
zhPavel Sep 13, 2024
c1912ff
Merge pull request #339 from reagento/fix/coverage-on-ci
zhPavel Sep 13, 2024
48b28f9
Merge remote-tracking branch 'refs/remotes/origin/develop' into pluso…
lubaskinc0de Sep 13, 2024
f197dcd
completely drop 3.8
lubaskinc0de Sep 14, 2024
550dba0
completely drop 3.8
lubaskinc0de Sep 14, 2024
d4b2df6
Merge pull request #338 from lubaskinc0de/plusoneminusone
zhPavel Sep 14, 2024
e2bb2d0
Merge remote-tracking branch 'upstream/main' into develop
zhPavel Sep 15, 2024
d45345c
Bump py-cov-action/python-coverage-comment-action from 3.24 to 3.29
dependabot[bot] Oct 7, 2024
f0a5190
Bump actions/upload-artifact from 4.4.0 to 4.4.3
dependabot[bot] Oct 14, 2024
a9daa9a
Bump actions/checkout from 4.1.7 to 4.2.2
dependabot[bot] Oct 28, 2024
d626c0a
fix error on loading missing field with name flattening
zhPavel Oct 28, 2024
dc96b57
add changelog fragment
zhPavel Nov 3, 2024
422a501
Merge pull request #346 from reagento/fix/structure-flatenning-missin…
zhPavel Nov 3, 2024
e24e468
Merge branch 'main' into develop
zhPavel Nov 23, 2024
309de19
Achieve JSONSchema model serialization, skip running pydantic benchma…
zhPavel Nov 24, 2024
91bb721
The next step to json schema
zhPavel Dec 8, 2024
eadb7bf
Convert iterable to tuple or list at dumping
zhPavel Dec 8, 2024
c9f9a88
Merge pull request #349 from reagento/iterable-serialization
zhPavel Dec 8, 2024
970012b
Run all tests at 3.13
zhPavel Dec 9, 2024
138719c
Fix CI
zhPavel Dec 10, 2024
981652f
Add support for all new features of 3.13
zhPavel Dec 14, 2024
b4bd4aa
Fix mypy error
zhPavel Dec 14, 2024
3c27ce4
Add changelog fragment
zhPavel Dec 14, 2024
d106e7a
Merge pull request #350 from reagento/python3.13-support
zhPavel Dec 14, 2024
94d2a1e
Merge pull request #344 from reagento/dependabot/github_actions/actio…
zhPavel Dec 14, 2024
600efbc
Merge pull request #345 from reagento/dependabot/github_actions/actio…
zhPavel Dec 14, 2024
9107313
Merge pull request #342 from reagento/dependabot/github_actions/py-co…
zhPavel Dec 14, 2024
2f10b69
Change dependabot target branch
zhPavel Dec 14, 2024
8742ce8
Update dependencies
zhPavel Dec 14, 2024
4b089fe
Fix unused imports
zhPavel Dec 14, 2024
0f293f5
Merge pull request #351 from reagento/update-deps
zhPavel Dec 14, 2024
ec5f344
Add changelog and increment library version
zhPavel Dec 14, 2024
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 .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
Loading