pydantic-marshmallow 1.0.1__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/instructions/Default.instructions.md +27 -1
  2. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/instructions/Git.instructions.md +2 -2
  3. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/instructions/Implementation.instructions.md +13 -2
  4. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/workflows/ci.yml +25 -7
  5. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.gitignore +4 -0
  6. pydantic_marshmallow-1.1.0/.pre-commit-config.yaml +55 -0
  7. pydantic_marshmallow-1.1.0/.releaserc.json +107 -0
  8. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/CAPABILITY_MATRIX.md +13 -5
  9. {pydantic_marshmallow-1.0.1/src/pydantic_marshmallow.egg-info → pydantic_marshmallow-1.1.0}/PKG-INFO +26 -14
  10. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/README.md +21 -8
  11. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/benchmarks/__init__.py +1 -0
  12. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/benchmarks/benchmark_framework.py +123 -52
  13. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/benchmarks/run_benchmarks.py +3 -1
  14. pydantic_marshmallow-1.1.0/docs/getting-started/installation.md +84 -0
  15. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/mkdocs.yml +0 -1
  16. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/pydantic-marshmallow.code-workspace +36 -0
  17. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/pyproject.toml +4 -28
  18. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow/bridge.py +204 -76
  19. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow/field_conversion.py +28 -7
  20. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow/type_mapping.py +37 -28
  21. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0/src/pydantic_marshmallow.egg-info}/PKG-INFO +26 -14
  22. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow.egg-info/SOURCES.txt +1 -1
  23. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow.egg-info/requires.txt +3 -4
  24. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_flask_marshmallow.py +6 -8
  25. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_flask_rebar.py +11 -0
  26. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_advanced_hooks.py +1 -6
  27. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_error_handling.py +1 -5
  28. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_extended_coverage.py +1 -10
  29. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_partial_and_unknown.py +6 -8
  30. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_schema_parameters.py +1 -6
  31. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/uv.lock +92 -73
  32. pydantic_marshmallow-1.0.1/.releaserc.json +0 -37
  33. pydantic_marshmallow-1.0.1/docs/changelog.md +0 -35
  34. pydantic_marshmallow-1.0.1/docs/getting-started/installation.md +0 -43
  35. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/instructions/Change_Size.instructions.md +0 -0
  36. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/instructions/Compatibility_Analysis.instructions.md +0 -0
  37. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/instructions/Coverage.instructions.md +0 -0
  38. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/workflows/docs.yml +0 -0
  39. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.github/workflows/release.yml +0 -0
  40. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/.vscode/settings.json +0 -0
  41. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/LICENSE +0 -0
  42. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/SECURITY.md +0 -0
  43. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/codecov.yml +0 -0
  44. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/api/errors.md +0 -0
  45. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/api/hybrid.md +0 -0
  46. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/api/index.md +0 -0
  47. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/api/schema.md +0 -0
  48. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/api/validators.md +0 -0
  49. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/examples.md +0 -0
  50. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/getting-started/quickstart.md +0 -0
  51. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/guide/basic-usage.md +0 -0
  52. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/guide/ecosystem.md +0 -0
  53. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/guide/field-options.md +0 -0
  54. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/guide/hooks.md +0 -0
  55. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/guide/nested-models.md +0 -0
  56. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/docs/index.md +0 -0
  57. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/examples/usage.py +0 -0
  58. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/setup.cfg +0 -0
  59. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow/__init__.py +0 -0
  60. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow/errors.py +0 -0
  61. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow/py.typed +0 -0
  62. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow/validators.py +0 -0
  63. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow.egg-info/dependency_links.txt +0 -0
  64. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/src/pydantic_marshmallow.egg-info/top_level.txt +0 -0
  65. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/__init__.py +0 -0
  66. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/__init__.py +0 -0
  67. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/conftest.py +0 -0
  68. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_apispec.py +0 -0
  69. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_connexion.py +0 -0
  70. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_flask_smorest.py +0 -0
  71. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_marshmallow_dataclass.py +0 -0
  72. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_oneofschema.py +0 -0
  73. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_sqlalchemy.py +0 -0
  74. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/compatibility/test_webargs.py +0 -0
  75. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/conftest.py +0 -0
  76. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_bridge.py +0 -0
  77. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_combinations.py +0 -0
  78. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_compatibility.py +0 -0
  79. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_computed_fields.py +0 -0
  80. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_dump_options.py +0 -0
  81. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_edge_cases.py +0 -0
  82. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_extended_performance.py +0 -0
  83. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_hooks.py +0 -0
  84. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_performance.py +0 -0
  85. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_return_instance.py +0 -0
  86. {pydantic_marshmallow-1.0.1 → pydantic_marshmallow-1.1.0}/tests/test_validation.py +0 -0
@@ -35,6 +35,7 @@ ruff format src/ tests/
35
35
  **Before committing:** Run `pytest tests/ -v && mypy src/ && ruff check src/ tests/`
36
36
 
37
37
  See [Git.instructions.md](Git.instructions.md) for full CI/CD workflow.
38
+ See [Performance.instructions.md](Performance.instructions.md) for benchmark guidelines.
38
39
 
39
40
  ## Architecture
40
41
 
@@ -132,9 +133,34 @@ This ensures field filtering works correctly with dynamically generated fields.
132
133
 
133
134
  **Runtime:**
134
135
  - pydantic >= 2.0
135
- - marshmallow >= 3.18
136
+ - marshmallow >= 3.18 (supports both 3.x and 4.x)
136
137
 
137
138
  **Development:**
138
139
  - pytest, pytest-cov
139
140
  - mypy
140
141
  - ruff
142
+
143
+ ## Marshmallow Version Compatibility
144
+
145
+ The library supports both Marshmallow 3.x and 4.x. Key differences handled internally:
146
+ - **MA 4.x**: `context` parameter removed from `Schema.__init__` (use `contextvars` instead)
147
+ - **MA 4.x**: `@validates_schema(pass_many=True)` renamed to `pass_collection=True`
148
+ - **MA 4.x**: `unknown` parameter required in internal processor methods
149
+
150
+ **Testing both versions locally:**
151
+ ```bash
152
+ # Create separate venvs
153
+ python -m venv .venv-ma3
154
+ python -m venv .venv-ma4
155
+
156
+ # Install with specific versions
157
+ .\.venv-ma3\Scripts\pip install -e ".[dev]" "marshmallow>=3.18,<4"
158
+ .\.venv-ma4\Scripts\pip install -e ".[dev]" "marshmallow>=4" "flask-rebar>=3.4.0"
159
+
160
+ # Run tests
161
+ .\.venv-ma3\Scripts\python -m pytest tests/ -v
162
+ .\.venv-ma4\Scripts\python -m pytest tests/ -v
163
+ ```
164
+
165
+ **Ecosystem version requirements:**
166
+ - flask-rebar ≥ 3.4.0 required for MA 4.x swagger generation support
@@ -38,9 +38,9 @@ ruff check src/ tests/
38
38
  1. **Push changes** - Never merge uncommitted work
39
39
  2. **Wait for CI** - Check GitHub Actions status
40
40
  3. **All checks must pass**:
41
- - Tests pass on Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
41
+ - Tests pass on Python 3.10, 3.11, 3.12, 3.13, 3.14
42
42
  - mypy type checking passes
43
- - ruff and flake8 linting passes
43
+ - ruff linting passes
44
44
  4. **Only merge after CI success** - The `ci-passed` job gates all merges
45
45
 
46
46
  ## Checking CI Status
@@ -150,11 +150,22 @@ class BridgeValidationError(ValidationError):
150
150
 
151
151
  ### Benchmarking
152
152
 
153
+ **See [Performance.instructions.md](Performance.instructions.md) for full guidelines.**
154
+
155
+ **Critical:** Always verify dependency versions before benchmarking:
156
+ ```python
157
+ # ALWAYS run this before any benchmark
158
+ python -c "import marshmallow; print(marshmallow.__file__); from importlib.metadata import version; print('Version:', version('marshmallow'))"
159
+ ```
160
+
161
+ Basic benchmark example:
153
162
  ```python
154
163
  # In benchmarks/
155
- from benchmark_framework import benchmark, compare_baseline
164
+ from benchmark_framework import BenchmarkSuite
165
+
166
+ suite = BenchmarkSuite("my_benchmarks", iterations=1000, runs=3)
156
167
 
157
- @benchmark(iterations=1000)
168
+ @suite.add("bench_simple_load")
158
169
  def bench_simple_load():
159
170
  schema.load({"name": "test", "age": 30})
160
171
  ```
@@ -28,9 +28,6 @@ jobs:
28
28
  - name: Lint with ruff
29
29
  run: uv run ruff check src/pydantic_marshmallow/ tests/
30
30
 
31
- - name: Lint with flake8
32
- run: uv run flake8 src/pydantic_marshmallow/ tests/
33
-
34
31
  - name: Type check with mypy
35
32
  run: uv run mypy src/pydantic_marshmallow/
36
33
 
@@ -114,19 +111,40 @@ jobs:
114
111
 
115
112
  - name: Override Marshmallow to 4.x latest
116
113
  if: matrix.marshmallow-version == '4-latest'
117
- run: uv pip install --upgrade "marshmallow>=4.0.0"
114
+ run: uv add --dev "marshmallow>=4.0.0"
115
+
116
+ - name: Upgrade flask-rebar for Marshmallow 4.x compatibility
117
+ if: matrix.marshmallow-version == '4-latest'
118
+ run: uv add --dev "flask-rebar>=3.4.0"
118
119
 
119
120
  - name: Override Marshmallow to specific version
120
121
  if: matrix.marshmallow-version != 'latest' && matrix.marshmallow-version != '4-latest'
121
- run: uv pip install "marshmallow==${{ matrix.marshmallow-version }}"
122
+ run: uv add --dev "marshmallow==${{ matrix.marshmallow-version }}"
122
123
 
123
124
  - name: Override Pydantic to 2.5.x
124
125
  if: matrix.pydantic-version == '2.5'
125
- run: uv pip install "pydantic>=2.5.0,<2.6.0"
126
+ run: uv add --dev "pydantic>=2.5.0,<2.6.0"
126
127
 
127
128
  - name: Override Pydantic to specific version
128
129
  if: matrix.pydantic-version == '2.0.0'
129
- run: uv pip install "pydantic>=2.0.0,<2.1.0"
130
+ run: uv add --dev "pydantic>=2.0.0,<2.1.0"
131
+
132
+ - name: Verify installed versions
133
+ run: |
134
+ echo "=== Installed Versions ==="
135
+ uv run python -c "from importlib.metadata import version; print(f'Marshmallow: {version(\"marshmallow\")}')"
136
+ uv run python -c "from importlib.metadata import version; print(f'Pydantic: {version(\"pydantic\")}')"
137
+ uv run python -c "import sys; print(f'Python: {sys.version}')"
138
+
139
+ - name: Verify Marshmallow 4.x installed
140
+ if: matrix.marshmallow-version == '4-latest'
141
+ run: |
142
+ uv run python -c "from importlib.metadata import version; v = version('marshmallow'); assert v.startswith('4.'), f'Expected MA 4.x, got {v}'"
143
+
144
+ - name: Verify Marshmallow 3.x installed
145
+ if: matrix.marshmallow-version == '3.18.0' || matrix.marshmallow-version == '3.21.0'
146
+ run: |
147
+ uv run python -c "from importlib.metadata import version; v = version('marshmallow'); assert v == '${{ matrix.marshmallow-version }}', f'Expected MA ${{ matrix.marshmallow-version }}, got {v}'"
130
148
 
131
149
  - name: Run tests
132
150
  run: uv run pytest tests/ -v --tb=short
@@ -141,6 +141,7 @@ celerybeat.pid
141
141
  env/
142
142
  venv/
143
143
  ENV/
144
+ .venv-*/
144
145
  env.bak/
145
146
  venv.bak/
146
147
 
@@ -154,6 +155,9 @@ venv.bak/
154
155
  # mkdocs documentation
155
156
  /site
156
157
 
158
+ # Docker (local dev only)
159
+ docker/
160
+
157
161
  # mypy
158
162
  .mypy_cache/
159
163
  .dmypy.json
@@ -0,0 +1,55 @@
1
+ # Pre-commit hooks for pydantic-marshmallow
2
+ # Install: pre-commit install
3
+ # Run all: pre-commit run --all-files
4
+ # Update: pre-commit autoupdate
5
+
6
+ default_language_version:
7
+ python: python3.11
8
+
9
+ repos:
10
+ # Ruff - fast linter and formatter (replaces flake8, isort, black)
11
+ - repo: https://github.com/astral-sh/ruff-pre-commit
12
+ rev: v0.15.0
13
+ hooks:
14
+ - id: ruff
15
+ name: ruff (lint)
16
+ args: [--fix, --exit-non-zero-on-fix]
17
+ - id: ruff-format
18
+ name: ruff (format)
19
+
20
+ # Type checking with mypy
21
+ - repo: https://github.com/pre-commit/mirrors-mypy
22
+ rev: v1.19.0
23
+ hooks:
24
+ - id: mypy
25
+ name: mypy
26
+ additional_dependencies:
27
+ - marshmallow>=3.18.0
28
+ - pydantic>=2.0.0
29
+ - typing-extensions>=4.0.0
30
+ args: [--config-file=pyproject.toml]
31
+ pass_filenames: false
32
+ files: ^src/
33
+
34
+ # Standard pre-commit hooks
35
+ - repo: https://github.com/pre-commit/pre-commit-hooks
36
+ rev: v5.0.0
37
+ hooks:
38
+ - id: trailing-whitespace
39
+ exclude: ^(site/|.*\.md)$
40
+ - id: end-of-file-fixer
41
+ exclude: ^site/
42
+ - id: check-yaml
43
+ args: [--unsafe]
44
+ - id: check-toml
45
+ - id: check-added-large-files
46
+ args: [--maxkb=500]
47
+ - id: check-merge-conflict
48
+ - id: debug-statements
49
+ - id: mixed-line-ending
50
+ args: [--fix=lf]
51
+ exclude: \.ps1$
52
+
53
+ ci:
54
+ autoupdate_schedule: monthly
55
+ skip: [mypy] # Skip mypy in CI (run separately with full deps)
@@ -0,0 +1,107 @@
1
+ {
2
+ "branches": [
3
+ "main"
4
+ ],
5
+ "plugins": [
6
+ [
7
+ "@semantic-release/commit-analyzer",
8
+ {
9
+ "preset": "conventionalcommits",
10
+ "releaseRules": [
11
+ {
12
+ "type": "feat",
13
+ "release": "minor"
14
+ },
15
+ {
16
+ "type": "fix",
17
+ "release": "patch"
18
+ },
19
+ {
20
+ "type": "perf",
21
+ "release": "patch"
22
+ },
23
+ {
24
+ "type": "docs",
25
+ "release": false
26
+ },
27
+ {
28
+ "type": "style",
29
+ "release": false
30
+ },
31
+ {
32
+ "type": "refactor",
33
+ "release": "patch"
34
+ },
35
+ {
36
+ "type": "test",
37
+ "release": false
38
+ },
39
+ {
40
+ "type": "ci",
41
+ "release": false
42
+ },
43
+ {
44
+ "type": "chore",
45
+ "release": false
46
+ },
47
+ {
48
+ "breaking": true,
49
+ "release": "major"
50
+ }
51
+ ]
52
+ }
53
+ ],
54
+ [
55
+ "@semantic-release/release-notes-generator",
56
+ {
57
+ "preset": "conventionalcommits",
58
+ "presetConfig": {
59
+ "types": [
60
+ {
61
+ "type": "feat",
62
+ "section": "Features"
63
+ },
64
+ {
65
+ "type": "fix",
66
+ "section": "Bug Fixes"
67
+ },
68
+ {
69
+ "type": "perf",
70
+ "section": "Performance"
71
+ },
72
+ {
73
+ "type": "refactor",
74
+ "section": "Refactoring"
75
+ },
76
+ {
77
+ "type": "docs",
78
+ "section": "Documentation",
79
+ "hidden": true
80
+ },
81
+ {
82
+ "type": "style",
83
+ "section": "Styles",
84
+ "hidden": true
85
+ },
86
+ {
87
+ "type": "test",
88
+ "section": "Tests",
89
+ "hidden": true
90
+ },
91
+ {
92
+ "type": "ci",
93
+ "section": "CI",
94
+ "hidden": true
95
+ },
96
+ {
97
+ "type": "chore",
98
+ "section": "Chores",
99
+ "hidden": true
100
+ }
101
+ ]
102
+ }
103
+ }
104
+ ],
105
+ "@semantic-release/github"
106
+ ]
107
+ }
@@ -3,8 +3,8 @@
3
3
  This document maps features from both libraries and tracks bridge support.
4
4
 
5
5
  **Last Updated**: February 2026
6
- **Tested Versions**: Marshmallow 3.x, Pydantic 2.x
7
- **Test Suite**: 375+ tests
6
+ **Tested Versions**: Marshmallow 3.x/4.x, Pydantic 2.x
7
+ **Test Suite**: 515+ tests
8
8
 
9
9
  ## Legend
10
10
  - ✅ Fully supported and tested
@@ -296,19 +296,27 @@ This document maps features from both libraries and tracks bridge support.
296
296
 
297
297
  | Tool | Status | Notes |
298
298
  |:-----|:------:|:------|
299
- | Flask-Rebar | ✅ | Schema subclass |
299
+ | Flask-Rebar | ✅ | Schema subclass; requires ≥3.4.0 for MA 4.x swagger |
300
300
  | webargs | ✅ | Schema subclass |
301
301
  | apispec | ✅ | Schema subclass |
302
302
  | Flask-Marshmallow | ✅ | Schema subclass |
303
303
  | Flask-Smorest | ✅ | Schema subclass |
304
304
  | marshmallow-sqlalchemy | ✅ | Works alongside |
305
305
 
306
+ #### Flask-Rebar Version Notes
307
+ - **flask-rebar ≥ 3.4.0**: Full support for Marshmallow 4.x including swagger generation
308
+ - **flask-rebar < 3.4.0**: Works with Marshmallow 3.x; swagger generation fails on MA 4.x due to removed `ordered` attribute
309
+
306
310
  ---
307
311
 
308
312
  ## 4. Version Compatibility
309
313
 
310
314
  | pydantic-marshmallow | Marshmallow | Pydantic | Python |
311
315
  |:---------------------|:------------|:---------|:-------|
312
- | 0.1.x | 3.18+ | 2.0+ | 3.9-3.14 |
316
+ | 0.1.x | 3.18+ / 4.x | 2.0+ | 3.10-3.14 |
317
+
318
+ **Marshmallow Version Notes:**
319
+ - **MA 3.x**: Full feature support including `context` parameter
320
+ - **MA 4.x**: Full support; `context` parameter removed (use `contextvars` instead)
313
321
 
314
- **CI tests against:** Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 on Ubuntu/Windows/macOS
322
+ **CI tests against:** Python 3.10, 3.11, 3.12, 3.13, 3.14 on Ubuntu/Windows/macOS
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-marshmallow
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: Bring Pydantic's power to Marshmallow: type annotations, validators, and automatic schema generation
5
- Author-email: Your Name <your.email@example.com>
5
+ Author: Michael Thomas
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://github.com/mockodin/pydantic-marshmallow
8
8
  Project-URL: Documentation, https://mockodin.github.io/pydantic-marshmallow
@@ -32,10 +32,9 @@ Provides-Extra: dev
32
32
  Requires-Dist: pytest>=8.0.0; extra == "dev"
33
33
  Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
34
34
  Requires-Dist: email-validator>=2.1.0; extra == "dev"
35
- Requires-Dist: mypy>=1.10.0; extra == "dev"
36
- Requires-Dist: ruff>=0.4.0; extra == "dev"
37
- Requires-Dist: flake8>=7.1.0; extra == "dev"
38
- Requires-Dist: flake8-pyproject>=1.2.4; extra == "dev"
35
+ Requires-Dist: mypy==1.19.1; extra == "dev"
36
+ Requires-Dist: ruff==0.15.0; extra == "dev"
37
+ Requires-Dist: pre-commit>=4.2.0; extra == "dev"
39
38
  Requires-Dist: sqlalchemy>=2.0.30; extra == "dev"
40
39
  Requires-Dist: marshmallow-sqlalchemy>=1.1.0; extra == "dev"
41
40
  Requires-Dist: flask>=3.0.0; extra == "dev"
@@ -73,16 +72,27 @@ Get the best of both worlds: **Pydantic's speed** with **Marshmallow's ecosystem
73
72
 
74
73
  ### Performance
75
74
 
76
- pydantic-marshmallow uses Pydantic's Rust-powered validation engine under the hood, delivering significant performance improvements over native Marshmallow—especially for nested data structures:
75
+ pydantic-marshmallow uses Pydantic's Rust-powered validation engine under the hood, delivering significant performance improvements over native Marshmallow—especially for nested data structures.
77
76
 
78
- | Operation | pydantic-marshmallow | Marshmallow | Speedup |
79
- |-----------|---------------------|-------------|---------|
80
- | Simple load | 3.0 µs | 5.3 µs | **1.8x faster** |
81
- | Nested model | 3.5 µs | 11.6 µs | **3.3x faster** |
82
- | Deep nested (4 levels) | 5.6 µs | 32.3 µs | **5.8x faster** |
83
- | Batch (100 items) | 255 µs | 474 µs | **1.9x faster** |
77
+ #### Performance Comparison
84
78
 
85
- *Benchmarks run on Python 3.11. Run `python -m benchmarks.run_benchmarks` to reproduce.*
79
+ | Operation | MA 3.x | MA 4.x | Bridge (MA 3.x) | Bridge (MA 4.x) |
80
+ |-----------|--------|--------|-----------------|-----------------|
81
+ | Simple load | 5.3 µs | 4.8 µs | 2.9 µs | 2.9 µs |
82
+ | Nested model | 10.9 µs | 10.5 µs | 3.4 µs | 3.2 µs |
83
+ | Deep nested (4 levels) | 31.2 µs | 29.0 µs | 5.3 µs | 5.2 µs |
84
+ | Batch (100 items) | 454 µs | 424 µs | 260 µs | 259 µs |
85
+
86
+ #### What the Numbers Show
87
+
88
+ 1. **MA 3.x → MA 4.x**: Marshmallow 4.x improved ~10% over 3.x (5.3 → 4.8 µs for simple loads)
89
+ 2. **MA 3.x → Bridge**: Adding Pydantic delivers **1.8x–5.9x speedup** over pure MA 3.x
90
+ 3. **MA 4.x → Bridge**: Still **1.6x–5.6x faster** than native MA 4.x
91
+ 4. **Bridge consistency**: ~2.9 µs for simple loads regardless of Marshmallow version
92
+
93
+ The bridge delegates validation to Pydantic's Rust-powered core, bypassing Marshmallow's field processing. This means bridge performance is **independent of Marshmallow version**—you get consistent speed whether you're on MA 3.x or 4.x.
94
+
95
+ *Benchmarks: Python 3.11, median of 3 runs with IQR outlier removal. Run `python -m benchmarks.run_benchmarks` to reproduce.*
86
96
 
87
97
  ### Why it matters
88
98
 
@@ -107,6 +117,8 @@ pydantic-marshmallow uses Pydantic's Rust-powered validation engine under the ho
107
117
  pip install pydantic-marshmallow
108
118
  ```
109
119
 
120
+ **Requirements:** Python 3.10+, Pydantic 2.0+, Marshmallow 3.18+ (including 4.x)
121
+
110
122
  ## Quick Start
111
123
 
112
124
  ### Basic Usage
@@ -15,16 +15,27 @@ Get the best of both worlds: **Pydantic's speed** with **Marshmallow's ecosystem
15
15
 
16
16
  ### Performance
17
17
 
18
- pydantic-marshmallow uses Pydantic's Rust-powered validation engine under the hood, delivering significant performance improvements over native Marshmallow—especially for nested data structures:
18
+ pydantic-marshmallow uses Pydantic's Rust-powered validation engine under the hood, delivering significant performance improvements over native Marshmallow—especially for nested data structures.
19
19
 
20
- | Operation | pydantic-marshmallow | Marshmallow | Speedup |
21
- |-----------|---------------------|-------------|---------|
22
- | Simple load | 3.0 µs | 5.3 µs | **1.8x faster** |
23
- | Nested model | 3.5 µs | 11.6 µs | **3.3x faster** |
24
- | Deep nested (4 levels) | 5.6 µs | 32.3 µs | **5.8x faster** |
25
- | Batch (100 items) | 255 µs | 474 µs | **1.9x faster** |
20
+ #### Performance Comparison
26
21
 
27
- *Benchmarks run on Python 3.11. Run `python -m benchmarks.run_benchmarks` to reproduce.*
22
+ | Operation | MA 3.x | MA 4.x | Bridge (MA 3.x) | Bridge (MA 4.x) |
23
+ |-----------|--------|--------|-----------------|-----------------|
24
+ | Simple load | 5.3 µs | 4.8 µs | 2.9 µs | 2.9 µs |
25
+ | Nested model | 10.9 µs | 10.5 µs | 3.4 µs | 3.2 µs |
26
+ | Deep nested (4 levels) | 31.2 µs | 29.0 µs | 5.3 µs | 5.2 µs |
27
+ | Batch (100 items) | 454 µs | 424 µs | 260 µs | 259 µs |
28
+
29
+ #### What the Numbers Show
30
+
31
+ 1. **MA 3.x → MA 4.x**: Marshmallow 4.x improved ~10% over 3.x (5.3 → 4.8 µs for simple loads)
32
+ 2. **MA 3.x → Bridge**: Adding Pydantic delivers **1.8x–5.9x speedup** over pure MA 3.x
33
+ 3. **MA 4.x → Bridge**: Still **1.6x–5.6x faster** than native MA 4.x
34
+ 4. **Bridge consistency**: ~2.9 µs for simple loads regardless of Marshmallow version
35
+
36
+ The bridge delegates validation to Pydantic's Rust-powered core, bypassing Marshmallow's field processing. This means bridge performance is **independent of Marshmallow version**—you get consistent speed whether you're on MA 3.x or 4.x.
37
+
38
+ *Benchmarks: Python 3.11, median of 3 runs with IQR outlier removal. Run `python -m benchmarks.run_benchmarks` to reproduce.*
28
39
 
29
40
  ### Why it matters
30
41
 
@@ -49,6 +60,8 @@ pydantic-marshmallow uses Pydantic's Rust-powered validation engine under the ho
49
60
  pip install pydantic-marshmallow
50
61
  ```
51
62
 
63
+ **Requirements:** Python 3.10+, Pydantic 2.0+, Marshmallow 3.18+ (including 4.x)
64
+
52
65
  ## Quick Start
53
66
 
54
67
  ### Basic Usage
@@ -13,6 +13,7 @@ from .benchmark_framework import (
13
13
  run_benchmark,
14
14
  )
15
15
 
16
+
16
17
  __all__ = [
17
18
  "BenchmarkResult",
18
19
  "BenchmarkSuite",