provide-foundation 0.0.0.dev1__py3-none-any.whl → 0.0.0.dev3__py3-none-any.whl

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 (163) hide show
  1. provide/foundation/__init__.py +36 -10
  2. provide/foundation/archive/__init__.py +1 -1
  3. provide/foundation/archive/base.py +15 -14
  4. provide/foundation/archive/bzip2.py +40 -40
  5. provide/foundation/archive/gzip.py +42 -42
  6. provide/foundation/archive/operations.py +93 -96
  7. provide/foundation/archive/tar.py +33 -31
  8. provide/foundation/archive/zip.py +52 -50
  9. provide/foundation/asynctools/__init__.py +20 -0
  10. provide/foundation/asynctools/core.py +126 -0
  11. provide/foundation/cli/__init__.py +2 -2
  12. provide/foundation/cli/commands/deps.py +15 -9
  13. provide/foundation/cli/commands/logs/__init__.py +3 -3
  14. provide/foundation/cli/commands/logs/generate.py +2 -2
  15. provide/foundation/cli/commands/logs/query.py +4 -4
  16. provide/foundation/cli/commands/logs/send.py +3 -3
  17. provide/foundation/cli/commands/logs/tail.py +3 -3
  18. provide/foundation/cli/decorators.py +11 -11
  19. provide/foundation/cli/main.py +1 -1
  20. provide/foundation/cli/testing.py +2 -40
  21. provide/foundation/cli/utils.py +21 -18
  22. provide/foundation/config/__init__.py +35 -2
  23. provide/foundation/config/base.py +2 -2
  24. provide/foundation/config/converters.py +477 -0
  25. provide/foundation/config/defaults.py +67 -0
  26. provide/foundation/config/env.py +6 -20
  27. provide/foundation/config/loader.py +10 -4
  28. provide/foundation/config/sync.py +8 -6
  29. provide/foundation/config/types.py +5 -5
  30. provide/foundation/config/validators.py +4 -4
  31. provide/foundation/console/input.py +5 -5
  32. provide/foundation/console/output.py +36 -14
  33. provide/foundation/context/__init__.py +8 -4
  34. provide/foundation/context/core.py +88 -110
  35. provide/foundation/crypto/certificates/__init__.py +9 -5
  36. provide/foundation/crypto/certificates/base.py +2 -2
  37. provide/foundation/crypto/certificates/certificate.py +48 -19
  38. provide/foundation/crypto/certificates/factory.py +26 -18
  39. provide/foundation/crypto/certificates/generator.py +24 -23
  40. provide/foundation/crypto/certificates/loader.py +24 -16
  41. provide/foundation/crypto/certificates/operations.py +17 -10
  42. provide/foundation/crypto/certificates/trust.py +21 -21
  43. provide/foundation/env/__init__.py +28 -0
  44. provide/foundation/env/core.py +218 -0
  45. provide/foundation/errors/__init__.py +3 -3
  46. provide/foundation/errors/decorators.py +0 -234
  47. provide/foundation/errors/types.py +0 -98
  48. provide/foundation/eventsets/display.py +13 -14
  49. provide/foundation/eventsets/registry.py +61 -31
  50. provide/foundation/eventsets/resolver.py +50 -46
  51. provide/foundation/eventsets/sets/das.py +8 -8
  52. provide/foundation/eventsets/sets/database.py +14 -14
  53. provide/foundation/eventsets/sets/http.py +21 -21
  54. provide/foundation/eventsets/sets/llm.py +16 -16
  55. provide/foundation/eventsets/sets/task_queue.py +13 -13
  56. provide/foundation/eventsets/types.py +7 -7
  57. provide/foundation/file/directory.py +14 -23
  58. provide/foundation/file/lock.py +4 -3
  59. provide/foundation/hub/components.py +75 -389
  60. provide/foundation/hub/config.py +157 -0
  61. provide/foundation/hub/discovery.py +63 -0
  62. provide/foundation/hub/handlers.py +89 -0
  63. provide/foundation/hub/lifecycle.py +195 -0
  64. provide/foundation/hub/manager.py +7 -4
  65. provide/foundation/hub/processors.py +49 -0
  66. provide/foundation/integrations/__init__.py +11 -0
  67. provide/foundation/{observability → integrations}/openobserve/__init__.py +10 -7
  68. provide/foundation/{observability → integrations}/openobserve/auth.py +1 -1
  69. provide/foundation/{observability → integrations}/openobserve/client.py +14 -14
  70. provide/foundation/{observability → integrations}/openobserve/commands.py +12 -12
  71. provide/foundation/integrations/openobserve/config.py +37 -0
  72. provide/foundation/{observability → integrations}/openobserve/formatters.py +1 -1
  73. provide/foundation/{observability → integrations}/openobserve/otlp.py +2 -2
  74. provide/foundation/{observability → integrations}/openobserve/search.py +2 -3
  75. provide/foundation/{observability → integrations}/openobserve/streaming.py +5 -5
  76. provide/foundation/logger/__init__.py +0 -1
  77. provide/foundation/logger/config/base.py +1 -1
  78. provide/foundation/logger/config/logging.py +69 -299
  79. provide/foundation/logger/config/telemetry.py +39 -121
  80. provide/foundation/logger/factories.py +2 -2
  81. provide/foundation/logger/processors/main.py +12 -10
  82. provide/foundation/logger/ratelimit/limiters.py +4 -4
  83. provide/foundation/logger/ratelimit/processor.py +1 -1
  84. provide/foundation/logger/setup/coordinator.py +39 -25
  85. provide/foundation/logger/setup/processors.py +3 -3
  86. provide/foundation/logger/setup/testing.py +14 -0
  87. provide/foundation/logger/trace.py +5 -5
  88. provide/foundation/metrics/__init__.py +1 -1
  89. provide/foundation/metrics/otel.py +3 -1
  90. provide/foundation/observability/__init__.py +3 -3
  91. provide/foundation/process/__init__.py +9 -0
  92. provide/foundation/process/exit.py +48 -0
  93. provide/foundation/process/lifecycle.py +69 -46
  94. provide/foundation/resilience/__init__.py +36 -0
  95. provide/foundation/resilience/circuit.py +166 -0
  96. provide/foundation/resilience/decorators.py +236 -0
  97. provide/foundation/resilience/fallback.py +208 -0
  98. provide/foundation/resilience/retry.py +327 -0
  99. provide/foundation/serialization/__init__.py +16 -0
  100. provide/foundation/serialization/core.py +70 -0
  101. provide/foundation/streams/config.py +78 -0
  102. provide/foundation/streams/console.py +4 -5
  103. provide/foundation/streams/core.py +5 -2
  104. provide/foundation/streams/file.py +12 -2
  105. provide/foundation/testing/__init__.py +29 -9
  106. provide/foundation/testing/archive/__init__.py +7 -7
  107. provide/foundation/testing/archive/fixtures.py +58 -54
  108. provide/foundation/testing/cli.py +30 -20
  109. provide/foundation/testing/common/__init__.py +13 -15
  110. provide/foundation/testing/common/fixtures.py +27 -57
  111. provide/foundation/testing/file/__init__.py +15 -15
  112. provide/foundation/testing/file/content_fixtures.py +289 -0
  113. provide/foundation/testing/file/directory_fixtures.py +107 -0
  114. provide/foundation/testing/file/fixtures.py +42 -516
  115. provide/foundation/testing/file/special_fixtures.py +145 -0
  116. provide/foundation/testing/logger.py +89 -8
  117. provide/foundation/testing/mocking/__init__.py +21 -21
  118. provide/foundation/testing/mocking/fixtures.py +80 -67
  119. provide/foundation/testing/process/__init__.py +23 -23
  120. provide/foundation/testing/process/async_fixtures.py +414 -0
  121. provide/foundation/testing/process/fixtures.py +48 -571
  122. provide/foundation/testing/process/subprocess_fixtures.py +210 -0
  123. provide/foundation/testing/threading/__init__.py +17 -17
  124. provide/foundation/testing/threading/basic_fixtures.py +105 -0
  125. provide/foundation/testing/threading/data_fixtures.py +101 -0
  126. provide/foundation/testing/threading/execution_fixtures.py +278 -0
  127. provide/foundation/testing/threading/fixtures.py +32 -502
  128. provide/foundation/testing/threading/sync_fixtures.py +100 -0
  129. provide/foundation/testing/time/__init__.py +11 -11
  130. provide/foundation/testing/time/fixtures.py +95 -83
  131. provide/foundation/testing/transport/__init__.py +9 -9
  132. provide/foundation/testing/transport/fixtures.py +54 -54
  133. provide/foundation/time/__init__.py +18 -0
  134. provide/foundation/time/core.py +63 -0
  135. provide/foundation/tools/__init__.py +2 -2
  136. provide/foundation/tools/base.py +68 -67
  137. provide/foundation/tools/cache.py +69 -74
  138. provide/foundation/tools/downloader.py +68 -62
  139. provide/foundation/tools/installer.py +51 -57
  140. provide/foundation/tools/registry.py +38 -45
  141. provide/foundation/tools/resolver.py +70 -68
  142. provide/foundation/tools/verifier.py +39 -50
  143. provide/foundation/tracer/spans.py +2 -14
  144. provide/foundation/transport/__init__.py +26 -33
  145. provide/foundation/transport/base.py +32 -30
  146. provide/foundation/transport/client.py +44 -49
  147. provide/foundation/transport/config.py +36 -107
  148. provide/foundation/transport/errors.py +13 -27
  149. provide/foundation/transport/http.py +69 -55
  150. provide/foundation/transport/middleware.py +113 -114
  151. provide/foundation/transport/registry.py +29 -27
  152. provide/foundation/transport/types.py +6 -6
  153. provide/foundation/utils/deps.py +17 -14
  154. provide/foundation/utils/parsing.py +49 -4
  155. {provide_foundation-0.0.0.dev1.dist-info → provide_foundation-0.0.0.dev3.dist-info}/METADATA +2 -2
  156. provide_foundation-0.0.0.dev3.dist-info/RECORD +233 -0
  157. provide_foundation-0.0.0.dev1.dist-info/RECORD +0 -200
  158. /provide/foundation/{observability → integrations}/openobserve/exceptions.py +0 -0
  159. /provide/foundation/{observability → integrations}/openobserve/models.py +0 -0
  160. {provide_foundation-0.0.0.dev1.dist-info → provide_foundation-0.0.0.dev3.dist-info}/WHEEL +0 -0
  161. {provide_foundation-0.0.0.dev1.dist-info → provide_foundation-0.0.0.dev3.dist-info}/entry_points.txt +0 -0
  162. {provide_foundation-0.0.0.dev1.dist-info → provide_foundation-0.0.0.dev3.dist-info}/licenses/LICENSE +0 -0
  163. {provide_foundation-0.0.0.dev1.dist-info → provide_foundation-0.0.0.dev3.dist-info}/top_level.txt +0 -0
@@ -18,7 +18,7 @@ log = get_logger(__name__)
18
18
 
19
19
 
20
20
  if _HAS_CLICK:
21
- from provide.foundation.observability.openobserve import (
21
+ from provide.foundation.integrations.openobserve import (
22
22
  OpenObserveClient,
23
23
  format_output,
24
24
  search_logs,
@@ -27,7 +27,7 @@ if _HAS_CLICK:
27
27
 
28
28
  @click.group("openobserve", help="Query and manage OpenObserve logs")
29
29
  @click.pass_context
30
- def openobserve_group(ctx):
30
+ def openobserve_group(ctx: click.Context) -> None:
31
31
  """OpenObserve log querying and streaming commands."""
32
32
  # Initialize client and store in context
33
33
  try:
@@ -75,7 +75,7 @@ if _HAS_CLICK:
75
75
  help="Pretty print JSON output",
76
76
  )
77
77
  @click.pass_obj
78
- def query_command(client, sql, start, end, size, format, pretty):
78
+ def query_command(client: "OpenObserveClient | None", sql: str, start: str, end: str, size: int, format: str, pretty: bool) -> int | None:
79
79
  """Execute SQL query against OpenObserve logs."""
80
80
  if client is None:
81
81
  click.echo(
@@ -134,7 +134,7 @@ if _HAS_CLICK:
134
134
  help="Output format",
135
135
  )
136
136
  @click.pass_obj
137
- def tail_command(client, stream, filter_sql, lines, follow, format):
137
+ def tail_command(client: "OpenObserveClient | None", stream: str, filter_sql: str | None, lines: int, follow: bool, format: str) -> int | None:
138
138
  """Tail logs from OpenObserve (like 'tail -f')."""
139
139
  if client is None:
140
140
  click.echo(
@@ -191,14 +191,14 @@ if _HAS_CLICK:
191
191
  help="Output format",
192
192
  )
193
193
  @click.pass_obj
194
- def errors_command(client, stream, start, size, format):
194
+ def errors_command(client: "OpenObserveClient | None", stream: str, start: str, size: int, format: str) -> int | None:
195
195
  """Search for error logs."""
196
196
  if client is None:
197
197
  click.echo("OpenObserve not configured.", err=True)
198
198
  return 1
199
199
 
200
200
  try:
201
- from provide.foundation.observability.openobserve import search_errors
201
+ from provide.foundation.integrations.openobserve import search_errors
202
202
 
203
203
  response = search_errors(
204
204
  stream=stream,
@@ -233,14 +233,14 @@ if _HAS_CLICK:
233
233
  help="Output format",
234
234
  )
235
235
  @click.pass_obj
236
- def trace_command(client, trace_id, stream, format):
236
+ def trace_command(client: "OpenObserveClient | None", trace_id: str, stream: str, format: str) -> int | None:
237
237
  """Search for logs by trace ID."""
238
238
  if client is None:
239
239
  click.echo("OpenObserve not configured.", err=True)
240
240
  return 1
241
241
 
242
242
  try:
243
- from provide.foundation.observability.openobserve import search_by_trace_id
243
+ from provide.foundation.integrations.openobserve import search_by_trace_id
244
244
 
245
245
  response = search_by_trace_id(
246
246
  trace_id=trace_id,
@@ -260,7 +260,7 @@ if _HAS_CLICK:
260
260
 
261
261
  @openobserve_group.command("streams")
262
262
  @click.pass_obj
263
- def streams_command(client):
263
+ def streams_command(client: "OpenObserveClient | None") -> int | None:
264
264
  """List available streams."""
265
265
  if client is None:
266
266
  click.echo("OpenObserve not configured.", err=True)
@@ -297,7 +297,7 @@ if _HAS_CLICK:
297
297
  help="Filter by stream name",
298
298
  )
299
299
  @click.pass_obj
300
- def history_command(client, size, stream):
300
+ def history_command(client: "OpenObserveClient | None", size: int, stream: str | None) -> int | None:
301
301
  """View search history."""
302
302
  if client is None:
303
303
  click.echo("OpenObserve not configured.", err=True)
@@ -326,7 +326,7 @@ if _HAS_CLICK:
326
326
 
327
327
  @openobserve_group.command("test")
328
328
  @click.pass_obj
329
- def test_command(client):
329
+ def test_command(client: "OpenObserveClient | None") -> int | None:
330
330
  """Test connection to OpenObserve."""
331
331
  if client is None:
332
332
  click.echo("OpenObserve not configured.", err=True)
@@ -347,7 +347,7 @@ if _HAS_CLICK:
347
347
 
348
348
  else:
349
349
  # Stub when click is not available
350
- def openobserve_group(*args, **kwargs):
350
+ def openobserve_group(*args: object, **kwargs: object) -> None:
351
351
  """OpenObserve command stub when click is not available."""
352
352
  raise ImportError(
353
353
  "CLI commands require optional dependencies. "
@@ -0,0 +1,37 @@
1
+ """OpenObserve integration configuration."""
2
+
3
+ from attrs import define
4
+
5
+ from provide.foundation.config.base import field
6
+ from provide.foundation.config.env import RuntimeConfig
7
+
8
+
9
+ @define(slots=True, repr=False)
10
+ class OpenObserveConfig(RuntimeConfig):
11
+ """Configuration for OpenObserve integration."""
12
+
13
+ url: str | None = field(
14
+ default=None,
15
+ env_var="OPENOBSERVE_URL",
16
+ description="OpenObserve URL endpoint",
17
+ )
18
+ org: str | None = field(
19
+ default=None,
20
+ env_var="OPENOBSERVE_ORG",
21
+ description="OpenObserve organization",
22
+ )
23
+ user: str | None = field(
24
+ default=None,
25
+ env_var="OPENOBSERVE_USER",
26
+ description="OpenObserve username",
27
+ )
28
+ password: str | None = field(
29
+ default=None,
30
+ env_var="OPENOBSERVE_PASSWORD",
31
+ description="OpenObserve password",
32
+ )
33
+ stream: str | None = field(
34
+ default=None,
35
+ env_var="OPENOBSERVE_STREAM",
36
+ description="OpenObserve stream name",
37
+ )
@@ -8,7 +8,7 @@ import io
8
8
  import json
9
9
  from typing import Any
10
10
 
11
- from provide.foundation.observability.openobserve.models import SearchResponse
11
+ from provide.foundation.integrations.openobserve.models import SearchResponse
12
12
 
13
13
 
14
14
  def format_json(response: SearchResponse | dict[str, Any], pretty: bool = True) -> str:
@@ -6,8 +6,8 @@ from datetime import datetime
6
6
  import json
7
7
  from typing import Any
8
8
 
9
+ from provide.foundation.integrations.openobserve.client import OpenObserveClient
9
10
  from provide.foundation.logger import get_logger
10
- from provide.foundation.observability.openobserve.client import OpenObserveClient
11
11
 
12
12
  log = get_logger(__name__)
13
13
 
@@ -15,7 +15,7 @@ log = get_logger(__name__)
15
15
  try:
16
16
  from opentelemetry import trace
17
17
  from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter
18
- from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
18
+ from opentelemetry.sdk._logs import LoggerProvider
19
19
  from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
20
20
  from opentelemetry.sdk.resources import Resource
21
21
  from opentelemetry.semconv.resource import ResourceAttributes
@@ -2,10 +2,9 @@
2
2
  Search operations for OpenObserve.
3
3
  """
4
4
 
5
-
5
+ from provide.foundation.integrations.openobserve.client import OpenObserveClient
6
+ from provide.foundation.integrations.openobserve.models import SearchResponse
6
7
  from provide.foundation.logger import get_logger
7
- from provide.foundation.observability.openobserve.client import OpenObserveClient
8
- from provide.foundation.observability.openobserve.models import SearchResponse
9
8
 
10
9
  log = get_logger(__name__)
11
10
 
@@ -9,13 +9,13 @@ from typing import Any
9
9
 
10
10
  import requests
11
11
 
12
- from provide.foundation.logger import get_logger
13
- from provide.foundation.observability.openobserve.auth import get_auth_headers
14
- from provide.foundation.observability.openobserve.client import OpenObserveClient
15
- from provide.foundation.observability.openobserve.exceptions import (
12
+ from provide.foundation.integrations.openobserve.auth import get_auth_headers
13
+ from provide.foundation.integrations.openobserve.client import OpenObserveClient
14
+ from provide.foundation.integrations.openobserve.exceptions import (
16
15
  OpenObserveStreamingError,
17
16
  )
18
- from provide.foundation.observability.openobserve.models import parse_relative_time
17
+ from provide.foundation.integrations.openobserve.models import parse_relative_time
18
+ from provide.foundation.logger import get_logger
19
19
 
20
20
  log = get_logger(__name__)
21
21
 
@@ -8,7 +8,6 @@ Re-exports key components related to logging functionality.
8
8
 
9
9
  # Import trace module early to ensure PrintLogger gets patched
10
10
  from provide.foundation.logger import trace # noqa: F401
11
-
12
11
  from provide.foundation.logger.base import (
13
12
  FoundationLogger, # Class definition
14
13
  get_logger, # Factory function
@@ -9,7 +9,7 @@ import os
9
9
  import sys
10
10
 
11
11
 
12
- def get_config_logger():
12
+ def get_config_logger() -> object:
13
13
  """Get logger for config warnings that respects FOUNDATION_LOG_OUTPUT."""
14
14
  import structlog
15
15