Skip to content

Commit 981fade

Browse files
bowenwrdbanty
andcommitted
fix: Lower version requirements for python-dateutil in generated client openapi-generators#298 (openapi-generators#299)
* Lower version requirements for python-dateutil in generated client openapi-generators#298 * Update CHANGELOG.md Co-authored-by: Dylan Anthony <[email protected]> Co-authored-by: Dylan Anthony <[email protected]>
1 parent eece180 commit 981fade

File tree

5 files changed

+37
-30
lines changed

5 files changed

+37
-30
lines changed

CHANGELOG.md

+15-27
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,52 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## 0.8.0 - Unreleased
98

9+
## Unreleased
1010
### Additions
11-
1211
- New `--meta` command line option for specifying what type of metadata should be generated:
1312
- `poetry` is the default value, same behavior you're used to in previous versions
14-
- `setup` will generate a pyproject.toml with no Poetry information, and instead create a `setup.py` with the
13+
- `setup` will generate a pyproject.toml with no Poetry information, and instead create a `setup.py` with the
1514
project info.
1615
- `none` will not create a project folder at all, only the inner package folder (which won't be inner anymore)
17-
- Attempt to detect and alert users if they are using an unsupported version of OpenAPI (#281).
18-
- Fixes `Enum` deserialization when the value is `UNSET`.
19-
20-
### Changes
16+
- Lowered the minimum version of `python-dateutil` for improved dependency compatibility with other projects
2117

22-
- Lowered the minimum version of `python-dateutil` to 2.8.0 for improved compatibility (#298 & #299). Thanks @bowenwr!
23-
- The `from_dict` method on generated models is now a `@classmethod` instead of `@staticmethod` (#215 & #292). Thanks @forest-benchling!
2418

2519
## 0.7.3 - 2020-12-21
26-
2720
### Fixes
28-
2921
- Spacing and extra returns for Union types of `additionalProperties` (#266 & #268). Thanks @joshzana & @packyg!
3022
- Title of inline schemas will no longer be missing characters (#271 & #274). Thanks @kalzoo!
31-
- Handling of nulls (Nones) when parsing or constructing dates (#267). Thanks @fyhertz!
23+
- Handling of nulls (Nones) when parsing or constructing dates (#267). Thanks @fyhertz!
3224

33-
## 0.7.2 - 2020-12-08
3425

26+
## 0.7.2 - 2020-12-08
3527
### Fixes
36-
3728
- A bug in handling optional properties that are themselves models (introduced in 0.7.1) (#262). Thanks @packyg!
3829

3930
## 0.7.1 - 2020-12-08
40-
4131
### Additions
42-
4332
- Support for additionalProperties attribute in OpenAPI schemas and "free-form" objects by adding an `additional_properties` attribute to generated models. **COMPATIBILITY NOTE**: this will prevent any model property with a name that would be coerced to "additional_properties" in the generated client from generating properly (#218 & #252). Thanks @packyg!
4433

4534
### Fixes
46-
4735
- Enums will once again work with query parameters (#259). Thanks @packyg!
4836
- Generated Poetry metadata in pyproject.toml will properly indicate Python 3.6 compatibility (#258). Thanks @bowenwr!
4937

5038
## 0.7.0 - 2020-11-25
5139

5240
### Breaking Changes
5341

54-
- Any request/response field that is not `required` and wasn't specified is now set to `UNSET` instead of `None`.
42+
- Any request/response field that is not `required` and wasn't specified is now set to `UNSET` instead of `None`.
5543
- Values that are `UNSET` will not be sent along in API calls
56-
- Schemas defined with `type=object` will now be converted into classes, just like if they were created as ref components.
57-
The previous behavior was a combination of skipping and using generic Dicts for these schemas.
58-
- Response schema handling was unified with input schema handling, meaning that responses will behave differently than before.
59-
Specifically, instead of the content-type deciding what the generated Python type is, the schema itself will.
60-
- As a result of this, endpoints that used to return `bytes` when content-type was application/octet-stream will now return a `File` object if the type of the data is "binary", just like if you were submitting that type instead of receiving it.
44+
- Schemas defined with `type=object` will now be converted into classes, just like if they were created as ref components.
45+
The previous behavior was a combination of skipping and using generic Dicts for these schemas.
46+
- Response schema handling was unified with input schema handling, meaning that responses will behave differently than before.
47+
Specifically, instead of the content-type deciding what the generated Python type is, the schema itself will.
48+
- As a result of this, endpoints that used to return `bytes` when content-type was application/octet-stream will now return a `File` object if the type of the data is "binary", just like if you were submitting that type instead of receiving it.
6149
- Instead of skipping input properties with no type, enum, anyOf, or oneOf declared, the property will be declared as `None`.
62-
- Class (models and Enums) names will now contain the name of their parent element (if any). For example, a property
63-
declared in an endpoint will be named like {endpoint*name}*{previous_class_name}. Classes will no longer be
64-
deduplicated by appending a number to the end of the generated name, so if two names conflict with this new naming
65-
scheme, there will be an error instead.
50+
- Class (models and Enums) names will now contain the name of their parent element (if any). For example, a property
51+
declared in an endpoint will be named like {endpoint_name}_{previous_class_name}. Classes will no longer be
52+
deduplicated by appending a number to the end of the generated name, so if two names conflict with this new naming
53+
scheme, there will be an error instead.
6654

6755
### Additions
6856

end_to_end_tests/golden-record-custom/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include = ["CHANGELOG.md", "custom_e2e/py.typed"]
1616
python = "^3.6"
1717
httpx = "^0.15.0"
1818
attrs = "^20.1.0"
19-
python-dateutil = "^2.8.1"
19+
python-dateutil = "^2.8.0"
2020

2121
[tool.black]
2222
line-length = 120

end_to_end_tests/golden-record/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include = ["CHANGELOG.md", "my_test_api_client/py.typed"]
1616
python = "^3.6"
1717
httpx = "^0.15.0"
1818
attrs = "^20.1.0"
19-
python-dateutil = "^2.8.1"
19+
python-dateutil = "^2.8.0"
2020

2121
[tool.black]
2222
line-length = 120

openapi_python_client/templates/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include = ["CHANGELOG.md", "{{ package_name }}/py.typed"]
1616
python = "^3.6"
1717
httpx = "^0.15.0"
1818
attrs = "^20.1.0"
19-
python-dateutil = "^2.8.1"
19+
python-dateutil = "^2.8.0"
2020

2121
[tool.black]
2222
line-length = 120
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pathlib
2+
3+
from setuptools import find_packages, setup
4+
5+
here = pathlib.Path(__file__).parent.resolve()
6+
long_description = (here / "README.md").read_text(encoding="utf-8")
7+
8+
setup(
9+
name="{{ project_name }}",
10+
version="{{ version }}",
11+
description="{{ description }}",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
package_dir={"": "{{ package_name }}"},
15+
packages=find_packages(where="{{ package_name }}"),
16+
python_requires=">=3.6, <4",
17+
install_requires=["httpx >= 0.15.0, < 0.17.0", "attrs >= 20.1.0", "python-dateutil >= 2.8.0, < 3"],
18+
package_data={"": ["CHANGELOG.md"], "{{ package_name }}": ["py.typed"]},
19+
)

0 commit comments

Comments
 (0)