c2cwsgiutils 6.1.7__tar.gz → 6.1.7.dev2__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 (66) hide show
  1. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/PKG-INFO +1 -1
  2. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/image.py +3 -10
  3. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/prometheus.py +3 -9
  4. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/pyproject.toml +1 -1
  5. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/LICENSE +0 -0
  6. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/README.md +0 -0
  7. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/__init__.py +0 -0
  8. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/__init__.py +0 -0
  9. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/connection.py +0 -0
  10. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/package-lock.json +0 -0
  11. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/package.json +0 -0
  12. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/print.py +0 -0
  13. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/screenshot.js +0 -0
  14. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/utils.py +0 -0
  15. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/auth.py +0 -0
  16. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/__init__.py +0 -0
  17. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/interface.py +0 -0
  18. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/local.py +0 -0
  19. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/redis.py +0 -0
  20. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/utils.py +0 -0
  21. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/client_info.py +0 -0
  22. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/config_utils.py +0 -0
  23. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/coverage_setup.py +0 -0
  24. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/db.py +0 -0
  25. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/db_maintenance_view.py +0 -0
  26. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/__init__.py +0 -0
  27. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/_listeners.py +0 -0
  28. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/_views.py +0 -0
  29. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/utils.py +0 -0
  30. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/errors.py +0 -0
  31. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/health_check.py +0 -0
  32. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/index.py +0 -0
  33. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/loader.py +0 -0
  34. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/logging_view.py +0 -0
  35. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/models_graph.py +0 -0
  36. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/pretty_json.py +0 -0
  37. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/profiler.py +0 -0
  38. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/py.typed +0 -0
  39. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/pyramid.py +0 -0
  40. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/pyramid_logging.py +0 -0
  41. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/redis_stats.py +0 -0
  42. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/redis_utils.py +0 -0
  43. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/request_tracking/__init__.py +0 -0
  44. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/request_tracking/_sql.py +0 -0
  45. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/__init__.py +0 -0
  46. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/genversion.py +0 -0
  47. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/stats_db.py +0 -0
  48. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/test_print.py +0 -0
  49. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sentry.py +0 -0
  50. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/services.py +0 -0
  51. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/setup_process.py +0 -0
  52. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
  53. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
  54. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
  55. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
  56. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
  57. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
  58. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
  59. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
  60. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/static/favicon-16x16.png +0 -0
  61. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/static/favicon-32x32.png +0 -0
  62. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
  63. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
  64. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
  65. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/templates/index.html.mako +0 -0
  66. {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cwsgiutils
3
- Version: 6.1.7
3
+ Version: 6.1.7.dev2
4
4
  Summary: Common utilities for Camptocamp WSGI applications
5
5
  Home-page: https://github.com/camptocamp/c2cwsgiutils
6
6
  License: BSD-2-Clause
@@ -58,7 +58,7 @@ def normalize_image(image: NpNdarrayInt) -> NpNdarrayInt:
58
58
  return image
59
59
 
60
60
 
61
- def check_image( # pylint: disable=too-many-locals,too-many-statements
61
+ def check_image(
62
62
  result_folder: str,
63
63
  image_to_check: NpNdarrayInt,
64
64
  expected_filename: str,
@@ -108,13 +108,6 @@ def check_image( # pylint: disable=too-many-locals,too-many-statements
108
108
 
109
109
  mask = None
110
110
  if mask_filename is not None:
111
- background_color = [255, 255, 255]
112
- for color in range(3):
113
- img_hist, _ = skimage.exposure.histogram(
114
- image_to_check[..., color], nbins=256, source_range="dtype"
115
- )
116
- background_color[color] = np.argmax(img_hist)
117
-
118
111
  mask = skimage.io.imread(mask_filename)
119
112
 
120
113
  assert mask is not None, "Wrong mask: " + mask_filename
@@ -137,7 +130,7 @@ def check_image( # pylint: disable=too-many-locals,too-many-statements
137
130
  assert (
138
131
  mask.shape[0] == image_to_check.shape[0] and mask.shape[1] == image_to_check.shape[1]
139
132
  ), f"Mask and image should have the same shape ({mask.shape} != {image_to_check.shape})"
140
- image_to_check[mask] = background_color
133
+ image_to_check[mask] = [255, 255, 255]
141
134
 
142
135
  if not os.path.exists(result_folder):
143
136
  os.makedirs(result_folder)
@@ -155,7 +148,7 @@ def check_image( # pylint: disable=too-many-locals,too-many-statements
155
148
  assert (
156
149
  expected.shape[0] == mask.shape[0] and expected.shape[1] == mask.shape[1]
157
150
  ), f"Mask and expected image should have the same shape ({mask.shape} != {expected.shape})"
158
- expected[mask] = background_color
151
+ expected[mask] = [255, 255, 255]
159
152
 
160
153
  assert (
161
154
  expected.shape == image_to_check.shape
@@ -1,6 +1,5 @@
1
1
  """Every thing we needs to have the metrics in Prometheus."""
2
2
 
3
- import logging
4
3
  import os
5
4
  import re
6
5
  from collections.abc import Generator, Iterable
@@ -12,12 +11,10 @@ import prometheus_client.metrics_core
12
11
  import prometheus_client.multiprocess
13
12
  import prometheus_client.registry
14
13
  import pyramid.config
15
- import redis.exceptions
16
14
 
17
15
  from c2cwsgiutils import broadcast, redis_utils
18
16
  from c2cwsgiutils.debug.utils import dump_memory_maps
19
17
 
20
- _LOG = logging.getLogger(__name__)
21
18
  _NUMBER_RE = re.compile(r"^[0-9]+$")
22
19
  MULTI_PROCESS_COLLECTOR_BROADCAST_CHANNELS = [
23
20
  "c2cwsgiutils_prometheus_collector_gc",
@@ -120,12 +117,9 @@ class MultiProcessCustomCollector(prometheus_client.registry.Collector):
120
117
  def collect(self) -> Generator[prometheus_client.core.Metric, None, None]:
121
118
  results: list[list[SerializedMetric]] = []
122
119
  for channel in MULTI_PROCESS_COLLECTOR_BROADCAST_CHANNELS:
123
- try:
124
- result = broadcast.broadcast(channel, expect_answers=True)
125
- if result is not None:
126
- results.extend(cast(Iterable[list[SerializedMetric]], result))
127
- except redis.exceptions.ConnectionError:
128
- _LOG.error("Failed to get the metrics from the other processes")
120
+ result = broadcast.broadcast(channel, expect_answers=True)
121
+ if result is not None:
122
+ results.extend(cast(Iterable[list[SerializedMetric]], result))
129
123
  return _deserialize_collected_data(results)
130
124
 
131
125
 
@@ -16,7 +16,7 @@ strict = true
16
16
 
17
17
  [tool.poetry]
18
18
  name = "c2cwsgiutils"
19
- version = "6.1.7"
19
+ version = "6.1.7.dev2"
20
20
  description = "Common utilities for Camptocamp WSGI applications"
21
21
  readme = "README.md"
22
22
  authors = ["Camptocamp <info@camptocamp.com>"]
File without changes