cadwyn 3.1.1__tar.gz → 3.1.2__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.

Potentially problematic release.


This version of cadwyn might be problematic. Click here for more details.

Files changed (34) hide show
  1. {cadwyn-3.1.1 → cadwyn-3.1.2}/PKG-INFO +6 -1
  2. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/routing.py +5 -2
  3. {cadwyn-3.1.1 → cadwyn-3.1.2}/pyproject.toml +43 -15
  4. {cadwyn-3.1.1 → cadwyn-3.1.2}/setup.py +1 -1
  5. {cadwyn-3.1.1 → cadwyn-3.1.2}/LICENSE +0 -0
  6. {cadwyn-3.1.1 → cadwyn-3.1.2}/README.md +0 -0
  7. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/__init__.py +0 -0
  8. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/__main__.py +0 -0
  9. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/_compat.py +0 -0
  10. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/_package_utils.py +0 -0
  11. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/_utils.py +0 -0
  12. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/README.md +0 -0
  13. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/__init__.py +0 -0
  14. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_asts.py +0 -0
  15. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_common.py +0 -0
  16. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_main.py +0 -0
  17. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_plugins/__init__.py +0 -0
  18. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_plugins/class_migrations.py +0 -0
  19. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_plugins/class_rebuilding.py +0 -0
  20. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_plugins/class_renaming.py +0 -0
  21. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_plugins/import_auto_adding.py +0 -0
  22. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_plugins/latest_version_aliasing.py +0 -0
  23. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/codegen/_plugins/module_migrations.py +0 -0
  24. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/exceptions.py +0 -0
  25. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/main.py +0 -0
  26. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/py.typed +0 -0
  27. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/__init__.py +0 -0
  28. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/common.py +0 -0
  29. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/data.py +0 -0
  30. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/endpoints.py +0 -0
  31. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/enums.py +0 -0
  32. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/modules.py +0 -0
  33. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/schemas.py +0 -0
  34. {cadwyn-3.1.1 → cadwyn-3.1.2}/cadwyn/structure/versions.py +0 -0
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cadwyn
3
- Version: 3.1.1
3
+ Version: 3.1.2
4
4
  Summary: Production-ready community-driven modern Stripe-like API versioning in FastAPI
5
5
  Home-page: https://github.com/zmievsa/cadwyn
6
6
  License: MIT
7
+ Keywords: python,api,json-schema,stripe,versioning,code-generation,hints,api-versioning,pydantic,fastapi,python310,python311,python312
7
8
  Author: Stanislav Zmiev
8
9
  Author-email: zmievsa@gmail.com
9
10
  Requires-Python: >=3.10,<4.0
@@ -22,6 +23,9 @@ Classifier: Programming Language :: Python :: 3
22
23
  Classifier: Programming Language :: Python :: 3.10
23
24
  Classifier: Programming Language :: Python :: 3.11
24
25
  Classifier: Programming Language :: Python :: 3
26
+ Classifier: Programming Language :: Python :: 3.10
27
+ Classifier: Programming Language :: Python :: 3.11
28
+ Classifier: Programming Language :: Python :: 3.12
25
29
  Classifier: Topic :: Internet
26
30
  Classifier: Topic :: Internet :: WWW/HTTP
27
31
  Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
@@ -37,6 +41,7 @@ Requires-Dist: pydantic (>=1.0.0)
37
41
  Requires-Dist: typer (>=0.7.0); extra == "cli"
38
42
  Requires-Dist: typing-extensions
39
43
  Requires-Dist: verselect (>=0.0.6)
44
+ Project-URL: Documentation, https://docs.cadwyn.dev
40
45
  Project-URL: Repository, https://github.com/zmievsa/cadwyn
41
46
  Description-Content-Type: text/markdown
42
47
 
@@ -120,8 +120,10 @@ class _EndpointTransformer(Generic[_R]):
120
120
  ]
121
121
 
122
122
  def transform(self) -> dict[VersionDate, _R]:
123
+ schema_to_internal_request_body_representation = _extract_internal_request_schemas_from_router(
124
+ self.parent_router
125
+ )
123
126
  router = deepcopy(self.parent_router)
124
- schema_to_internal_request_body_representation = _extract_internal_request_schemas_from_router(router)
125
127
  router_infos: dict[VersionDate, _RouterInfo] = {}
126
128
  routes_with_migrated_requests = {}
127
129
  route_bodies_with_migrated_requests: set[type[BaseModel]] = set()
@@ -178,11 +180,11 @@ class _EndpointTransformer(Generic[_R]):
178
180
  template_older_body_model = None
179
181
  _add_data_migrations_to_route(
180
182
  older_route,
183
+ # NOTE: The fact that we use latest here assumes that the route can never change its response schema
181
184
  latest_route,
182
185
  template_older_body_model,
183
186
  older_route.body_field.alias if older_route.body_field is not None else None,
184
187
  copy_of_dependant,
185
- # NOTE: The fact that we use latest here assumes that the route can never change its response schema
186
188
  self.versions,
187
189
  )
188
190
  for _, router_info in router_infos.items():
@@ -355,6 +357,7 @@ def _extract_internal_request_schemas_from_router(
355
357
  route.endpoint,
356
358
  modify_annotations=_extract_internal_request_schemas_from_annotations,
357
359
  )
360
+ _remake_endpoint_dependencies(route)
358
361
  return schema_to_internal_request_body_representation
359
362
 
360
363
 
@@ -1,17 +1,36 @@
1
1
  [tool.poetry]
2
2
  name = "cadwyn"
3
- version = "3.1.1"
3
+ version = "3.1.2"
4
4
  description = "Production-ready community-driven modern Stripe-like API versioning in FastAPI"
5
5
  authors = ["Stanislav Zmiev <zmievsa@gmail.com>"]
6
6
  license = "MIT"
7
7
  readme = "README.md"
8
8
  repository = "https://github.com/zmievsa/cadwyn"
9
+ documentation = "https://docs.cadwyn.dev"
10
+ keywords = [
11
+ "python",
12
+ "api",
13
+ "json-schema",
14
+ "stripe",
15
+ "versioning",
16
+ "code-generation",
17
+ "hints",
18
+ "api-versioning",
19
+ "pydantic",
20
+ "fastapi",
21
+ "python310",
22
+ "python311",
23
+ "python312",
24
+ ]
9
25
  classifiers = [
10
26
  "Intended Audience :: Information Technology",
11
27
  "Intended Audience :: System Administrators",
12
28
  "Operating System :: OS Independent",
13
- "Programming Language :: Python :: 3",
14
29
  "Programming Language :: Python",
30
+ "Programming Language :: Python :: 3",
31
+ "Programming Language :: Python :: 3.10",
32
+ "Programming Language :: Python :: 3.11",
33
+ "Programming Language :: Python :: 3.12",
15
34
  "Topic :: Internet",
16
35
  "Topic :: Software Development :: Libraries :: Application Frameworks",
17
36
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -43,7 +62,6 @@ ast-comments = "~1.2.0"
43
62
  cli = ["typer"]
44
63
 
45
64
  [tool.poetry.group.dev.dependencies]
46
- black = "*"
47
65
  ruff = "*"
48
66
  pytest = ">=7.2.1"
49
67
  pytest-cov = ">=4.0.0"
@@ -59,6 +77,7 @@ dirty-equals = "^0.6.0"
59
77
  mkdocs = "^1.5.2"
60
78
  mkdocs-material = "^9.3.1"
61
79
  python-multipart = "^0.0.6"
80
+ mkdocs-simple-hooks = "^0.1.5"
62
81
 
63
82
  [tool.poetry.scripts]
64
83
  cadwyn = "cadwyn.__main__:app"
@@ -89,17 +108,7 @@ exclude_lines = [
89
108
  "__rich_repr__",
90
109
  "__repr__",
91
110
  ]
92
- omit = [
93
- "tests/test_tutorial/test_users_example003/*",
94
- "tests/_data/*",
95
- "tests/_temp/*",
96
- "tests/test_tutorial/*/schemas/*",
97
- ]
98
-
99
- [tool.black]
100
- color = true
101
- line-length = 120
102
- target-version = ["py310"]
111
+ omit = ["./docs/plugin.py", "./site/plugin.py", "./tests/_data/_temp/**/*", "tests/tutorial/data/**/*"]
103
112
 
104
113
  [tool.pyright]
105
114
  reportMissingImports = true
@@ -120,7 +129,6 @@ reportAssertAlwaysTrue = true
120
129
  reportUnsupportedDunderAll = true
121
130
  reportUnnecessaryTypeIgnoreComment = true
122
131
  reportMissingSuperCall = true
123
- ignore=["cadwyn/_codegen/ast_comments.py"]
124
132
 
125
133
 
126
134
  [tool.ruff]
@@ -184,8 +192,28 @@ ignore = [
184
192
  "RET505", # Unnecessary `else` after `return` statement
185
193
  "N805", # First argument of a method should be named `self`
186
194
  "UP007", # Use `X | Y` for type annotations (we need this for testing and our runtime logic)
195
+
196
+ # The following rules are recommended to be ignored by ruff when using ruff format
197
+ "ISC001", # Checks for implicitly concatenated strings on a single line
198
+ "ISC002", # Checks for implicitly concatenated strings that span multiple lines
199
+ "W191", # Checks for indentation that uses tabs
200
+ "E111", # Checks for indentation with a non-multiple of 4 spaces
201
+ "E114", # Checks for indentation of comments with a non-multiple of 4 spaces
202
+ "E117", # Checks for over-indented code
203
+ "D206", # Checks for docstrings that are indented with tabs
204
+ "D300", # Checks for docstrings that use '''single quotes''' instead of """double quotes"""
205
+ "Q000", # Checks for inline strings that use single quotes or double quotes
206
+ "Q001", # Checks for multiline strings that use single quotes or double quotes
207
+ "Q002", # Checks for docstrings that use single quotes or double quotes
208
+ "Q003", # Checks for strings that include escaped quotes
209
+ "COM812", # Checks for the absence of trailing commas
210
+ "COM819", # Checks for the presence of prohibited trailing commas
187
211
  ]
188
212
 
213
+ [tool.ruff.format]
214
+ quote-style = "double"
215
+ indent-style = "space"
216
+
189
217
  [tool.ruff.per-file-ignores]
190
218
  "tests/*" = [
191
219
  "S", # ignore bandit security issues in tests
@@ -22,7 +22,7 @@ entry_points = \
22
22
 
23
23
  setup_kwargs = {
24
24
  'name': 'cadwyn',
25
- 'version': '3.1.1',
25
+ 'version': '3.1.2',
26
26
  'description': 'Production-ready community-driven modern Stripe-like API versioning in FastAPI',
27
27
  'long_description': '# Cadwyn\n\nProduction-ready community-driven modern [Stripe-like](https://stripe.com/blog/api-versioning) API versioning in FastAPI\n\n---\n\n<p align="center">\n<a href="https://github.com/zmievsa/cadwyn/actions?query=workflow%3ATests+event%3Apush+branch%3Amain" target="_blank">\n <img src="https://github.com/zmievsa/cadwyn/actions/workflows/test.yaml/badge.svg?branch=main&event=push" alt="Test">\n</a>\n<a href="https://codecov.io/gh/ovsyanka83/cadwyn" target="_blank">\n <img src="https://img.shields.io/codecov/c/github/ovsyanka83/cadwyn?color=%2334D058" alt="Coverage">\n</a>\n<a href="https://pypi.org/project/cadwyn/" target="_blank">\n <img alt="PyPI" src="https://img.shields.io/pypi/v/cadwyn?color=%2334D058&label=pypi%20package" alt="Package version">\n</a>\n<a href="https://pypi.org/project/cadwyn/" target="_blank">\n <img src="https://img.shields.io/pypi/pyversions/cadwyn?color=%2334D058" alt="Supported Python versions">\n</a>\n</p>\n\n## Who is this for?\n\nCadwyn allows you to support a single version of your code while auto-generating the schemas and routes for older versions. You keep API versioning encapsulated in small and independent "version change" modules while your business logic stays simple and knows nothing about versioning.\n\nIts [approach](https://docs.cadwyn.dev/theory/#ii-migration-based-response-building) will be useful if you want to:\n\n1. Support many API versions for a long time\n2. Effortlessly backport features and bugfixes to older API versions\n\nWhether you are a newbie in API versioning, a pro looking for a sophisticated tool, an experimenter looking to build a similar framework, or even someone who just wants to learn about all approaches to API versioning -- Cadwyn has the functionality, theory, and documentation to cover all the mentioned use cases.\n\n## Get started\n\nThe [documentation](https://docs.cadwyn.dev) has everything you need to succeed.\n',
28
28
  'author': 'Stanislav Zmiev',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes