c2cwsgiutils 6.2.0.dev377__tar.gz → 6.2.0.dev379__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.
Files changed (67) hide show
  1. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/PKG-INFO +14 -9
  2. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/README.md +13 -8
  3. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sqlalchemylogger/README.md +11 -6
  4. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/pyproject.toml +3 -3
  5. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/LICENSE +0 -0
  6. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/__init__.py +0 -0
  7. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/__init__.py +0 -0
  8. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/connection.py +0 -0
  9. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/image.py +0 -0
  10. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/package-lock.json +0 -0
  11. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/package.json +0 -0
  12. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/print.py +0 -0
  13. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/screenshot.js +0 -0
  14. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/acceptance/utils.py +0 -0
  15. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/auth.py +0 -0
  16. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/broadcast/__init__.py +0 -0
  17. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/broadcast/interface.py +0 -0
  18. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/broadcast/local.py +0 -0
  19. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/broadcast/redis.py +0 -0
  20. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/broadcast/utils.py +0 -0
  21. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/client_info.py +0 -0
  22. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/config_utils.py +0 -0
  23. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/coverage_setup.py +0 -0
  24. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/db.py +0 -0
  25. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/db_maintenance_view.py +0 -0
  26. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/debug/__init__.py +0 -0
  27. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/debug/_listeners.py +0 -0
  28. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/debug/_views.py +0 -0
  29. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/debug/utils.py +0 -0
  30. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/errors.py +0 -0
  31. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/health_check.py +0 -0
  32. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/index.py +0 -0
  33. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/loader.py +0 -0
  34. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/logging_view.py +0 -0
  35. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/models_graph.py +0 -0
  36. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/pretty_json.py +0 -0
  37. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/profiler.py +0 -0
  38. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/prometheus.py +0 -0
  39. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/py.typed +0 -0
  40. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/pyramid.py +0 -0
  41. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/pyramid_logging.py +0 -0
  42. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/redis_stats.py +0 -0
  43. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/redis_utils.py +0 -0
  44. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/request_tracking/__init__.py +0 -0
  45. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/request_tracking/_sql.py +0 -0
  46. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/scripts/__init__.py +0 -0
  47. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/scripts/genversion.py +0 -0
  48. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/scripts/stats_db.py +0 -0
  49. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/scripts/test_print.py +0 -0
  50. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sentry.py +0 -0
  51. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/services.py +0 -0
  52. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/setup_process.py +0 -0
  53. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
  54. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
  55. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
  56. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
  57. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
  58. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sqlalchemylogger/examples/__init__.py +0 -0
  59. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
  60. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
  61. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/static/favicon-16x16.png +0 -0
  62. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/static/favicon-32x32.png +0 -0
  63. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
  64. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
  65. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
  66. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/templates/index.html.mako +0 -0
  67. {c2cwsgiutils-6.2.0.dev377 → c2cwsgiutils-6.2.0.dev379}/c2cwsgiutils/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: c2cwsgiutils
3
- Version: 6.2.0.dev377
3
+ Version: 6.2.0.dev379
4
4
  Summary: Common utilities for Camptocamp WSGI applications
5
5
  License-Expression: BSD-2-Clause
6
6
  License-File: LICENSE
@@ -317,6 +317,7 @@ To enable most of the features of c2cwsgiutils, you need to add this line to you
317
317
 
318
318
  ```python
319
319
  import c2cwsgiutils.pyramid
320
+
320
321
  config.include(c2cwsgiutils.pyramid.includeme)
321
322
  ```
322
323
 
@@ -413,7 +414,7 @@ Or with the `with` statement:
413
414
  ```python
414
415
  from c2cwsgiutils.profile import Profiler
415
416
 
416
- with Profile('/my_file.prof'):
417
+ with Profile("/my_file.prof"):
417
418
  ...
418
419
  ```
419
420
 
@@ -450,10 +451,9 @@ And your code that initializes the DB connection must look like that:
450
451
  ```python
451
452
  import c2cwsgiutils.db
452
453
 
454
+
453
455
  def main(config):
454
- c2cwsgiutils.db.init(config, 'sqlalchemy', 'sqlalchemy_slave', force_slave=[
455
- "POST /api/hello"
456
- ])[0]
456
+ c2cwsgiutils.db.init(config, "sqlalchemy", "sqlalchemy_slave", force_slave=["POST /api/hello"])[0]
457
457
  ```
458
458
 
459
459
  You can use the `force_slave` and `force_master` parameters to override the defaults and force a route to use
@@ -467,17 +467,19 @@ setup). For example:
467
467
  ```python
468
468
  from c2cwsgiutils.health_check import HealthCheck
469
469
 
470
+
470
471
  def custom_check(request):
471
472
  global not_happy
472
473
  if not_happy:
473
474
  raise Exception("I'm not happy")
474
475
  return "happy"
475
476
 
477
+
476
478
  health_check = HealthCheck(config)
477
479
  health_check.add_db_session_check(models.DBSession, at_least_one_model=models.Hello)
478
- health_check.add_url_check('http://localhost:8080/api/hello')
479
- health_check.add_custom_check('custom', custom_check, 2)
480
- health_check.add_alembic_check(models.DBSession, '/app/alembic.ini', 3)
480
+ health_check.add_url_check("http://localhost:8080/api/hello")
481
+ health_check.add_custom_check("custom", custom_check, 2)
482
+ health_check.add_alembic_check(models.DBSession, "/app/alembic.ini", 3)
481
483
  ```
482
484
 
483
485
  Then, the URL `{C2C_BASE_PATH}/health_check?max_level=3` can be used to run the health checks and get a report
@@ -718,11 +720,13 @@ To have CORS compliant views, define your views like that:
718
720
 
719
721
  ```python
720
722
  from c2cwsgiutils import services
723
+
721
724
  hello_service = services.create("hello", "/hello", cors_credentials=True)
722
725
 
726
+
723
727
  @hello_service.get()
724
728
  def hello_get(request):
725
- return {'hello': True}
729
+ return {"hello": True}
726
730
  ```
727
731
 
728
732
  ## Waitress
@@ -906,6 +910,7 @@ To do the image test call `check_screenshot` e.g.:
906
910
  ```python
907
911
  from c2cwsgiutils.acceptance import image
908
912
 
913
+
909
914
  def test_screenshot(app_connection):
910
915
  image.check_screenshot(
911
916
  app_connection.base_url + "my-path",
@@ -200,6 +200,7 @@ To enable most of the features of c2cwsgiutils, you need to add this line to you
200
200
 
201
201
  ```python
202
202
  import c2cwsgiutils.pyramid
203
+
203
204
  config.include(c2cwsgiutils.pyramid.includeme)
204
205
  ```
205
206
 
@@ -296,7 +297,7 @@ Or with the `with` statement:
296
297
  ```python
297
298
  from c2cwsgiutils.profile import Profiler
298
299
 
299
- with Profile('/my_file.prof'):
300
+ with Profile("/my_file.prof"):
300
301
  ...
301
302
  ```
302
303
 
@@ -333,10 +334,9 @@ And your code that initializes the DB connection must look like that:
333
334
  ```python
334
335
  import c2cwsgiutils.db
335
336
 
337
+
336
338
  def main(config):
337
- c2cwsgiutils.db.init(config, 'sqlalchemy', 'sqlalchemy_slave', force_slave=[
338
- "POST /api/hello"
339
- ])[0]
339
+ c2cwsgiutils.db.init(config, "sqlalchemy", "sqlalchemy_slave", force_slave=["POST /api/hello"])[0]
340
340
  ```
341
341
 
342
342
  You can use the `force_slave` and `force_master` parameters to override the defaults and force a route to use
@@ -350,17 +350,19 @@ setup). For example:
350
350
  ```python
351
351
  from c2cwsgiutils.health_check import HealthCheck
352
352
 
353
+
353
354
  def custom_check(request):
354
355
  global not_happy
355
356
  if not_happy:
356
357
  raise Exception("I'm not happy")
357
358
  return "happy"
358
359
 
360
+
359
361
  health_check = HealthCheck(config)
360
362
  health_check.add_db_session_check(models.DBSession, at_least_one_model=models.Hello)
361
- health_check.add_url_check('http://localhost:8080/api/hello')
362
- health_check.add_custom_check('custom', custom_check, 2)
363
- health_check.add_alembic_check(models.DBSession, '/app/alembic.ini', 3)
363
+ health_check.add_url_check("http://localhost:8080/api/hello")
364
+ health_check.add_custom_check("custom", custom_check, 2)
365
+ health_check.add_alembic_check(models.DBSession, "/app/alembic.ini", 3)
364
366
  ```
365
367
 
366
368
  Then, the URL `{C2C_BASE_PATH}/health_check?max_level=3` can be used to run the health checks and get a report
@@ -601,11 +603,13 @@ To have CORS compliant views, define your views like that:
601
603
 
602
604
  ```python
603
605
  from c2cwsgiutils import services
606
+
604
607
  hello_service = services.create("hello", "/hello", cors_credentials=True)
605
608
 
609
+
606
610
  @hello_service.get()
607
611
  def hello_get(request):
608
- return {'hello': True}
612
+ return {"hello": True}
609
613
  ```
610
614
 
611
615
  ## Waitress
@@ -789,6 +793,7 @@ To do the image test call `check_screenshot` e.g.:
789
793
  ```python
790
794
  from c2cwsgiutils.acceptance import image
791
795
 
796
+
792
797
  def test_screenshot(app_connection):
793
798
  image.check_screenshot(
794
799
  app_connection.base_url + "my-path",
@@ -10,6 +10,7 @@ or create a new logger by calling the `logging.getlogger` method.
10
10
  import logging
11
11
  from c2cwsgiutils.sqlalchemylogger.handlers import SQLAlchemyHandler
12
12
 
13
+
13
14
  def _setup_sqlalchemy_logger():
14
15
  """
15
16
  Setup sqlalchemy logger.
@@ -26,8 +27,11 @@ def _setup_sqlalchemy_logger():
26
27
  )
27
28
  logger.addHandler(handler)
28
29
 
30
+
29
31
  def main(_, **settings):
30
- _setup_sqlalchemy_logger ()
32
+ _setup_sqlalchemy_logger()
33
+
34
+
31
35
  ...
32
36
  ```
33
37
 
@@ -49,16 +53,16 @@ import time
49
53
 
50
54
  from c2cwsgiutils.sqlalchemylogger.handlers import SQLAlchemyHandler
51
55
 
52
- if __name__ == '__main__':
56
+ if __name__ == "__main__":
53
57
  logging.basicConfig(
54
- format='%(asctime)s : %(name)s : %(levelname)s : %(message)s',
58
+ format="%(asctime)s : %(name)s : %(levelname)s : %(message)s",
55
59
  level=logging.DEBUG,
56
60
  )
57
61
  logger = logging.getLogger(__name__)
58
- logger_db_engine = {'url':'sqlite:///logger_db.sqlite3'}
62
+ logger_db_engine = {"url": "sqlite:///logger_db.sqlite3"}
59
63
 
60
64
  logger.addHandler(SQLAlchemyHandler(logger_db_engine))
61
- logger.info('bla')
65
+ logger.info("bla")
62
66
  # wait a few seconds because the second thread will write the
63
67
  # logs after a timeout
64
68
  time.sleep(2)
@@ -84,7 +88,8 @@ propagate = 0
84
88
  ```python
85
89
  def post_fork(server, worker):
86
90
  import logging
87
- logger = logging.getHandlerByName('sqlalchemylogger')
91
+
92
+ logger = logging.getHandlerByName("sqlalchemylogger")
88
93
  logger.start()
89
94
  ```
90
95
 
@@ -173,8 +173,8 @@ types-redis = "4.6.0.20241004"
173
173
  types-ujson = "5.10.0.20250822"
174
174
  types-python-dateutil = "2.9.0.20260807"
175
175
  typing_extensions = "4.16.0"
176
- ruff = "0.16.4"
177
- pylint = "4.0.7"
176
+ ruff = "0.16.9"
177
+ pylint = "4.0.9"
178
178
 
179
179
  [tool.poetry-dynamic-versioning]
180
180
  enable = false
@@ -229,7 +229,7 @@ include = [
229
229
  ]
230
230
  requires-python = ">=3.11"
231
231
  dependencies = ["requests", "pyyaml", "ujson", "cee_syslog_handler", "prometheus-client", "setuptools<81.0.0"]
232
- version = "6.2.0.dev377"
232
+ version = "6.2.0.dev379"
233
233
 
234
234
  [project.urls]
235
235
  repository = "https://github.com/camptocamp/c2cwsgiutils"