Skip to content

Commit

Permalink
Run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ger-benjamin committed Jun 17, 2024
1 parent f4b924f commit 8cdd48e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Release 6.1

- The `handlers` in the `.ini` files don't support `args` anymore. You must use `kwargs`
arguments. Example `args = (sys.stdout,)` becomes `kwargs = {'stream': 'ext://sys.stdout'}`.
- SqlAlchemy logger must now be instantiated by your app's `main` method and not by your
`.ini` file. Read the example in the sqlalchemylogger folder.
- The `handlers` in the `.ini` files don't support `args` anymore. You must use `kwargs`
arguments. Example `args = (sys.stdout,)` becomes `kwargs = {'stream': 'ext://sys.stdout'}`.
- SqlAlchemy logger must now be instantiated by your app's `main` method and not by your
`.ini` file. Read the example in the sqlalchemylogger folder.

## Release 6.0

Expand Down
3 changes: 1 addition & 2 deletions acceptance_tests/app/c2cwsgiutils_app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from c2cwsgiutils_app import models
from pyramid.config import Configurator
from pyramid.httpexceptions import HTTPInternalServerError

import c2cwsgiutils.pyramid
from c2cwsgiutils import broadcast, db
from c2cwsgiutils.health_check import HealthCheck, JsonCheckException

from c2cwsgiutils_app import models


def _failure(_request):
raise HTTPInternalServerError("failing check")
Expand Down
3 changes: 1 addition & 2 deletions acceptance_tests/app/c2cwsgiutils_app/get_hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import psycopg2
import transaction
from c2cwsgiutils_app import models

import c2cwsgiutils.db
import c2cwsgiutils.setup_process

from c2cwsgiutils_app import models


def _fill_db():
for db, value in (("db", "master"), ("db_slave", "slave")):
Expand Down
3 changes: 1 addition & 2 deletions acceptance_tests/app/c2cwsgiutils_app/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import prometheus_client
import requests
from c2cwsgiutils_app import models
from pyramid.httpexceptions import (
HTTPBadRequest,
HTTPForbidden,
Expand All @@ -12,8 +13,6 @@

from c2cwsgiutils import sentry, services

from c2cwsgiutils_app import models

_PROMETHEUS_TEST_COUNTER = prometheus_client.Counter("test_counter", "Test counter")
_PROMETHEUS_TEST_GAUGE = prometheus_client.Gauge("test_gauge", "Test gauge", ["value", "toto"])
_PROMETHEUS_TEST_SUMMARY = prometheus_client.Summary("test_summary", "Test summary")
Expand Down
4 changes: 2 additions & 2 deletions acceptance_tests/app/models_graph.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python3
from c2cwsgiutils.models_graph import generate_model_graph

from c2cwsgiutils_app import models

from c2cwsgiutils.models_graph import generate_model_graph


def main():
generate_model_graph(models)
Expand Down
3 changes: 1 addition & 2 deletions c2cwsgiutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ast
import configparser
import logging
import os
import re
import ast
import sys
from configparser import SectionProxy
from typing import Any
Expand Down Expand Up @@ -33,7 +33,6 @@ def get_config_defaults() -> dict[str, str]:
def _create_handlers(config: configparser.ConfigParser) -> dict[str, Any]:
handlers = [k.strip() for k in config["handlers"]["keys"].split(",")]
d_handlers: dict[str, Any] = {}
stream_re = re.compile(r"\((.*?),\)")
for hh in handlers:
block = config[f"handler_{hh}"]
if "args" in block:
Expand Down
1 change: 1 addition & 0 deletions c2cwsgiutils/sqlalchemylogger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def main(_, **settings):
_setup_sqlalchemy_logger ()
...
```

Do not set up this sqlalchemy logger in you `.ini` file directly.
It won't work (multi process issue).

Expand Down

0 comments on commit 8cdd48e

Please sign in to comment.