Skip to content

Releases: lsst-sqre/safir

3.5.0

12 Jan 21:06
@rra rra
3.5.0
5e3cb8d
Compare
Choose a tag to compare

This release adds safir.pydantic.CamelCaseModel to further automate support for camel-case attributes in Pydantic models. It also adds the helper class safir.gcs.SignedURLService to generate signed URLs for Google Cloud Storage objects, and the module safir.testing.gcs to provide a mock of the Google Cloud Storage API for testing.

What's Changed

  • DM-37192: Enable more mypy checks by @rra in #125
  • [neophile] Update dependencies by @sqrbot in #126
  • Generate API docs for safir.asyncio by @jonathansick in #127
  • DM-37291: Add CamelCaseModel helper class by @rra in #128
  • [neophile] Update dependencies by @sqrbot in #129
  • [neophile] Update dependencies by @sqrbot in #130
  • DM-37516: Add Google Cloud Storage utilities and testing support by @rra in #131

Full Changelog: 3.4.0...3.5.0

3.4.0

29 Nov 17:16
@rra rra
3.4.0
4e324f4
Compare
Choose a tag to compare

The 3.4.0 release adds new functions safir.pydantic.normalize_datetime, safir.pydantic.to_camel_case, and safir.pydantic.validate_exactly_one_of, which are helpful for some common Pydantic validation and configuration use cases. It also adds new enums for Profile and LogLevel that can be passed to safir.logging.configure_logging and safir.logging.configure_uvicorn_logging, allowing better validation of Safir-related application configuration. Finally, it fixes a bug in the Kubernetes mock API, where an intended spec constraint was not applied due to an ordering problem.

What's Changed

  • Install graphviz for periodic doc build by @jonathansick in #119
  • [neophile] Update dependencies by @sqrbot in #120
  • DM-37046: Add Profile and LogLevel enums by @rra in #121
  • DM-37051: Drop now-unnecessary types from docs by @rra in #122
  • [neophile] Update dependencies by @sqrbot in #123
  • DM-37051: Add some Pydantic helper functions from Gafaelfawr by @rra in #124

Full Changelog: 3.3.0...3.4.0

3.3.0

15 Sep 16:15
@rra rra
3.3.0
5010c39
Compare
Choose a tag to compare

The 3.3.0 release adds a new function, safir.logging.configure_uvicorn_logging, that routes Uvicorn logs through structlog and adds the context expected by Google's Cloud Logging. The safir.metadata.get_metadata function now also supports packages that use only pyproject.toml.

What's Changed

  • [neophile] Update dependencies by @sqrbot in #107
  • DM-30063: Update logging documentation by @rra in #108
  • Avoid Sphinx 5.1.0 by @rra in #109
  • [neophile] Update dependencies by @sqrbot in #110
  • [neophile] Update dependencies by @sqrbot in #111
  • DM-28121: Handle the new pyproject.toml package metadata by @rra in #112
  • Bump arq from 0.23a1 to 0.23 by @dependabot in #113
  • [neophile] Update dependencies by @sqrbot in #114
  • DM-36156: Drop use of sqlalchemy _IsolationLevel type by @jonathansick in #116
  • DM-36156: Refresh Safir packaging and adopt new Rubin user guide theme by @jonathansick in #117
  • DM-35879: Support sending Uvicorn logs through structlog by @rra in #118

Full Changelog: 3.2.0...3.3.0

3.2.0

13 Jun 19:49
6fee2a3
Compare
Choose a tag to compare

The 3.2.0 release adds new support for arq, the Redis-based asyncio distributed queue package. The safir.arq module provides an arq client and metadata/result data classes with a mock implementation for testing. The FastAPI dependency, safir.dependencies.arq.arq_dependency, provides a convenient way to use the arq client from HTTP handlers.

What's Changed

Full Changelog: 3.1.0...3.2.0

3.1.0

01 Jun 23:23
@rra rra
3.1.0
3afe21a
Compare
Choose a tag to compare
  • Add new FastAPI middleware CaseInsensitiveQueryMiddleware to aid in implementing the IVOA protocol requirement that the keys of query parameters be case-isensitive.

3.0.3

16 May 20:05
@rra rra
3.0.3
29339c0
Compare
Choose a tag to compare
  • Correctly handle the possibility that request.client is None.

3.0.2

25 Mar 20:47
@rra rra
3.0.2
fcef667
Compare
Choose a tag to compare
  • Fix handling of passwords containing special characters such as @ and / in safir.database.

3.0.1

24 Feb 21:53
7bbc252
Compare
Choose a tag to compare
  • safir.database retains the port in the database URL, if provided.

3.0.0

24 Feb 03:47
@rra rra
3.0.0
3e080de
Compare
Choose a tag to compare
  • XForwardedMiddleware no longer sets forwaded_proto in the request state and instead directly updates the request scope so that subsequent handlers and middleware believe the request scheme is that given by an X-Forwarded-Proto header. This fixes the scheme returned by other request methods and attributes such as url_for in cases where the service is behind an ingress that terminates TLS.
  • Add new FastAPI dependencies auth_dependency and auth_logger_dependency from the safir.dependencies.gafaelfawr module. auth_dependency returns the username of the user authenticated via Gafaelfawr (pulled from the X-Auth-Request-User header. auth_logger_dependency returns the same logger as logger_dependency but with the user parameter bound to the username from auth_dependency.
  • Add utility functions to initialize a database and create a sync or async session. The session creation functions optionally support a health check to ensure the database schema has been initialized.
  • Add new FastAPI dependency db_session_dependency that creates a task-local async SQLAlchemy session.
  • Add utility functions datetime_from_db and datetime_to_db to convert between timezone-naive UTC datetimes stored in a database and timezone-aware UTC datetimes used elsewhere in a program.
  • Add a run_with_async decorator that runs the decorated async function synchronously. This is primarily useful for decorating Click command functions (for a command-line interface) that need to make async calls.

2.4.0

13 Jan 19:47
@rra rra
2.4.0
3a1f054
Compare
Choose a tag to compare
  • Add an initialize_kubernetes helper function to load Kubernetes configuration. Add the safir.testing.kubernetes module, which can be used to mock the Kubernetes API for testing. To use the new Kubernetes support, depend on safir[kubernetes].