Skip to content

Releases: dymmond/lilya

Version 0.15.5

Choose a tag to compare

@tarsil tarsil released this 13 Jun 08:14
88b2425

Added

  • Support for multiplexing a session into multiple session contexts.
  • Added support for redirect_exception when using WSGIMiddleware. This
    flag when passed, you can add a HTTPException exception handler that will make Lilya capture the WSGI exceptions.
  • Exception handlers on a global level can now be passed via settings

Changed

  • SessionContext has now the methods set_session, get_session. No more get/set_connection is used.
  • infer_body is more assertive in the error messages.

Fixed

  • Raise proper error when hitting the inferred body instead of a broad complicated message.

Version 0.15.4

Choose a tag to compare

@tarsil tarsil released this 09 Jun 23:31
7556ace

Added

  • Support for a second form of declaring directives.
  • Support for @directive decorator on top of a Sayer command making it a directive as
    long as it still follows the directive lookup for files.

Fixed

  • Internal definitions and client optimisations.

Version 0.15.3

Choose a tag to compare

@tarsil tarsil released this 08 Jun 16:55
44fe051

Added

  • Added optional infer_body into the settings. This will allow you to do something like this:
from msgspec import Struct
from pydantic import BaseModel


class User(BaseModel):
    name: str
    age: int


class Item(Struct):
    sku: str


async def process_body(user: User, item: Item):
    return {**user.model_dump(), "sku": item.sku}

Where the payload is:

{
    "user": {"name": "lilya", "age": 20},
    "item": {"sku": "test"}
}

Assuming you have the encoders for Pydantic and Struct installed in your application (or any other) you
desire.

Lilya uses the internal Encoders to parse and transform them properly.

!!! Note
infer_body is set to False by default but you can override it in the settings.

Another example can be:

from pydantic import BaseModel


class User(BaseModel):
    name: str
    age: int


async def process_body(user: User):
    return user

Where here the post can be directly sent like:

{
    "name": "lilya", "age": 20
}

Fixed

  • Typing for settings_module that was not parsing properly.
  • requestBody was not displaying when it was required and enabled.
  • The parsing of the request body via decorator and BaseHandler if infer_body is on.

Version 0.15.2

Choose a tag to compare

@tarsil tarsil released this 06 Jun 13:42
51e8baf

Fixed

  • Migration to Sayer missed the run directive argument required as False.
  • Missing apps when generating a project with structure.

Version 0.15.1

Choose a tag to compare

@tarsil tarsil released this 05 Jun 12:18
2e72e14

Fixed

  • This was supposed to go in the release 0.15.0 but a requirement was missing.

Version 0.15.0

Choose a tag to compare

@tarsil tarsil released this 05 Jun 08:47
df26e89

Added

  • Support for OpenAPI documentation under the new @openapi() decorator. This is optional and can be used
    to document your API endpoints with OpenAPI specifications without the need of any external library.

Changed

  • lilya runserver is nor revamped with modern UI and logs.
  • lilya runserver now supports workers and proxy-headers parameters.

Version 0.14.2

Choose a tag to compare

@tarsil tarsil released this 02 Jun 10:41
95eb099

Changed

  • Update internals of cli with the latest Sayer version.

Version 0.14.1

Choose a tag to compare

@tarsil tarsil released this 28 May 14:47
0d5fc5d

Fixed

  • observable was causing AnyIO problems.

Version 0.14.0

Choose a tag to compare

@tarsil tarsil released this 27 May 16:07
bd44bf2

Due to type advancements of the ecosystem, it was decided to drop support for Python 3.9 so we can unify syntaxes and tools.

Added

  • Integration with Sayer for the Lilya CLI. This is a massive milestone for Lilya as it allows
    you to use the Lilya CLI with the Sayer CLI, which is a powerful tool for managing your Lilya applications or any other, really.

Changed

  • Typing for add_route allowing controllers to be recognised.
  • Rename show_urls directive to show-urls. This is a breaking change as the directive name has changed but slightly more
    consistent with the rest of the directives.
  • Drop support for Python 3.9 due technology advancements.

Version 0.13.7

Choose a tag to compare

@tarsil tarsil released this 15 May 07:40
87b7291

Added

  • Add populate_context parameter for GlobalContextMiddleware.
  • Add populate_global_context parameter for Lilya.
  • Add populate_session parameter for SessionMiddleware.
  • LifespanGlobalContextMiddleware which is initializing g for lifespans.

Changed

  • GlobalContextMiddleware was initializing g for lifespans Now this is moved to LifespanGlobalContextMiddleware.

Fixed

  • SessionContext was not working for websockets.
  • Allow sniffing with GlobalRequestContext.