Skip to content

Commit

Permalink
v2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut committed Jan 18, 2024
1 parent 5f243f9 commit f31b0d7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
53 changes: 53 additions & 0 deletions docs/release-notes/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,59 @@
2.x Changelog
=============

.. changelog:: 2.5.1
:date: 2024/01/18

.. change:: Fix OpenAPI schema generation for Union of multiple ``msgspec.Struct``\ s and ``None``
:type: bugfix
:pr: 2982
:issue: 2971

The following code would raise a :exc:`TypeError`

.. code-block:: python
import msgspec
from litestar import get
from litestar.testing import create_test_client
class StructA(msgspec.Struct):
pass
class StructB(msgspec.Struct):
pass
@get("/")
async def handler() -> StructA | StructB | None:
return StructA()
.. change:: Fix misleading error message for missing dependencies provide by a package extra
:type: bugfix
:pr: 2921

Ensure that :exc:`MissingDependencyException` includes the correct name of the
package to install if the package name differs from the Litestar package extra.
(e.g. ``pip install litestar[jinja]`` vs ``pip install jinja2``). Previously the
exception assumed the same name for both the package and package-extra name.


.. change:: Fix OpenAPI schema file upload schema types for swagger
:type: bugfix
:pr: 2745
:issue: 2628

- Always set ``format`` as ``binary``
- Fix schema for swagger with multiple files, which requires the type of the
request body schema to be ``object`` with ``properties`` instead of a schema
of type ``array`` and ``items``.



.. changelog:: 2.5.0
:date: 2024/01/06

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ maintainers = [
name = "litestar"
readme = "README.md"
requires-python = ">=3.8,<4.0"
version = "2.5.0"
version = "2.5.1"

[project.urls]
Blog = "https://blog.litestar.dev"
Expand Down
5 changes: 3 additions & 2 deletions tools/prepare_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import pathlib
import re
import shutil
import subprocess
from collections import defaultdict
from dataclasses import dataclass
Expand Down Expand Up @@ -297,12 +298,12 @@ def _get_gh_token() -> str:
click.secho("Using GitHub token from env", fg="blue")
return gh_token

gh_executable = subprocess.run(["which", "gh"], check=True, capture_output=True, text=True).stdout
gh_executable = shutil.which("gh")
if not gh_executable:
click.secho("GitHub CLI not installed", fg="yellow")
else:
click.secho("Using GitHub CLI to obtain GitHub token", fg="blue")
proc = subprocess.run(["auth", "token"], executable=gh_executable, check=True, capture_output=True, text=True)
proc = subprocess.run([gh_executable, "auth", "token"], check=True, capture_output=True, text=True)
if out := (proc.stdout or "").strip():
return out

Expand Down

0 comments on commit f31b0d7

Please sign in to comment.