pyopenapi-gen 0.8.5__py3-none-any.whl → 0.8.7__py3-none-any.whl
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.
- pyopenapi_gen/core/utils.py +8 -3
- {pyopenapi_gen-0.8.5.dist-info → pyopenapi_gen-0.8.7.dist-info}/METADATA +2 -2
- {pyopenapi_gen-0.8.5.dist-info → pyopenapi_gen-0.8.7.dist-info}/RECORD +6 -6
- {pyopenapi_gen-0.8.5.dist-info → pyopenapi_gen-0.8.7.dist-info}/WHEEL +0 -0
- {pyopenapi_gen-0.8.5.dist-info → pyopenapi_gen-0.8.7.dist-info}/entry_points.txt +0 -0
- {pyopenapi_gen-0.8.5.dist-info → pyopenapi_gen-0.8.7.dist-info}/licenses/LICENSE +0 -0
pyopenapi_gen/core/utils.py
CHANGED
@@ -263,6 +263,10 @@ class Formatter:
|
|
263
263
|
"""Helper to format code using Black, falling back to unformatted content if Black is unavailable or errors."""
|
264
264
|
|
265
265
|
def __init__(self) -> None:
|
266
|
+
from typing import Any, Callable, Optional
|
267
|
+
|
268
|
+
self._file_mode: Optional[Any] = None
|
269
|
+
self._format_str: Optional[Callable[..., str]] = None
|
266
270
|
try:
|
267
271
|
from black import FileMode, format_str
|
268
272
|
|
@@ -278,14 +282,15 @@ class Formatter:
|
|
278
282
|
self._file_mode = FileMode()
|
279
283
|
self._format_str = format_str
|
280
284
|
except ImportError:
|
281
|
-
self._file_mode = None
|
282
|
-
self._format_str = None
|
285
|
+
self._file_mode = None
|
286
|
+
self._format_str = None
|
283
287
|
|
284
288
|
def format(self, code: str) -> str:
|
285
289
|
"""Format the given code string with Black if possible."""
|
286
290
|
if self._format_str is not None and self._file_mode is not None:
|
287
291
|
try:
|
288
|
-
|
292
|
+
formatted: str = self._format_str(code, mode=self._file_mode)
|
293
|
+
return formatted
|
289
294
|
except Exception:
|
290
295
|
# On any Black formatting error, return original code
|
291
296
|
return code
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyopenapi-gen
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.7
|
4
4
|
Summary: Modern, async-first Python client generator for OpenAPI specifications with advanced cycle detection and unified type resolution
|
5
5
|
Project-URL: Homepage, https://github.com/your-org/pyopenapi-gen
|
6
6
|
Project-URL: Documentation, https://github.com/your-org/pyopenapi-gen/blob/main/README.md
|
@@ -32,7 +32,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
32
32
|
Classifier: Topic :: System :: Networking
|
33
33
|
Classifier: Typing :: Typed
|
34
34
|
Requires-Python: <4.0.0,>=3.12
|
35
|
-
Requires-Dist: click<
|
35
|
+
Requires-Dist: click<9.0.0,>=8.0.0
|
36
36
|
Requires-Dist: dataclass-wizard>=0.22.0
|
37
37
|
Requires-Dist: httpx>=0.24.0
|
38
38
|
Requires-Dist: openapi-core>=0.19
|
@@ -15,7 +15,7 @@ pyopenapi_gen/core/postprocess_manager.py,sha256=ky27ijbq6zEo43aqe-odz9CR3vFD_3X
|
|
15
15
|
pyopenapi_gen/core/schemas.py,sha256=FOE2e1vIl0vif_C34AehVznJG2W1hampPtJEfL80AxI,5535
|
16
16
|
pyopenapi_gen/core/streaming_helpers.py,sha256=XToNnm-EDAqiKh9ZS4GRxyastFkfSyNR0av-NDTZMPg,2706
|
17
17
|
pyopenapi_gen/core/telemetry.py,sha256=l6z972882MRzNOXU2leAvtnlYFLMSKKQ_oHz4qU5_n0,2225
|
18
|
-
pyopenapi_gen/core/utils.py,sha256
|
18
|
+
pyopenapi_gen/core/utils.py,sha256=-J4lWP_X5jvPTYWkMvgIw4KGt6IKw29eHUAb_C89na4,14163
|
19
19
|
pyopenapi_gen/core/warning_collector.py,sha256=DYl9D7eZYs04mDU84KeonS-5-d0aM7hNqraXTex31ss,2799
|
20
20
|
pyopenapi_gen/core/auth/base.py,sha256=E2KUerA_mYv9D7xulUm-lenIxqZHqanjA4oRKpof2ZE,792
|
21
21
|
pyopenapi_gen/core/auth/plugins.py,sha256=bDWx4MTRFsCKp1i__BsQtZEvQPGU-NKI137-zoxmrgs,3465
|
@@ -117,8 +117,8 @@ pyopenapi_gen/visit/model/alias_generator.py,sha256=3iPFDjCXU0Vm59Hfp64jTDfHoUL8
|
|
117
117
|
pyopenapi_gen/visit/model/dataclass_generator.py,sha256=WtcQNx6l2sxVyTlH1MdQ-UFYWVMsxQk5nyJr1Mk02iM,9999
|
118
118
|
pyopenapi_gen/visit/model/enum_generator.py,sha256=QWsD-IAxGOxKQuC6LLNUvbT8Ot3NWrLFsaYT0DI16DU,9670
|
119
119
|
pyopenapi_gen/visit/model/model_visitor.py,sha256=PZeQd7-dlxZf5gY10BW-DhswmAGF903NccV6L56mjoE,9439
|
120
|
-
pyopenapi_gen-0.8.
|
121
|
-
pyopenapi_gen-0.8.
|
122
|
-
pyopenapi_gen-0.8.
|
123
|
-
pyopenapi_gen-0.8.
|
124
|
-
pyopenapi_gen-0.8.
|
120
|
+
pyopenapi_gen-0.8.7.dist-info/METADATA,sha256=uVLIdsrt5sobCtWIennE0snRYQWwM4QHknfXboDOKnI,13488
|
121
|
+
pyopenapi_gen-0.8.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
122
|
+
pyopenapi_gen-0.8.7.dist-info/entry_points.txt,sha256=gxSlNiwom50T3OEZnlocA6qRjGdV0bn6hN_Xr-Ub5wA,56
|
123
|
+
pyopenapi_gen-0.8.7.dist-info/licenses/LICENSE,sha256=UFAyTWKa4w10-QerlJaHJeep7G2gcwpf-JmvI2dS2Gc,1088
|
124
|
+
pyopenapi_gen-0.8.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|