Skip to content

Releases: dymmond/lilya

Version 0.18.2

29 Jul 11:11
f6f987a
Compare
Choose a tag to compare

Added

  • Added support for Query parameter markers.

    • Implemented alias support for query parameters to map custom keys.
    • Introduced cast field in Query for runtime type coercion with validation.
    • Improved error handling for missing and invalid query parameter types.
  • Introduced Header and Cookie parameter markers with value, required, and cast support.

  • Expanded documentation into a comprehensive “Request Parameters” guide covering declaration, options, and real-world examples for all three types.

Version 0.18.1

25 Jul 10:41
c5080bf
Compare
Choose a tag to compare

Changed

  • Update directives to reflect the new settings.

Fixed

  • Cache dependency on json native library.

Version 0.18.0

21 Jul 16:25
ee1ad41
Compare
Choose a tag to compare

Added

  • Support for native cache with default to InMemory.
  • Add support for relative urls from the URL datastructure.
  • Support for OpenAPI on Controllers by applying internal identity descriptors.

Changed

In the past, Lilya was using dataclass to manage all the settings but we found out that can be a bit combersome for a lot
of people that are more used to slighly cleaner interfaces and therefore, the internal API was updated to stop using @dataclass and
use directly a typed Settings object.

  • Replace Settings to stop using @dataclass and start using direct objects instead.

Example before

from dataclasses import dataclass, field
from lilya.conf.global_settings import Settings


@dataclass
class MyCustomSettings(Settings):
    hosts: list[str] = field(default_factory=lambda: ["example.com"])

Example after

from lilya.conf.global_settings import Settings


class MyCustomSettings(Settings):
    hosts: list[str] = ["example.com"]

This makes the code cleaner and readable.

  • Apply AnyIO to DataUpload instead of using BinaryIO.

Version 0.17.1

18 Jul 22:07
9c8b32f
Compare
Choose a tag to compare

Changed

  • Dual‑mode support in run_sync: Now accepts either an async function with args or a standalone coroutine object.
  • Input normalization: Uses inspect to detect and wrap calls into a zero‑argument coroutine factory.
  • Seamless execution: Drives work on the main thread via anyio.run,
    with a clean fallback to ThreadPoolExecutor if an event loop is active.
  • Error clarity: Raises a precise TypeError when the argument is neither a coroutine function nor object.
  • Simplified API: Eliminates nested lambdas by centralizing logic into a single wrapper_fn
    passed to anyio.run.

Version 0.17.0

18 Jul 10:20
6416f26
Compare
Choose a tag to compare

Added

  • Missing validation that was supposed to go on the version 0.16.10 and it was not pushed.

Changed

  • Mark http_exception in the Exception as async to avoid thread creation.
  • Replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction.
  • Replace asyncio in run_sync with anyio.
  • Refactor run_sync from lilya.compat.

Version 0.16.10

17 Jul 13:52
97b5a20
Compare
Choose a tag to compare

Fixed

  • infer_body with complex dependencies and path params evaluation when infer_body=True

Version 0.16.9

13 Jul 15:02
501a7ec
Compare
Choose a tag to compare

Changed

  • Unify dependency injection logic for both Controller and handlers.
  • Unify logic for body inferring for Controller and handlers.

Version 0.16.8

11 Jul 19:02
d7fa656
Compare
Choose a tag to compare

Added

  • Add support for multi-byterange requests and responses.
  • Add retro-compatibility for path_for with an alias url_for. This allows easier integration with other libraries
    that use url_for as the method to generate URLs.

Changed

  • Add lru_cache to some of the methods that are used to generate URLs. This allows for better performance
    when generating URLs that are frequently used.
  • Automatic Generator Unwrapping: Provide and async_resolve_dependencies now detect both sync and async generator dependencies,
    advance them to yield the real return value, and inject that into handlers.

Version 0.16.7

04 Jul 14:15
e85d880
Compare
Choose a tag to compare

Note

There was a part of the commit that was not properly pushed and this could cause inconsistencies and therefore a quick small release was done.

Changed

  • Dependencies with infer_body consistency check.

Version 0.16.6

04 Jul 11:16
fd4d21b
Compare
Choose a tag to compare

Added

  • Lilya run directive now injects the g global context for usage in the directives in offline mode.
  • Support for http ranges (bytes).
  • Support if-range header.
  • Added fallback dependency injection: Handlers can now receive dependencies even without explicitly using Provides(),
    as long as they are defined in the app or route.
  • Improved optional injection logic: Dependencies declared with Provides() are treated as required, while others are injected only if available—ensuring flexibility and safety.
  • Unified behavior across HTTP and WebSocket handlers: Dependency resolution logic now consistently supports both explicit and fallback injection in all handler types.

Changed

  • Don't execute stream or analyze file for options for FileResponse, StreamingResponse. It is certainly unwanted and expensive.
  • Don't execute background tasks for options and head. This is certainly unwanted.
  • Add allow_range_requests parameter to FileResponse for allowing to disable http range serving.
  • Deprecate the undocumented method parameter. It has no effect anymore. We infer it correctly from scope.

Fixed

  • FileResponse and StreamResponse can deduce from scope headers if the request is headless.