From f31b0d7279f67bfb8ac34d1053483becffd35118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janek=20Nouvertn=C3=A9?= <25355197+provinzkraut@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:12:50 +0100 Subject: [PATCH] v2.5.1 --- docs/release-notes/changelog.rst | 53 ++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- tools/prepare_release.py | 5 +-- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/changelog.rst b/docs/release-notes/changelog.rst index 1226a44c57..2f98ce8249 100644 --- a/docs/release-notes/changelog.rst +++ b/docs/release-notes/changelog.rst @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 783371c4bf..6bcf2b6797 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tools/prepare_release.py b/tools/prepare_release.py index 606008c0ed..e4669186e0 100644 --- a/tools/prepare_release.py +++ b/tools/prepare_release.py @@ -6,6 +6,7 @@ import os import pathlib import re +import shutil import subprocess from collections import defaultdict from dataclasses import dataclass @@ -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