kvcommon 0.2.2__tar.gz → 0.2.4__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 (44) hide show
  1. {kvcommon-0.2.2 → kvcommon-0.2.4}/PKG-INFO +6 -2
  2. {kvcommon-0.2.2 → kvcommon-0.2.4}/pyproject.toml +13 -8
  3. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/exceptions.py +4 -0
  4. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/application.py +1 -1
  5. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/metrics/__init__.py +2 -2
  6. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/metrics/metrics.py +2 -2
  7. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/middleware.py +2 -2
  8. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/responses.py +2 -2
  9. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/scheduler.py +1 -1
  10. kvcommon-0.2.2/src/kvcommon/flask/exceptions.py +0 -5
  11. {kvcommon-0.2.2 → kvcommon-0.2.4}/LICENSE +0 -0
  12. {kvcommon-0.2.2 → kvcommon-0.2.4}/README.md +0 -0
  13. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/constants.py +0 -0
  14. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/datastore/__init__.py +0 -0
  15. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/datastore/backend.py +0 -0
  16. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/datastore/base.py +0 -0
  17. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/__init__.py +0 -0
  18. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/context.py +0 -0
  19. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/headers.py +0 -0
  20. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/traces/__init__.py +0 -0
  21. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/flask/views.py +0 -0
  22. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/__init__.py +0 -0
  23. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/clients/__init__.py +0 -0
  24. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/clients/base.py +0 -0
  25. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/clients/core.py +0 -0
  26. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/clients/custom_objects.py +0 -0
  27. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/clients/networking.py +0 -0
  28. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/__init__.py +0 -0
  29. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/backendconfig.py +0 -0
  30. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/base.py +0 -0
  31. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/iam.py +0 -0
  32. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/ingress.py +0 -0
  33. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/metadata.py +0 -0
  34. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/secret.py +0 -0
  35. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/serializable.py +0 -0
  36. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/entities/service.py +0 -0
  37. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/k8s/utils/gke.py +0 -0
  38. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/logger.py +0 -0
  39. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/misc/__init__.py +0 -0
  40. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/misc/entities.py +0 -0
  41. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/misc/shell.py +0 -0
  42. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/output.py +0 -0
  43. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/types.py +0 -0
  44. {kvcommon-0.2.2 → kvcommon-0.2.4}/src/kvcommon/urls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kvcommon
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Library of miscellaneous common python utils that aren't worthy of their own dedicated libs.
5
5
  Home-page: https://github.com/RAVoigt/kvcommon
6
6
  License: MIT
@@ -15,10 +15,14 @@ Classifier: Programming Language :: Python :: 3.13
15
15
  Provides-Extra: flask
16
16
  Provides-Extra: k8s
17
17
  Provides-Extra: metrics
18
- Requires-Dist: flask (>=3.1.0,<4.0.0)
18
+ Provides-Extra: traces
19
+ Requires-Dist: flask (>=3.1.0,<4.0.0) ; extra == "flask"
19
20
  Requires-Dist: flask-apscheduler (>=1.13.1,<2.0.0) ; extra == "flask"
20
21
  Requires-Dist: flask-http-middleware (>=0.4.2,<0.5.0) ; extra == "flask"
21
22
  Requires-Dist: kubernetes (>=31.0.0,<32.0.0) ; extra == "k8s"
23
+ Requires-Dist: opentelemetry-exporter-otlp ; extra == "traces"
24
+ Requires-Dist: opentelemetry-instrumentation-flask ; extra == "traces"
25
+ Requires-Dist: opentelemetry-instrumentation-logging ; extra == "traces"
22
26
  Requires-Dist: prometheus-client (>=0.20.0,<0.21.0) ; extra == "metrics"
23
27
  Requires-Dist: prometheus-flask-exporter (>=0.23.1,<0.24.0) ; extra == "metrics"
24
28
  Requires-Dist: toml (>=0.10.2,<0.11.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kvcommon"
3
- version = "0.2.2"
3
+ version = "0.2.4"
4
4
  description = "Library of miscellaneous common python utils that aren't worthy of their own dedicated libs."
5
5
  authors = ["Rob Voigt <code@ravoigt.com>"]
6
6
  readme = "README.md"
@@ -32,17 +32,21 @@ toml = "^0.10.2"
32
32
  # ==== Extras
33
33
 
34
34
  # Flask
35
- flask = {version = "^3.1.0", optional = true}
36
- flask-http-middleware = { version = "^0.4.2", optional = true}
37
- flask-apscheduler = { version = "^1.13.1", optional = true}
35
+ flask = { version = "^3.1.0", optional = true }
36
+ flask-http-middleware = { version = "^0.4.2", optional = true }
37
+ flask-apscheduler = { version = "^1.13.1", optional = true }
38
38
 
39
39
  # K8s
40
- kubernetes = { version = "^31.0.0", optional = true}
40
+ kubernetes = { version = "^31.0.0", optional = true }
41
41
 
42
42
  # Metrics
43
- prometheus-client = { version = "^0.20.0", optional = true}
44
- prometheus-flask-exporter = { version = "^0.23.1", optional = true}
43
+ prometheus-client = { version = "^0.20.0", optional = true }
44
+ prometheus-flask-exporter = { version = "^0.23.1", optional = true }
45
45
 
46
+ # Traces
47
+ opentelemetry-exporter-otlp = { version = "*", optional = true } # TODO
48
+ opentelemetry-instrumentation-flask = { version = "*", optional = true } # TODO
49
+ opentelemetry-instrumentation-logging = { version = "*", optional = true } # TODO
46
50
 
47
51
  [tool.poetry.dev-dependencies]
48
52
  black = "*"
@@ -56,6 +60,7 @@ pyfakefs = "*"
56
60
 
57
61
 
58
62
  [tool.poetry.extras]
59
- flask = ["flask-http-middleware", "flask-apscheduler"]
63
+ flask = ["flask", "flask-http-middleware", "flask-apscheduler"]
60
64
  k8s = ["kubernetes"]
61
65
  metrics = ["prometheus-client", "prometheus-flask-exporter"]
66
+ traces = ["opentelemetry-exporter-otlp", "opentelemetry-instrumentation-logging", "opentelemetry-instrumentation-flask"]
@@ -12,3 +12,7 @@ class K8sException(KVCException):
12
12
 
13
13
  class InvalidDataException(K8sException):
14
14
  pass
15
+
16
+
17
+ class KVCFlaskException(KVCException):
18
+ pass
@@ -10,7 +10,7 @@ from flask_http_middleware import MiddlewareManager
10
10
 
11
11
  from kvcommon.logger import get_logger
12
12
  from flask_http_middleware import BaseHTTPMiddleware
13
- from kvcommon_flask.middleware import KVCFlaskMiddleware
13
+ from kvcommon.flask.middleware import KVCFlaskMiddleware
14
14
 
15
15
 
16
16
  LOG = get_logger("needle-proxy")
@@ -4,7 +4,7 @@ from .metrics import HTTP_RESPONSE_COUNT
4
4
  from .metrics import SERVER_REQUEST_SECONDS
5
5
  from .metrics import incr
6
6
  from .metrics import decr
7
- from .metrics import MetricsException
7
+ from .metrics import FlaskMetricsException
8
8
 
9
9
 
10
10
  __all__ = [
@@ -14,5 +14,5 @@ __all__ = [
14
14
  "APP_INFO",
15
15
  "HTTP_RESPONSE_COUNT",
16
16
  "SERVER_REQUEST_SECONDS",
17
- "MetricsException",
17
+ "FlaskMetricsException",
18
18
  ]
@@ -4,10 +4,10 @@ from prometheus_client import Histogram
4
4
  from prometheus_client import Info
5
5
  from prometheus_client import Summary
6
6
 
7
- from kvcommon_flask.exceptions import KVCFlaskException
7
+ from kvcommon.exceptions import KVCFlaskException
8
8
 
9
9
 
10
- class MetricsException(KVCFlaskException):
10
+ class FlaskMetricsException(KVCFlaskException):
11
11
  pass
12
12
 
13
13
 
@@ -8,8 +8,8 @@ from flask_http_middleware import BaseHTTPMiddleware
8
8
  from flask_http_middleware import MiddlewareManager
9
9
 
10
10
  from kvcommon.urls import urlparse_ignore_scheme
11
- from kvcommon_flask import metrics
12
- from kvcommon_flask.context import set_flask_context_local
11
+ from kvcommon.flask import metrics
12
+ from kvcommon.flask.context import set_flask_context_local
13
13
  from kvcommon import logger
14
14
 
15
15
  LOG = logger.get_logger("kvc-flask")
@@ -1,6 +1,6 @@
1
1
  from flask.wrappers import Response as Flask_Response
2
2
 
3
- from kvcommon_flask import metrics
3
+ from kvcommon.flask import metrics
4
4
 
5
5
 
6
6
  class HTTPResponse(Flask_Response):
@@ -39,7 +39,7 @@ class HTTPResponse(Flask_Response):
39
39
 
40
40
  def inc_metrics(self):
41
41
  if self._metrics_emitted_doonce:
42
- raise metrics.MetricsException(
42
+ raise metrics.FlaskMetricsException(
43
43
  "An attempt to emit metrics from this HTTP Response has already been made."
44
44
  )
45
45
  self._metrics_emitted_doonce = True
@@ -6,7 +6,7 @@ from apscheduler.events import EVENT_JOB_ERROR
6
6
  from apscheduler.events import EVENT_JOB_EXECUTED
7
7
  from apscheduler.events import EVENT_JOB_MISSED
8
8
  from apscheduler.events import JobExecutionEvent
9
- from kvcommon_flask import metrics
9
+ from kvcommon.flask import metrics
10
10
  from kvcommon.logger import get_logger
11
11
 
12
12
 
@@ -1,5 +0,0 @@
1
- from kvcommon.exceptions import KVCException
2
-
3
-
4
- class KVCFlaskException(KVCException):
5
- pass
File without changes
File without changes
File without changes
File without changes