openapi-python-client 0.28.4__tar.gz → 0.29.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 (114) hide show
  1. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/PKG-INFO +4 -6
  2. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/config.py +2 -2
  3. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/bodies.py +6 -16
  4. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/date.py +4 -4
  5. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/datetime.py +4 -4
  6. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/data_type.py +2 -2
  7. openapi_python_client-0.29.0/openapi_python_client/schema/parameter_location.py +10 -0
  8. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/endpoint_module.py.jinja +7 -1
  9. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/literal_enum.py.jinja +2 -2
  10. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/date_property.py.jinja +1 -1
  11. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/datetime_property.py.jinja +1 -1
  12. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/pyproject_pdm.toml.jinja +2 -3
  13. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/pyproject_poetry.toml.jinja +2 -3
  14. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/pyproject_uv.toml.jinja +2 -3
  15. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/setup.py.jinja +2 -2
  16. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/pyproject.toml +4 -7
  17. openapi_python_client-0.28.4/openapi_python_client/schema/parameter_location.py +0 -25
  18. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/.gitignore +0 -0
  19. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/LICENSE +0 -0
  20. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/README.md +0 -0
  21. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/__init__.py +0 -0
  22. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/__main__.py +0 -0
  23. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/cli.py +0 -0
  24. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/__init__.py +0 -0
  25. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/errors.py +0 -0
  26. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/openapi.py +0 -0
  27. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/__init__.py +0 -0
  28. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/any.py +0 -0
  29. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/boolean.py +0 -0
  30. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/const.py +0 -0
  31. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/enum_property.py +0 -0
  32. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/file.py +0 -0
  33. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/float.py +0 -0
  34. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/int.py +0 -0
  35. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/list_property.py +0 -0
  36. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/literal_enum_property.py +0 -0
  37. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/merge_properties.py +0 -0
  38. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/model_property.py +0 -0
  39. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/none.py +0 -0
  40. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/property.py +0 -0
  41. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/protocol.py +0 -0
  42. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/schemas.py +0 -0
  43. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/string.py +0 -0
  44. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/union.py +0 -0
  45. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/properties/uuid.py +0 -0
  46. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/parser/responses.py +0 -0
  47. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/py.typed +0 -0
  48. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/3.0.3.md +0 -0
  49. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/3.1.0.md +0 -0
  50. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/__init__.py +0 -0
  51. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/LICENSE +0 -0
  52. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/README.md +0 -0
  53. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/__init__.py +0 -0
  54. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/callback.py +0 -0
  55. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/components.py +0 -0
  56. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/contact.py +0 -0
  57. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/discriminator.py +0 -0
  58. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/encoding.py +0 -0
  59. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/example.py +0 -0
  60. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/external_documentation.py +0 -0
  61. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/header.py +0 -0
  62. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/info.py +0 -0
  63. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/license.py +0 -0
  64. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/link.py +0 -0
  65. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/media_type.py +0 -0
  66. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py +0 -0
  67. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/oauth_flows.py +0 -0
  68. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/open_api.py +0 -0
  69. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/operation.py +0 -0
  70. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/parameter.py +0 -0
  71. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/path_item.py +0 -0
  72. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/paths.py +0 -0
  73. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/reference.py +0 -0
  74. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/request_body.py +0 -0
  75. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/response.py +0 -0
  76. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/responses.py +0 -0
  77. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/schema.py +0 -0
  78. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/security_requirement.py +0 -0
  79. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/security_scheme.py +0 -0
  80. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/server.py +0 -0
  81. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/server_variable.py +0 -0
  82. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/tag.py +0 -0
  83. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/schema/openapi_schema_pydantic/xml.py +0 -0
  84. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/.gitignore.jinja +0 -0
  85. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/README.md.jinja +0 -0
  86. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/api_init.py.jinja +0 -0
  87. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/client.py.jinja +0 -0
  88. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/endpoint_init.py.jinja +0 -0
  89. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/endpoint_macros.py.jinja +0 -0
  90. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/errors.py.jinja +0 -0
  91. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/helpers.jinja +0 -0
  92. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/int_enum.py.jinja +0 -0
  93. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/model.py.jinja +0 -0
  94. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/models_init.py.jinja +0 -0
  95. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/package_init.py.jinja +0 -0
  96. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/any_property.py.jinja +0 -0
  97. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/boolean_property.py.jinja +0 -0
  98. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/const_property.py.jinja +0 -0
  99. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/enum_property.py.jinja +0 -0
  100. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/file_property.py.jinja +0 -0
  101. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/float_property.py.jinja +0 -0
  102. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/helpers.jinja +0 -0
  103. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/int_property.py.jinja +0 -0
  104. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/list_property.py.jinja +0 -0
  105. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/literal_enum_property.py.jinja +0 -0
  106. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/model_property.py.jinja +0 -0
  107. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/property_macros.py.jinja +0 -0
  108. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/union_property.py.jinja +0 -0
  109. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/property_templates/uuid_property.py.jinja +0 -0
  110. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/pyproject.toml.jinja +0 -0
  111. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/pyproject_ruff.toml.jinja +0 -0
  112. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/str_enum.py.jinja +0 -0
  113. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/templates/types.py.jinja +0 -0
  114. {openapi_python_client-0.28.4 → openapi_python_client-0.29.0}/openapi_python_client/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openapi-python-client
3
- Version: 0.28.4
3
+ Version: 0.29.0
4
4
  Summary: Generate modern Python clients from OpenAPI
5
5
  Project-URL: repository, https://github.com/openapi-generators/openapi-python-client
6
6
  Author-email: Dylan Anthony <contact@dylananthony.com>
@@ -11,24 +11,22 @@ Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
18
17
  Classifier: Programming Language :: Python :: 3.14
19
18
  Classifier: Topic :: Software Development :: Code Generators
20
19
  Classifier: Typing :: Typed
21
- Requires-Python: <4.0,>=3.10
20
+ Requires-Python: <4.0,>=3.11
22
21
  Requires-Dist: attrs>=22.2.0
23
22
  Requires-Dist: colorama>=0.4.3; sys_platform == 'win32'
24
- Requires-Dist: httpx<0.29.0,>=0.23.0
23
+ Requires-Dist: httpx<0.29.0,>=0.23.1
25
24
  Requires-Dist: jinja2<4.0.0,>=3.0.0
26
25
  Requires-Dist: pydantic<3.0.0,>=2.10
27
- Requires-Dist: python-dateutil<3.0.0,>=2.8.1
28
26
  Requires-Dist: ruamel-yaml<0.20.0,>=0.18.6
29
27
  Requires-Dist: ruff>=0.2
30
28
  Requires-Dist: shellingham<2.0.0,>=1.3.2
31
- Requires-Dist: typer<0.26,>0.16
29
+ Requires-Dist: typer<0.27,>0.16
32
30
  Description-Content-Type: text/markdown
33
31
 
34
32
  ![Run Checks](https://github.com/openapi-generators/openapi-python-client/workflows/Run%20Checks/badge.svg)
@@ -1,6 +1,6 @@
1
1
  import json
2
2
  import mimetypes
3
- from enum import Enum
3
+ from enum import StrEnum
4
4
  from pathlib import Path
5
5
 
6
6
  from attr import define
@@ -18,7 +18,7 @@ class ClassOverride(BaseModel):
18
18
  module_name: str | None = None
19
19
 
20
20
 
21
- class MetaType(str, Enum):
21
+ class MetaType(StrEnum):
22
22
  """The types of metadata supported for project generation."""
23
23
 
24
24
  NONE = "none"
@@ -1,4 +1,4 @@
1
- import sys
1
+ from enum import StrEnum
2
2
 
3
3
  import attr
4
4
 
@@ -15,22 +15,12 @@ from ..config import Config
15
15
  from ..utils import get_content_type
16
16
  from .errors import ErrorLevel, ParseError
17
17
 
18
- if sys.version_info >= (3, 11):
19
- from enum import StrEnum
20
18
 
21
- class BodyType(StrEnum):
22
- JSON = "json"
23
- DATA = "data"
24
- FILES = "files"
25
- CONTENT = "content"
26
- else:
27
- from enum import Enum
28
-
29
- class BodyType(str, Enum):
30
- JSON = "json"
31
- DATA = "data"
32
- FILES = "files"
33
- CONTENT = "content"
19
+ class BodyType(StrEnum):
20
+ JSON = "json"
21
+ DATA = "data"
22
+ FILES = "files"
23
+ CONTENT = "content"
34
24
 
35
25
 
36
26
  @attr.define
@@ -1,9 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import datetime
3
4
  from typing import Any, ClassVar
4
5
 
5
6
  from attr import define
6
- from dateutil.parser import isoparse
7
7
 
8
8
  from ...utils import PythonIdentifier
9
9
  from ..errors import PropertyError
@@ -54,10 +54,10 @@ class DateProperty(PropertyProtocol):
54
54
  return value
55
55
  if isinstance(value, str):
56
56
  try:
57
- isoparse(value).date() # make sure it's a valid value
57
+ datetime.date.fromisoformat(value) # make sure it's a valid value
58
58
  except ValueError as e:
59
59
  return PropertyError(f"Invalid date: {e}")
60
- return Value(python_code=f"isoparse({value!r}).date()", raw_value=value)
60
+ return Value(python_code=f"datetime.date.fromisoformat({value!r})", raw_value=value)
61
61
  return PropertyError(f"Cannot convert {value} to a date")
62
62
 
63
63
  def get_imports(self, *, prefix: str) -> set[str]:
@@ -69,5 +69,5 @@ class DateProperty(PropertyProtocol):
69
69
  back to the root of the generated client.
70
70
  """
71
71
  imports = super().get_imports(prefix=prefix)
72
- imports.update({"import datetime", "from typing import cast", "from dateutil.parser import isoparse"})
72
+ imports.update({"import datetime", "from typing import cast"})
73
73
  return imports
@@ -1,9 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import datetime
3
4
  from typing import Any, ClassVar
4
5
 
5
6
  from attr import define
6
- from dateutil.parser import isoparse
7
7
 
8
8
  from ...utils import PythonIdentifier
9
9
  from ..errors import PropertyError
@@ -56,10 +56,10 @@ class DateTimeProperty(PropertyProtocol):
56
56
  return value
57
57
  if isinstance(value, str):
58
58
  try:
59
- isoparse(value) # make sure it's a valid value
59
+ datetime.datetime.fromisoformat(value) # make sure it's a valid value
60
60
  except ValueError as e:
61
61
  return PropertyError(f"Invalid datetime: {e}")
62
- return Value(python_code=f"isoparse({value!r})", raw_value=value)
62
+ return Value(python_code=f"datetime.datetime.fromisoformat({value!r})", raw_value=value)
63
63
  return PropertyError(f"Cannot convert {value} to a datetime")
64
64
 
65
65
  def get_imports(self, *, prefix: str) -> set[str]:
@@ -71,5 +71,5 @@ class DateTimeProperty(PropertyProtocol):
71
71
  back to the root of the generated client.
72
72
  """
73
73
  imports = super().get_imports(prefix=prefix)
74
- imports.update({"import datetime", "from typing import cast", "from dateutil.parser import isoparse"})
74
+ imports.update({"import datetime", "from typing import cast"})
75
75
  return imports
@@ -1,7 +1,7 @@
1
- from enum import Enum
1
+ from enum import StrEnum
2
2
 
3
3
 
4
- class DataType(str, Enum):
4
+ class DataType(StrEnum):
5
5
  """The data type of a schema is defined by the type keyword
6
6
 
7
7
  References:
@@ -0,0 +1,10 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ParameterLocation(StrEnum):
5
+ """The places Parameters can be put when calling an Endpoint"""
6
+
7
+ QUERY = "query"
8
+ PATH = "path"
9
+ HEADER = "header"
10
+ COOKIE = "cookie"
@@ -50,12 +50,18 @@ def _get_kwargs(
50
50
  {% for body in endpoint.bodies %}
51
51
  if isinstance(body, {{body.prop.get_type_string(no_optional=True) }}):
52
52
  {{ body_to_kwarg(body) | indent(8) }}
53
+ {%- if body.content_type == "multipart/form-data" %}
54
+ headers["Content-Type"] = "multipart/form-data; boundary=+++"
55
+ {% else %}
53
56
  headers["Content-Type"] = "{{ body.content_type }}"
57
+ {% endif %}
54
58
  {% endfor %}
55
59
  {% elif endpoint.bodies | length == 1 %}
56
60
  {% set body = endpoint.bodies[0] %}
57
61
  {{ body_to_kwarg(body) | indent(4) }}
58
- {% if body.content_type != "multipart/form-data" %}{# Need httpx to set the boundary automatically #}
62
+ {%- if body.content_type == "multipart/form-data" %}
63
+ headers["Content-Type"] = "multipart/form-data; boundary=+++"
64
+ {% else %}
59
65
  headers["Content-Type"] = "{{ body.content_type }}"
60
66
  {% endif %}
61
67
  {% endif %}
@@ -1,4 +1,4 @@
1
- from typing import Literal, cast
1
+ from typing import Literal
2
2
 
3
3
  {{ enum.class_info.name }} = Literal{{ "%r" | format(enum.values|list|sort) }}
4
4
 
@@ -6,5 +6,5 @@ from typing import Literal, cast
6
6
 
7
7
  def check_{{ enum.get_class_name_snake_case() }}(value: {{ enum.get_instance_type_string() }}) -> {{ enum.class_info.name}}:
8
8
  if value in {{ enum.get_class_name_snake_case() | upper }}_VALUES:
9
- return cast({{enum.class_info.name}}, value)
9
+ return value
10
10
  raise TypeError(f"Unexpected value {value!r}. Expected one of {{"{"}}{{ enum.get_class_name_snake_case() | upper }}_VALUES!r}")
@@ -1,5 +1,5 @@
1
1
  {% macro construct_function(property, source) %}
2
- isoparse({{ source }}).date()
2
+ datetime.date.fromisoformat({{ source }})
3
3
  {% endmacro %}
4
4
 
5
5
  {% from "property_templates/property_macros.py.jinja" import construct_template %}
@@ -1,5 +1,5 @@
1
1
  {% macro construct_function(property, source) %}
2
- isoparse({{ source }})
2
+ datetime.datetime.fromisoformat({{ source }})
3
3
  {% endmacro %}
4
4
 
5
5
  {% from "property_templates/property_macros.py.jinja" import construct_template %}
@@ -4,11 +4,10 @@ version = "{{ package_version }}"
4
4
  description = "{{ package_description }}"
5
5
  authors = []
6
6
  readme = "README.md"
7
- requires-python = ">=3.10"
7
+ requires-python = ">=3.11"
8
8
  dependencies = [
9
- "httpx>=0.23.0,<0.29.0",
9
+ "httpx>=0.23.1,<0.29.0",
10
10
  "attrs>=22.2.0",
11
- "python-dateutil>=2.8.0",
12
11
  ]
13
12
 
14
13
  [tool.pdm]
@@ -10,10 +10,9 @@ packages = [
10
10
  include = ["{{ package_name }}/py.typed"]
11
11
 
12
12
  [tool.poetry.dependencies]
13
- python = "^3.10"
14
- httpx = ">=0.23.0,<0.29.0"
13
+ python = "^3.11"
14
+ httpx = ">=0.23.1,<0.29.0"
15
15
  attrs = ">=22.2.0"
16
- python-dateutil = "^2.8.0"
17
16
 
18
17
  [build-system]
19
18
  requires = ["poetry-core>=2.0.0,<3.0.0"]
@@ -3,12 +3,11 @@ name = "{{ project_name }}"
3
3
  version = "{{ package_version }}"
4
4
  description = "{{ package_description }}"
5
5
  authors = []
6
- requires-python = ">=3.10"
6
+ requires-python = ">=3.11"
7
7
  readme = "README.md"
8
8
  dependencies = [
9
- "httpx>=0.23.0,<0.29.0",
9
+ "httpx>=0.23.1,<0.29.0",
10
10
  "attrs>=22.2.0",
11
- "python-dateutil>=2.8.0,<3",
12
11
  ]
13
12
 
14
13
  [tool.uv.build-backend]
@@ -12,7 +12,7 @@ setup(
12
12
  long_description=long_description,
13
13
  long_description_content_type="text/markdown",
14
14
  packages=find_packages(),
15
- python_requires=">=3.10, <4",
16
- install_requires=["httpx >= 0.23.0, < 0.29.0", "attrs >= 22.2.0", "python-dateutil >= 2.8.0, < 3"],
15
+ python_requires=">=3.11, <4",
16
+ install_requires=["httpx >= 0.23.1, < 0.29.0", "attrs >= 22.2.0"],
17
17
  package_data={"{{ package_name }}": ["py.typed"]},
18
18
  )
@@ -3,21 +3,20 @@ authors = [
3
3
  { name = "Dylan Anthony", email = "contact@dylananthony.com" },
4
4
  ]
5
5
  license = { text = "MIT" }
6
- requires-python = ">=3.10,<4.0"
6
+ requires-python = ">=3.11,<4.0"
7
7
  dependencies = [
8
8
  "jinja2>=3.0.0,<4.0.0",
9
- "typer>0.16,<0.26",
9
+ "typer>0.16,<0.27",
10
10
  "colorama>=0.4.3; sys_platform == \"win32\"",
11
11
  "shellingham>=1.3.2,<2.0.0",
12
12
  "pydantic>=2.10,<3.0.0",
13
13
  "attrs>=22.2.0",
14
- "python-dateutil>=2.8.1,<3.0.0",
15
- "httpx>=0.23.0,<0.29.0",
14
+ "httpx>=0.23.1,<0.29.0",
16
15
  "ruamel.yaml>=0.18.6,<0.20.0",
17
16
  "ruff>=0.2",
18
17
  ]
19
18
  name = "openapi-python-client"
20
- version = "0.28.4"
19
+ version = "0.29.0"
21
20
  description = "Generate modern Python clients from OpenAPI"
22
21
  keywords = [
23
22
  "OpenAPI",
@@ -29,7 +28,6 @@ classifiers = [
29
28
  "License :: OSI Approved :: MIT License",
30
29
  "Intended Audience :: Developers",
31
30
  "Programming Language :: Python :: 3",
32
- "Programming Language :: Python :: 3.10",
33
31
  "Programming Language :: Python :: 3.11",
34
32
  "Programming Language :: Python :: 3.12",
35
33
  "Programming Language :: Python :: 3.13",
@@ -93,7 +91,6 @@ dev = [
93
91
  "python-multipart",
94
92
  "types-PyYAML<7.0.0,>=6.0.3",
95
93
  "types-certifi<2021.10.9,>=2020.0.0",
96
- "types-python-dateutil<3.0.0,>=2.0.0",
97
94
  "syrupy>=4",
98
95
  ]
99
96
 
@@ -1,25 +0,0 @@
1
- # Python 3.11 has StrEnum but breaks the old `str, Enum` hack.
2
- # Unless this gets fixed, we need to have two implementations :(
3
- import sys
4
-
5
- if sys.version_info >= (3, 11):
6
- from enum import StrEnum
7
-
8
- class ParameterLocation(StrEnum):
9
- """The places Parameters can be put when calling an Endpoint"""
10
-
11
- QUERY = "query"
12
- PATH = "path"
13
- HEADER = "header"
14
- COOKIE = "cookie"
15
-
16
- else:
17
- from enum import Enum
18
-
19
- class ParameterLocation(str, Enum):
20
- """The places Parameters can be put when calling an Endpoint"""
21
-
22
- QUERY = "query"
23
- PATH = "path"
24
- HEADER = "header"
25
- COOKIE = "cookie"