c2cwsgiutils 6.2.0.dev147__tar.gz → 6.2.0.dev152__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of c2cwsgiutils might be problematic. Click here for more details.
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/PKG-INFO +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/utils.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/broadcast/__init__.py +3 -3
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/broadcast/redis.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/db_maintenance_view.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/debug/_views.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/health_check.py +4 -4
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/index.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/logging_view.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/redis_stats.py +2 -2
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/redis_utils.py +3 -3
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/request_tracking/__init__.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/scripts/stats_db.py +3 -3
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sentry.py +2 -2
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sql_profiler/_impl.py +2 -2
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/handlers.py +1 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/pyproject.toml +12 -1
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/LICENSE +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/README.md +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/connection.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/image.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/package-lock.json +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/package.json +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/print.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/screenshot.js +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/auth.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/broadcast/interface.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/broadcast/local.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/broadcast/utils.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/client_info.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/config_utils.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/coverage_setup.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/db.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/debug/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/debug/_listeners.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/debug/utils.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/errors.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/loader.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/models_graph.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/pretty_json.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/profiler.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/prometheus.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/py.typed +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/pyramid.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/pyramid_logging.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/request_tracking/_sql.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/scripts/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/scripts/genversion.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/scripts/test_print.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/services.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/setup_process.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/examples/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/static/favicon-16x16.png +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/static/favicon-32x32.png +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/templates/index.html.mako +0 -0
- {c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/version.py +0 -0
|
@@ -43,7 +43,7 @@ def retry_timeout(what: Callable[[], Any], timeout: float = _DEFAULT_TIMEOUT, in
|
|
|
43
43
|
return ret
|
|
44
44
|
except NameError:
|
|
45
45
|
raise
|
|
46
|
-
except Exception as e: #
|
|
46
|
+
except Exception as e: # noqa: BLE001
|
|
47
47
|
error = str(e)
|
|
48
48
|
_LOG.info(" Failed: %s", e)
|
|
49
49
|
if time.perf_counter() > timeout:
|
|
@@ -30,7 +30,7 @@ def includeme(config: pyramid.config.Configurator | None = None) -> None:
|
|
|
30
30
|
|
|
31
31
|
Otherwise, fall back to a fake local implementation.
|
|
32
32
|
"""
|
|
33
|
-
global _broadcaster #
|
|
33
|
+
global _broadcaster # noqa: PLW0603
|
|
34
34
|
broadcast_prefix = config_utils.env_or_config(
|
|
35
35
|
config,
|
|
36
36
|
_BROADCAST_ENV_KEY,
|
|
@@ -53,7 +53,7 @@ def includeme(config: pyramid.config.Configurator | None = None) -> None:
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
def _get(need_init: bool = False) -> interface.BaseBroadcaster:
|
|
56
|
-
global _broadcaster #
|
|
56
|
+
global _broadcaster # noqa: PLW0603
|
|
57
57
|
if _broadcaster is None:
|
|
58
58
|
if need_init:
|
|
59
59
|
_LOG.error("Broadcast functionality used before it is setup")
|
|
@@ -63,7 +63,7 @@ def _get(need_init: bool = False) -> interface.BaseBroadcaster:
|
|
|
63
63
|
|
|
64
64
|
def cleanup() -> None:
|
|
65
65
|
"""Cleanup the broadcaster to force to reinitialize it."""
|
|
66
|
-
global _broadcaster #
|
|
66
|
+
global _broadcaster # noqa: PLW0603
|
|
67
67
|
_broadcaster = None
|
|
68
68
|
|
|
69
69
|
|
|
@@ -49,7 +49,7 @@ class RedisBroadcaster(interface.BaseBroadcaster):
|
|
|
49
49
|
data = json.loads(message["data"])
|
|
50
50
|
try:
|
|
51
51
|
response = callback(**data["params"])
|
|
52
|
-
except Exception as e: #
|
|
52
|
+
except Exception as e: # noqa: BLE001
|
|
53
53
|
_LOG.error("Failed handling a broadcast message", exc_info=True)
|
|
54
54
|
response = {"status": 500, "message": str(e)}
|
|
55
55
|
answer_channel = data.get("answer_channel")
|
|
@@ -62,7 +62,7 @@ def _restore(config: pyramid.config.Configurator) -> None:
|
|
|
62
62
|
db.FORCE_READONLY = readonly == "true"
|
|
63
63
|
except ImportError:
|
|
64
64
|
pass # don't have redis
|
|
65
|
-
except Exception: #
|
|
65
|
+
except Exception: # noqa: BLE001
|
|
66
66
|
# survive an error since crashing now can have bad consequences for the service. :/
|
|
67
67
|
_LOG.error("Cannot restore readonly DB status.", exc_info=True)
|
|
68
68
|
|
|
@@ -79,7 +79,7 @@ def _dump_memory_diff(request: pyramid.request.Request) -> list[Any]:
|
|
|
79
79
|
try:
|
|
80
80
|
if request.params.get("no_warmup", "0").lower() in ("1", "true", "on"):
|
|
81
81
|
request.invoke_subrequest(sub_request)
|
|
82
|
-
except Exception: #
|
|
82
|
+
except Exception: # noqa: BLE001, S110
|
|
83
83
|
pass
|
|
84
84
|
|
|
85
85
|
_LOG.debug("checking memory growth for %s", path)
|
|
@@ -188,7 +188,7 @@ def _get_alembic_version(alembic_ini_path: Path, name: str) -> str:
|
|
|
188
188
|
).decode("utf-8")
|
|
189
189
|
out_match = _ALEMBIC_HEAD_RE.match(out)
|
|
190
190
|
if not out_match:
|
|
191
|
-
raise Exception( #
|
|
191
|
+
raise Exception( # noqa: TRY002
|
|
192
192
|
"Cannot get the alembic HEAD version from: " + out,
|
|
193
193
|
)
|
|
194
194
|
return out_match.group(1)
|
|
@@ -324,7 +324,7 @@ class HealthCheck:
|
|
|
324
324
|
error_message = (
|
|
325
325
|
f"Invalid alembic version (db: {actual_version}, code: {version_})"
|
|
326
326
|
)
|
|
327
|
-
raise Exception(error_message) #
|
|
327
|
+
raise Exception(error_message) # noqa: TRY002
|
|
328
328
|
return version_
|
|
329
329
|
|
|
330
330
|
self._checks.append(
|
|
@@ -395,7 +395,7 @@ class HealthCheck:
|
|
|
395
395
|
def add(name: str, func: Callable[..., Any], *args: Any) -> None:
|
|
396
396
|
try:
|
|
397
397
|
result[name] = func(*args)
|
|
398
|
-
except Exception as e: #
|
|
398
|
+
except Exception as e: # noqa: BLE001
|
|
399
399
|
result[name] = {"error": str(e)}
|
|
400
400
|
|
|
401
401
|
if master is not None:
|
|
@@ -506,7 +506,7 @@ class HealthCheck:
|
|
|
506
506
|
if result is not None:
|
|
507
507
|
results["successes"][name]["result"] = result
|
|
508
508
|
_set_success(check_name=name)
|
|
509
|
-
except Exception as e: #
|
|
509
|
+
except Exception as e: # noqa: BLE001
|
|
510
510
|
_PROMETHEUS_HEALTH_CHECKS_FAILURE.labels(name=name).set(1)
|
|
511
511
|
_LOG.warning("Health check %s failed", name, exc_info=True)
|
|
512
512
|
failure = {"message": str(e), "timing": time.perf_counter() - start, "level": level}
|
|
@@ -108,7 +108,7 @@ def form(url: str | None, *content: str, method: str = "get", target: str = "_bl
|
|
|
108
108
|
|
|
109
109
|
def input_(name: str, label: str | None = None, type_: str | None = None, value: str | int = "") -> str:
|
|
110
110
|
"""Get an HTML input."""
|
|
111
|
-
global _ELEM_ID #
|
|
111
|
+
global _ELEM_ID # noqa: PLW0603
|
|
112
112
|
id_ = _ELEM_ID
|
|
113
113
|
_ELEM_ID += 1
|
|
114
114
|
|
|
@@ -74,7 +74,7 @@ def _restore_overrides(config: pyramid.config.Configurator) -> None:
|
|
|
74
74
|
logging.getLogger(name).setLevel(level)
|
|
75
75
|
except ImportError:
|
|
76
76
|
pass # don't have redis
|
|
77
|
-
except Exception: #
|
|
77
|
+
except Exception: # noqa: BLE001
|
|
78
78
|
# survive an error there. Logging levels is not business critical...
|
|
79
79
|
_LOG.warning("Cannot restore logging levels", exc_info=True)
|
|
80
80
|
|
|
@@ -33,7 +33,7 @@ def init(config: pyramid.config.Configurator | None = None) -> None:
|
|
|
33
33
|
|
|
34
34
|
def includeme(config: pyramid.config.Configurator | None = None) -> None:
|
|
35
35
|
"""Initialize the Redis tracking."""
|
|
36
|
-
global _ORIG #
|
|
36
|
+
global _ORIG # noqa: PLW0603
|
|
37
37
|
if config_utils.env_or_config(
|
|
38
38
|
config,
|
|
39
39
|
"C2C_TRACK_REDIS",
|
|
@@ -47,5 +47,5 @@ def includeme(config: pyramid.config.Configurator | None = None) -> None:
|
|
|
47
47
|
_ORIG = redis.client.Redis.execute_command
|
|
48
48
|
redis.client.Redis.execute_command = _execute_command_patch # type: ignore[method-assign,assignment]
|
|
49
49
|
_LOG.info("Enabled the redis tracking")
|
|
50
|
-
except Exception: #
|
|
50
|
+
except Exception: # noqa: BLE001
|
|
51
51
|
_LOG.warning("Cannot enable redis tracking", exc_info=True)
|
|
@@ -32,7 +32,7 @@ _sentinel: redis.sentinel.Sentinel | None = None
|
|
|
32
32
|
|
|
33
33
|
def cleanup() -> None:
|
|
34
34
|
"""Cleanup the redis connections."""
|
|
35
|
-
global _master, _slave, _sentinel #
|
|
35
|
+
global _master, _slave, _sentinel # noqa: PLW0603
|
|
36
36
|
_master = None
|
|
37
37
|
_slave = None
|
|
38
38
|
_sentinel = None
|
|
@@ -52,7 +52,7 @@ def get(
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
def _init(settings: Mapping[str, Any] | None) -> None:
|
|
55
|
-
global _master, _slave, _sentinel #
|
|
55
|
+
global _master, _slave, _sentinel # noqa: PLW0603
|
|
56
56
|
sentinels = c2cwsgiutils.config_utils.env_or_settings(
|
|
57
57
|
settings,
|
|
58
58
|
REDIS_SENTINELS_KEY,
|
|
@@ -131,7 +131,7 @@ class PubSubWorkerThread(threading.Thread):
|
|
|
131
131
|
_LOG.warning("Redis connection problem")
|
|
132
132
|
last_was_ok = False
|
|
133
133
|
time.sleep(0.5)
|
|
134
|
-
except Exception: #
|
|
134
|
+
except Exception: # noqa: BLE001
|
|
135
135
|
_LOG.warning("Unexpected error", exc_info=True)
|
|
136
136
|
_LOG.info("Redis subscription worker stopped")
|
|
137
137
|
pubsub.close()
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/request_tracking/__init__.py
RENAMED
|
@@ -99,7 +99,7 @@ def includeme(config: pyramid.config.Configurator | None = None) -> None:
|
|
|
99
99
|
Use a X-Request-ID (or other) header to track all the logs related to a request
|
|
100
100
|
including on the sub services.
|
|
101
101
|
"""
|
|
102
|
-
global _ID_HEADERS, _DEFAULT_TIMEOUT #
|
|
102
|
+
global _ID_HEADERS, _DEFAULT_TIMEOUT # noqa: PLW0603
|
|
103
103
|
_ID_HEADERS = ["X-Request-ID", "X-Correlation-ID", "Request-ID", "X-Varnish", "X-Amzn-Trace-Id"]
|
|
104
104
|
if config is not None:
|
|
105
105
|
extra_header = config_utils.env_or_config(config, "C2C_REQUEST_ID_HEADER", "c2c.request_id_header")
|
|
@@ -275,7 +275,7 @@ def _do_dtats_db(args: argparse.Namespace) -> None:
|
|
|
275
275
|
_LOG.info("Process table %s.%s.", schema, table)
|
|
276
276
|
try:
|
|
277
277
|
do_table(session, schema, table, reporter)
|
|
278
|
-
except Exception as e: #
|
|
278
|
+
except Exception as e: # noqa: BLE001
|
|
279
279
|
_LOG.exception("Process table %s.%s error.", schema, table)
|
|
280
280
|
reporter.error([schema, table], e)
|
|
281
281
|
|
|
@@ -284,7 +284,7 @@ def _do_dtats_db(args: argparse.Namespace) -> None:
|
|
|
284
284
|
_LOG.info("Process extra %s.", extra)
|
|
285
285
|
try:
|
|
286
286
|
do_extra(session, extra, "extra", "Extra metric", reporter)
|
|
287
|
-
except Exception as e: #
|
|
287
|
+
except Exception as e: # noqa: BLE001
|
|
288
288
|
_LOG.exception("Process extra %s error.", extra)
|
|
289
289
|
reporter.error(["extra", str(pos + 1)], e)
|
|
290
290
|
if args.extra_gauge:
|
|
@@ -293,7 +293,7 @@ def _do_dtats_db(args: argparse.Namespace) -> None:
|
|
|
293
293
|
_LOG.info("Process extra %s.", extra)
|
|
294
294
|
try:
|
|
295
295
|
do_extra(session, sql, gauge, gauge_help, reporter)
|
|
296
|
-
except Exception as e: #
|
|
296
|
+
except Exception as e: # noqa: BLE001
|
|
297
297
|
_LOG.exception("Process extra %s error.", extra)
|
|
298
298
|
reporter.error(["extra", str(len(args.extra) + pos + 1)], e)
|
|
299
299
|
|
|
@@ -39,7 +39,7 @@ def init(config: pyramid.config.Configurator | None = None) -> None:
|
|
|
39
39
|
|
|
40
40
|
def includeme(config: pyramid.config.Configurator | None = None) -> None:
|
|
41
41
|
"""Initialize the Sentry integration."""
|
|
42
|
-
global _CLIENT_SETUP #
|
|
42
|
+
global _CLIENT_SETUP # noqa: PLW0603
|
|
43
43
|
sentry_url = config_utils.env_or_config(config, "SENTRY_URL", "c2c.sentry.url")
|
|
44
44
|
if sentry_url is not None and not _CLIENT_SETUP:
|
|
45
45
|
client_info: MutableMapping[str, Any] = {
|
|
@@ -184,7 +184,7 @@ def filter_wsgi_app(application: Callable[..., Any]) -> Callable[..., Any]:
|
|
|
184
184
|
try:
|
|
185
185
|
_LOG.info("Enable WSGI filter for Sentry")
|
|
186
186
|
return SentryWsgiMiddleware(application)
|
|
187
|
-
except Exception: #
|
|
187
|
+
except Exception: # noqa: BLE001
|
|
188
188
|
_LOG.error("Failed enabling sentry. Continuing without it.", exc_info=True)
|
|
189
189
|
return application
|
|
190
190
|
else:
|
|
@@ -57,7 +57,7 @@ class _Repository:
|
|
|
57
57
|
],
|
|
58
58
|
)
|
|
59
59
|
_LOG.info(output)
|
|
60
|
-
except Exception: #
|
|
60
|
+
except Exception: # noqa: BLE001, S110
|
|
61
61
|
pass
|
|
62
62
|
|
|
63
63
|
|
|
@@ -70,7 +70,7 @@ def _sql_profiler_view(request: pyramid.request.Request) -> Mapping[str, Any]:
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
def _setup_profiler(enable: str) -> None:
|
|
73
|
-
global _REPOSITORY #
|
|
73
|
+
global _REPOSITORY # noqa: PLW0603
|
|
74
74
|
if config_utils.config_bool(enable):
|
|
75
75
|
if _REPOSITORY is None:
|
|
76
76
|
_LOG.info("Enabling the SQL profiler")
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/handlers.py
RENAMED
|
@@ -85,7 +85,7 @@ class SQLAlchemyHandler(logging.Handler):
|
|
|
85
85
|
self.session.rollback()
|
|
86
86
|
self.session.bulk_save_objects(logs)
|
|
87
87
|
self.session.commit()
|
|
88
|
-
except Exception as e: #
|
|
88
|
+
except Exception as e: # noqa: BLE001
|
|
89
89
|
# if we really cannot commit the log to DB, do not lock the
|
|
90
90
|
# thread and do not crash the application
|
|
91
91
|
_LOG.critical(e)
|
|
@@ -2,9 +2,20 @@
|
|
|
2
2
|
target-version = "py310"
|
|
3
3
|
line-length = 110
|
|
4
4
|
|
|
5
|
+
[tool.ruff.lint]
|
|
6
|
+
select = []
|
|
7
|
+
ignore = ["ANN401", "C90", "D100", "D104", "D105", "D107", "D200", "D202", "D207", "D208", "D212", "E501", "EM101", "EM102", "ERA001", "FA", "FBT001", "FBT002", "FIX", "FIX002", "I001", "PERF203", "PLR09", "PLR2004", "Q000", "S101", "S113", "SIM105", "T201", "TD", "TD002", "W293"]
|
|
8
|
+
extend-select = ["UP", "I", "S", "B", "ALL"]
|
|
9
|
+
|
|
5
10
|
[tool.ruff.lint.pydocstyle]
|
|
6
11
|
convention = "numpy"
|
|
7
12
|
|
|
13
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
14
|
+
"tests/**" = ["ANN", "ARG", "D", "E722", "INP001", "RET", "RUF012", "RUF100", "SLF"]
|
|
15
|
+
"**/tests/**" = ["ANN", "ARG", "D", "E722", "INP001", "RET", "RUF012", "RUF100", "SLF"]
|
|
16
|
+
"**/test_*.py" = ["ANN", "ARG", "D", "E722", "INP001", "RET", "RUF012", "RUF100", "SLF"]
|
|
17
|
+
"**/*_test.py" = ["ANN", "ARG", "D", "E722", "INP001", "RET", "RUF012", "RUF100", "SLF"]
|
|
18
|
+
|
|
8
19
|
[tool.poetry]
|
|
9
20
|
|
|
10
21
|
[tool.poetry.plugins."plaster.loader_factory"]
|
|
@@ -216,7 +227,7 @@ include = [
|
|
|
216
227
|
]
|
|
217
228
|
requires-python = ">=3.10"
|
|
218
229
|
dependencies = ["requests", "pyyaml", "ujson", "cee_syslog_handler", "prometheus-client"]
|
|
219
|
-
version = "6.2.0.
|
|
230
|
+
version = "6.2.0.dev152"
|
|
220
231
|
|
|
221
232
|
[project.urls]
|
|
222
233
|
repository = "https://github.com/camptocamp/c2cwsgiutils"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/connection.py
RENAMED
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/package-lock.json
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/package.json
RENAMED
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/acceptance/screenshot.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/request_tracking/_sql.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sql_profiler/__init__.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/README.md
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/__init__.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/_filters.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/sqlalchemylogger/_models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/static/favicon-16x16.png
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/static/favicon-32x32.png
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/stats_pyramid/__init__.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/stats_pyramid/_db_spy.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py
RENAMED
|
File without changes
|
{c2cwsgiutils-6.2.0.dev147 → c2cwsgiutils-6.2.0.dev152}/c2cwsgiutils/templates/index.html.mako
RENAMED
|
File without changes
|
|
File without changes
|