From 142ae39e86aa10e27d6b000e366aa235cf19b086 Mon Sep 17 00:00:00 2001 From: Karl Wooster Date: Mon, 24 Jun 2024 09:33:40 -0700 Subject: [PATCH] build(postgres): add __future__ annotations supports python 3.9 use log_info instead of print and updates a few pre-commit dependencies --- .pre-commit-config.yaml | 6 +++--- bridge/service/postgres.py | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1239db..4737e79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,13 +26,13 @@ repos: hooks: - id: check-json5 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.7 + rev: v0.4.10 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.16.0 hooks: - id: pyupgrade - args: [--py311-plus,--py36-plus,--py37-plus,--py38-plus,--py39-plus,--py310-plus,--py311-plus,--py312-plus] + args: [--py36-plus,--py37-plus,--py38-plus,--py39-plus,--py310-plus,--py311-plus,--py312-plus] diff --git a/bridge/service/postgres.py b/bridge/service/postgres.py index 2cb4eeb..c438841 100644 --- a/bridge/service/postgres.py +++ b/bridge/service/postgres.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import os import sys @@ -7,7 +9,7 @@ import psycopg from pydantic import BaseModel, Field -from bridge.console import log_error, log_task +from bridge.console import log_error, log_info, log_task from bridge.service.docker import ContainerConfig, DockerService from bridge.utils.filesystem import resolve_dot_bridge @@ -63,7 +65,7 @@ def __init__( def ensure_ready(self): dsn = self.config.environment.dsn msg = f"DSN: {dsn}" - print(msg) + log_info(msg) with log_task( start_message=f"Waiting for [white]{self.config.name}[/white] to be ready", end_message=f"[white]{self.config.name}[/white] is ready",