Releases: lsst-sqre/safir
Releases · lsst-sqre/safir
5.2.2
Bug fixes
- Ensure that per-request database sessions provided by
db_session_dependency
are cleaned up even if the request aborts with an uncaught exception.
What's Changed
- Update dependencies, fix deprecations by @rra in #240
- Update Ruff configuration by @rra in #241
- DM-43288: Ensure per-request database sessions are closed by @rra in #242
- DM-43288: Prepare release 5.2.2 by @rra in #243
Full Changelog: 5.2.1...5.2.2
5.2.1
Bug fixes
- Fix the return type of
safir.datetime.parse_isodatetime
to not includeNone
since the function never returnsNone
.
What's Changed
- Update kubernetes-asyncio requirement from <29 to <30 by @dependabot in #233
- Update cryptography requirement from <42 to <43 by @dependabot in #234
- Bump pre-commit/action from 3.0.0 to 3.0.1 by @dependabot in #236
- DM-42714: Use Annotated for dependency arguments by @rra in #235
- Fix minor documentation build issues by @rra in #237
- DM-42937: Fix return type of parse_isodatetime by @rra in #238
- DM-42937: Prepare 5.2.1 release by @rra in #239
Full Changelog: 5.2.0...5.2.1
5.2.0
New features
- Add a FastAPI dependency for retrieving a Gafaelfawr delegated token from the request headers:
safir.dependencies.gafaelfawr.auth_delegated_token_dependency
.
Bug fixes
- Rewrite
CaseInsensitiveQueryMiddleware
andXForwardedMiddleware
as pure ASGI middleware rather than using the StarletteBaseHTTPMiddleware
class. The latter seems to be behind some poor error reporting of application exceptions, has caused problems in the past due to its complexity, and is not used internally by Starlette middleware.
What's Changed
- Bump actions/setup-python from 4 to 5 by @dependabot in #227
- Exclude buggy version of structlog by @rra in #228
- Update structlog requirement from !=23.3.0,<24,>=21.2.0 to >=21.2.0,!=23.3.0,<25 by @dependabot in #229
- DM-42527: Rewrite middleware as pure ASGI middleware by @rra in #230
- DM-42190: Add gafaelfawr delegated token FastAPI dependency by @dhirving in #231
- DM-42527: Prepare release 5.2.0 by @rra in #232
New Contributors
Full Changelog: 5.1.0...5.2.0
5.1.0
5.0.0
Backwards-incompatible changes
- Safir now depends on Pydantic v2. Python code that uses any part of Safir related to Pydantic will also need to update to Pydantic v2, since the API is significantly different. See the Pydantic migration guide for more information.
safir.pydantic.validate_exactly_one_of
is now a Pydantic model validator. It must be called withmode="after"
, since it operates in the model rather than on a raw dictionary.- Remove the
GitHubAppClientFactory.create_app_client
method, which does not work with the Gidgethub API. Instead, the documentation shows how to create a JWT with theGitHubAppClientFactory
and pass it with requests. safir.github.GitHubAppClientFactory
now expects the application ID and installation ID (forcreate_installation_client
) to be of typeint
, notstr
. This appears to match what GitHub's API returns, but not what Gidgethub expects. The ID is converted to a string when passing it to Gidgethub.
New features
- Allow the
safir.logging.LogLevel
enum to be created from strings of any case, which will allow the logging level to be specified with any case for Safir applications that use Pydantic to validate the field. - Add validated but ignored optional
propagation_policy
arguments to every delete method of the Kubernetes mock for better compatibility with the actual Kubernetes API. Previously, this argument was only accepted bydelete_namespaced_job
. - All mock Kubernetes methods now accept and ignore a
_request_timeout
error for better compatibility with the Kubernetes API. - Add delete, list, and watch support for persistent volume claims to the Kubernetes mock.
Bug fixes
safir.database.datetime_to_db
,safir.datetime.format_datetime_for_logging
, andsafir.datetime.isodatetime
now accept anydatetime
object with a time zone whose offset from UTC is 0, rather than only thedatetime.UTC
time zone object.safir.pydantic.normalize_datetime
now explicitly rejects input other than seconds since epoch or datetime objects with a validation error rather than attempting to treat the input as a datetime object and potentially throwing more obscure errors.- The
_request_timeout
parameters to mock Kubernetes methods now accept a float instead of an int to more correctly match the types of kubernetes_asyncio. The mock still does not accept a tuple of timeouts. - Avoid reusing the same metadata object when creating a
Pod
from aJob
. Previous versions modified thespec
part of theJob
when adding additional metadata to the childPod
.
Other changes
- Safir is now tested with Python 3.12 as well as Python 3.11.
What's Changed
- DM-398710: Remove GitHubAppClientFactory.create_app_client by @jonathansick in #207
- DM-40744: Convert to Pydantic v2 by @rra in #204
- Doc fix: spawn_uvicorn example by @fritzm in #209
- Update kubernetes-asyncio requirement from <26 to <27 by @dependabot in #208
- Update kubernetes-asyncio requirement from <27 to <28 by @dependabot in #210
- Fix spawn_uvicorn documentation by @rra in #211
- DM-23878: Allow log level enum with any case by @rra in #212
- Update kubernetes-asyncio requirement from <28 to <29 by @dependabot in #213
- DM-41630: Add propagation_policy to Kubernetes mock deletes by @rra in #214
- DM-41630: Support _request_timeout in Kubernetes mock by @rra in #215
- DM-41630: Fix type of Kubernetes mock _request_timeout by @rra in #218
- DM-41630: Update development Redis dependencies by @rra in #216
- DM-41630: Convert to FastAPI lifespan functions by @rra in #217
- DM-41708: Fix Pod creation from Job in Kubernetes mock by @rra in #221
- DM-41708: Add more mocks for Kubernetes PVCs by @rra in #220
- DM-41820: Fix annotations on Pod created from Job by @rra in #222
- DM-41998: Add support for Python 3.12 by @rra in #223
- DM-41998: Prepare 5.0.0 release by @rra in #224
Full Changelog: 4.5.0...5.0.0
5.0.0a5
5.0.0a4
What's Changed
- DM-41630: Update development Redis dependencies by @rra in #216
- DM-41630: Convert to FastAPI lifespan functions by @rra in #217
- DM-41708: Fix Pod creation from Job in Kubernetes mock by @rra in #221
- DM-41708: Add more mocks for Kubernetes PVCs by @rra in #220
Full Changelog: 5.0.0a3...5.0.0a4
5.0.0a3
What's Changed
- Update kubernetes-asyncio requirement from <28 to <29 by @dependabot in #213
- DM-41630: Add propagation_policy to Kubernetes mock deletes by @rra in #214
- DM-41630: Support _request_timeout in Kubernetes mock by @rra in #215
- DM-41630: Fix type of Kubernetes mock _request_timeout by @rra in #218
Full Changelog: 5.0.0a2...5.0.0a3
5.0.0a2
What's Changed
- Doc fix: spawn_uvicorn example by @fritzm in #209
- Update kubernetes-asyncio requirement from <26 to <27 by @dependabot in #208
- Update kubernetes-asyncio requirement from <27 to <28 by @dependabot in #210
- Fix spawn_uvicorn documentation by @rra in #211
- DM-23878: Allow log level enum with any case by @rra in #212
Full Changelog: 5.0.0a1...5.0.0a2
5.0.0a1
What's Changed
- DM-398710: Remove GitHubAppClientFactory.create_app_client by @jonathansick in #207
- DM-40744: Convert to Pydantic v2 by @rra in #204
Full Changelog: 4.5.0...5.0.0a1