Skip to content

Commit 30d8a37

Browse files
dbantyGitHub
and
GitHub
authored
chore: prepare release 0.17.2 (#932)
This PR was created by Knope. Merging it will create a new release ### Features #### Add `--meta=pdm` option for generating PEP621 + PDM metadata The default metadata is still `--meta=poetry`, which generates a `pyproject.toml` file with Poetry-specific metadata. This change adds the `--meta=pdm` option which includes [PDM](https://pdm-project.org/latest/)-specific metadata, but also standard [PEP621](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml) metadata. This may be useful as a starting point for other dependency managers & build tools (like Hatch). #### Add original OpenAPI `data` attribute to `Response` object PR #767 In custom templates, you can now access a `response.data` attribute that contains the original OpenAPI definition of the response (Response Object or Reference Object). #### Include the `UP` rule for generated Ruff config This enables [pyupgrade-like improvements](https://docs.astral.sh/ruff/rules/#pyupgrade-up) which should replace some `.format()` calls with f-strings. ### Fixes #### Fix Ruff formatting for `--meta=none` PR #940 fixes issue #939. Thanks @satwell! Due to the lack of `pyproject.toml`, Ruff was not getting configured properly when `--meta=none`. As a result, it didn't clean up common generation issues like duplicate imports, which would then cause errors from linters. This is now fixed by changing the default `post_hook` to `ruff check . --fix --extend-select=I` when `--meta=none`. Using `generate --meta=none` should now be almost identical to the code generated by `update`. Co-authored-by: GitHub <[email protected]>
1 parent 20cfce8 commit 30d8a37

6 files changed

+37
-43
lines changed

Diff for: .changeset/add_metapdm_option_for_generating_pep621_pdm_metadata.md

-10
This file was deleted.

Diff for: .changeset/add_original_openapi_data_attribute_to_response_object.md

-10
This file was deleted.

Diff for: .changeset/fix_ruff_formatting_for_metanone.md

-14
This file was deleted.

Diff for: .changeset/include_the_up_rule_for_generated_ruff_config.md

-8
This file was deleted.

Diff for: CHANGELOG.md

+36
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,42 @@ Programmatic usage of this project (e.g., importing it as a Python module) and t
1313

1414
The 0.x prefix used in versions for this project is to indicate that breaking changes are expected frequently (several times a year). Breaking changes will increment the minor number, all other changes will increment the patch number. You can track the progress toward 1.0 [here](https://github.com/openapi-generators/openapi-python-client/projects/2).
1515

16+
## 0.17.2 (2024-01-15)
17+
18+
### Features
19+
20+
#### Add `--meta=pdm` option for generating PEP621 + PDM metadata
21+
22+
The default metadata is still `--meta=poetry`, which generates a `pyproject.toml` file with Poetry-specific metadata.
23+
This change adds the `--meta=pdm` option which includes [PDM](https://pdm-project.org/latest/)-specific metadata, but also
24+
standard [PEP621](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml)
25+
metadata. This may be useful as a starting point for other dependency managers & build tools (like Hatch).
26+
27+
#### Add original OpenAPI `data` attribute to `Response` object
28+
29+
PR #767
30+
31+
In custom templates, you can now access a `response.data` attribute that contains the original OpenAPI definition of the
32+
response (Response Object or Reference Object).
33+
34+
#### Include the `UP` rule for generated Ruff config
35+
36+
This enables [pyupgrade-like improvements](https://docs.astral.sh/ruff/rules/#pyupgrade-up) which should replace some
37+
`.format()` calls with f-strings.
38+
39+
### Fixes
40+
41+
#### Fix Ruff formatting for `--meta=none`
42+
43+
PR #940 fixes issue #939. Thanks @satwell!
44+
45+
Due to the lack of `pyproject.toml`, Ruff was not getting configured properly when `--meta=none`.
46+
As a result, it didn't clean up common generation issues like duplicate imports, which would then cause errors from
47+
linters.
48+
49+
This is now fixed by changing the default `post_hook` to `ruff check . --fix --extend-select=I` when `--meta=none`.
50+
Using `generate --meta=none` should now be almost identical to the code generated by `update`.
51+
1652
## 0.17.1 (2024-01-04)
1753

1854
### Features

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"typing-extensions>=4.8.0,<5.0.0",
1919
]
2020
name = "openapi-python-client"
21-
version = "0.17.1"
21+
version = "0.17.2"
2222
description = "Generate modern Python clients from OpenAPI"
2323
keywords = [
2424
"OpenAPI",

0 commit comments

Comments
 (0)