Skip to content

Commit

Permalink
chore: prepare release 0.17.2 (#932)
Browse files Browse the repository at this point in the history
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 <github-actions@github.com>
  • Loading branch information
dbanty and GitHub committed Jan 15, 2024
1 parent 20cfce8 commit 30d8a37
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 43 deletions.

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/fix_ruff_formatting_for_metanone.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/include_the_up_rule_for_generated_ruff_config.md

This file was deleted.

36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,42 @@ Programmatic usage of this project (e.g., importing it as a Python module) and t

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).

## 0.17.2 (2024-01-15)

### 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`.

## 0.17.1 (2024-01-04)

### Features
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
"typing-extensions>=4.8.0,<5.0.0",
]
name = "openapi-python-client"
version = "0.17.1"
version = "0.17.2"
description = "Generate modern Python clients from OpenAPI"
keywords = [
"OpenAPI",
Expand Down

0 comments on commit 30d8a37

Please sign in to comment.