uipath-core 0.1.6__tar.gz → 0.1.7__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 (59) hide show
  1. {uipath_core-0.1.6 → uipath_core-0.1.7}/.github/workflows/publish-dev.yml +16 -4
  2. {uipath_core-0.1.6 → uipath_core-0.1.7}/PKG-INFO +1 -1
  3. {uipath_core-0.1.6 → uipath_core-0.1.7}/pyproject.toml +1 -1
  4. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/tracing/decorators.py +14 -0
  5. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/tracing/test_traced.py +158 -0
  6. {uipath_core-0.1.6 → uipath_core-0.1.7}/uv.lock +1 -1
  7. {uipath_core-0.1.6 → uipath_core-0.1.7}/.cursorrules +0 -0
  8. {uipath_core-0.1.6 → uipath_core-0.1.7}/.editorconfig +0 -0
  9. {uipath_core-0.1.6 → uipath_core-0.1.7}/.gitattributes +0 -0
  10. {uipath_core-0.1.6 → uipath_core-0.1.7}/.github/workflows/cd.yml +0 -0
  11. {uipath_core-0.1.6 → uipath_core-0.1.7}/.github/workflows/ci.yml +0 -0
  12. {uipath_core-0.1.6 → uipath_core-0.1.7}/.github/workflows/commitlint.yml +0 -0
  13. {uipath_core-0.1.6 → uipath_core-0.1.7}/.github/workflows/lint.yml +0 -0
  14. {uipath_core-0.1.6 → uipath_core-0.1.7}/.github/workflows/test.yml +0 -0
  15. {uipath_core-0.1.6 → uipath_core-0.1.7}/.gitignore +0 -0
  16. {uipath_core-0.1.6 → uipath_core-0.1.7}/.pre-commit-config.yaml +0 -0
  17. {uipath_core-0.1.6 → uipath_core-0.1.7}/.python-version +0 -0
  18. {uipath_core-0.1.6 → uipath_core-0.1.7}/.vscode/extensions.json +0 -0
  19. {uipath_core-0.1.6 → uipath_core-0.1.7}/.vscode/launch.json +0 -0
  20. {uipath_core-0.1.6 → uipath_core-0.1.7}/.vscode/settings.json +0 -0
  21. {uipath_core-0.1.6 → uipath_core-0.1.7}/CONTRIBUTING.md +0 -0
  22. {uipath_core-0.1.6 → uipath_core-0.1.7}/LICENSE +0 -0
  23. {uipath_core-0.1.6 → uipath_core-0.1.7}/README.md +0 -0
  24. {uipath_core-0.1.6 → uipath_core-0.1.7}/justfile +0 -0
  25. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/__init__.py +0 -0
  26. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/__init__.py +0 -0
  27. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/async_stream.py +0 -0
  28. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/citation.py +0 -0
  29. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/content.py +0 -0
  30. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/conversation.py +0 -0
  31. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/error.py +0 -0
  32. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/event.py +0 -0
  33. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/exchange.py +0 -0
  34. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/interrupt.py +0 -0
  35. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/message.py +0 -0
  36. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/meta.py +0 -0
  37. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/chat/tool.py +0 -0
  38. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/errors/__init__.py +0 -0
  39. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/errors/errors.py +0 -0
  40. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/guardrails/__init__.py +0 -0
  41. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/guardrails/_deterministic_guardrails_service.py +0 -0
  42. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/guardrails/_evaluators.py +0 -0
  43. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/guardrails/guardrails.py +0 -0
  44. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/py.typed +0 -0
  45. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/tracing/__init__.py +0 -0
  46. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/tracing/_utils.py +0 -0
  47. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/tracing/exporters.py +0 -0
  48. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/tracing/processors.py +0 -0
  49. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/tracing/span_utils.py +0 -0
  50. {uipath_core-0.1.6 → uipath_core-0.1.7}/src/uipath/core/tracing/trace_manager.py +0 -0
  51. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/__init__.py +0 -0
  52. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/conftest.py +0 -0
  53. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/guardrails/test_deterministic_guardrails_service.py +0 -0
  54. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/tracing/test_external_integration.py +0 -0
  55. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/tracing/test_serialization.py +0 -0
  56. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/tracing/test_span_nesting.py +0 -0
  57. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/tracing/test_span_registry.py +0 -0
  58. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/tracing/test_trace_manager.py +0 -0
  59. {uipath_core-0.1.6 → uipath_core-0.1.7}/tests/tracing/test_tracing_utils.py +0 -0
@@ -60,9 +60,14 @@ jobs:
60
60
 
61
61
  Write-Output "Package version set to $DEV_VERSION"
62
62
 
63
+ $startMarker = "<!-- DEV_PACKAGE_START -->"
64
+ $endMarker = "<!-- DEV_PACKAGE_END -->"
65
+
63
66
  $dependencyMessage = @"
67
+ $startMarker
64
68
  ## Development Package
65
69
 
70
+ - Use ``uipath pack --nolock`` to get the latest dev build from this PR (requires version range).
66
71
  - Add this package as a dependency in your pyproject.toml:
67
72
 
68
73
  ``````toml
@@ -83,7 +88,13 @@ jobs:
83
88
 
84
89
  [tool.uv.sources]
85
90
  $PROJECT_NAME = { index = "testpypi" }
91
+
92
+ [tool.uv]
93
+ override-dependencies = [
94
+ "$PROJECT_NAME>=$MIN_VERSION,<$MAX_VERSION",
95
+ ]
86
96
  ``````
97
+ $endMarker
87
98
  "@
88
99
 
89
100
  # Get the owner and repo from the GitHub repository
@@ -101,10 +112,11 @@ jobs:
101
112
  $pr = Invoke-RestMethod -Uri $prUri -Method Get -Headers $headers
102
113
  $currentBody = $pr.body
103
114
 
104
- # Check if there's already a development package section
105
- if ($currentBody -match '## Development Package') {
106
- # Replace the existing section with the new dependency message
107
- $newBody = $currentBody -replace '## Development Package(\r?\n|.)*?(?=##|$)', $dependencyMessage
115
+ # Check if markers already exist in the PR description
116
+ $markerPattern = "(?s)$([regex]::Escape($startMarker)).*?$([regex]::Escape($endMarker))"
117
+ if ($currentBody -match $markerPattern) {
118
+ # Replace everything between markers (including markers)
119
+ $newBody = $currentBody -replace $markerPattern, $dependencyMessage
108
120
  } else {
109
121
  # Append the dependency message to the end of the description
110
122
  $newBody = if ($currentBody) { "$currentBody`n`n$dependencyMessage" } else { $dependencyMessage }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath-core
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: UiPath Core abstractions
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-core-python
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "uipath-core"
3
- version = "0.1.6"
3
+ version = "0.1.7"
4
4
  description = "UiPath Core abstractions"
5
5
  readme = { file = "README.md", content-type = "text/markdown" }
6
6
  requires-python = ">=3.11"
@@ -6,7 +6,9 @@ import random
6
6
  from functools import wraps
7
7
  from typing import Any, Callable, Optional
8
8
 
9
+ from opentelemetry import context as context_api
9
10
  from opentelemetry import trace
11
+ from opentelemetry.context import _SUPPRESS_INSTRUMENTATION_KEY
10
12
  from opentelemetry.trace import NonRecordingSpan, SpanContext, TraceFlags
11
13
  from opentelemetry.trace.status import StatusCode
12
14
 
@@ -78,6 +80,8 @@ def _opentelemetry_traced(
78
80
  # --------- Sync wrapper ---------
79
81
  @wraps(func)
80
82
  def sync_wrapper(*args: Any, **kwargs: Any) -> Any:
83
+ if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
84
+ return func(*args, **kwargs)
81
85
  span_cm, span = get_span()
82
86
  try:
83
87
  # Set input attributes BEFORE execution
@@ -113,6 +117,8 @@ def _opentelemetry_traced(
113
117
  # --------- Async wrapper ---------
114
118
  @wraps(func)
115
119
  async def async_wrapper(*args: Any, **kwargs: Any) -> Any:
120
+ if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
121
+ return await func(*args, **kwargs)
116
122
  span_cm, span = get_span()
117
123
  try:
118
124
  # Set input attributes BEFORE execution
@@ -148,6 +154,10 @@ def _opentelemetry_traced(
148
154
  # --------- Generator wrapper ---------
149
155
  @wraps(func)
150
156
  def generator_wrapper(*args: Any, **kwargs: Any) -> Any:
157
+ if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
158
+ for item in func(*args, **kwargs):
159
+ yield item
160
+ return
151
161
  span_cm, span = get_span()
152
162
  try:
153
163
  # Set input attributes BEFORE execution
@@ -186,6 +196,10 @@ def _opentelemetry_traced(
186
196
  # --------- Async generator wrapper ---------
187
197
  @wraps(func)
188
198
  async def async_generator_wrapper(*args: Any, **kwargs: Any) -> Any:
199
+ if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
200
+ async for item in func(*args, **kwargs):
201
+ yield item
202
+ return
189
203
  span_cm, span = get_span()
190
204
  try:
191
205
  # Set input attributes BEFORE execution
@@ -816,3 +816,161 @@ async def test_non_recording_traced_async_generator_function(setup_tracer):
816
816
  spans = exporter.get_exported_spans()
817
817
 
818
818
  assert len(spans) == 0
819
+
820
+
821
+ # --------- Suppress Instrumentation Tests ---------
822
+
823
+
824
+ def test_suppress_instrumentation_sync_function(setup_tracer):
825
+ """Test that suppress_instrumentation prevents spans from being created for sync functions."""
826
+ from opentelemetry.instrumentation.utils import suppress_instrumentation
827
+
828
+ exporter, provider = setup_tracer
829
+
830
+ @traced()
831
+ def sample_function(x, y):
832
+ return x + y
833
+
834
+ # Call without suppression - should create span
835
+ result = sample_function(2, 3)
836
+ assert result == 5
837
+
838
+ spans = exporter.get_exported_spans()
839
+ assert len(spans) == 1
840
+
841
+ exporter.clear_exported_spans()
842
+
843
+ # Call with suppression - should NOT create span
844
+ with suppress_instrumentation():
845
+ result = sample_function(4, 5)
846
+ assert result == 9
847
+
848
+ provider.shutdown()
849
+ spans = exporter.get_exported_spans()
850
+ assert len(spans) == 0
851
+
852
+
853
+ @pytest.mark.asyncio
854
+ async def test_suppress_instrumentation_async_function(setup_tracer):
855
+ """Test that suppress_instrumentation prevents spans from being created for async functions."""
856
+ from opentelemetry.instrumentation.utils import suppress_instrumentation
857
+
858
+ exporter, provider = setup_tracer
859
+
860
+ @traced()
861
+ async def sample_async_function(x, y):
862
+ return x * y
863
+
864
+ # Call without suppression - should create span
865
+ result = await sample_async_function(2, 3)
866
+ assert result == 6
867
+
868
+ await sleep(0.1)
869
+ spans = exporter.get_exported_spans()
870
+ assert len(spans) == 1
871
+
872
+ exporter.clear_exported_spans()
873
+
874
+ # Call with suppression - should NOT create span
875
+ with suppress_instrumentation():
876
+ result = await sample_async_function(4, 5)
877
+ assert result == 20
878
+
879
+ provider.shutdown()
880
+ await sleep(0.1)
881
+ spans = exporter.get_exported_spans()
882
+ assert len(spans) == 0
883
+
884
+
885
+ def test_suppress_instrumentation_generator_function(setup_tracer):
886
+ """Test that suppress_instrumentation prevents spans from being created for generator functions."""
887
+ from opentelemetry.instrumentation.utils import suppress_instrumentation
888
+
889
+ exporter, provider = setup_tracer
890
+
891
+ @traced()
892
+ def sample_generator_function(n):
893
+ for i in range(n):
894
+ yield i
895
+
896
+ # Call without suppression - should create span
897
+ results = list(sample_generator_function(3))
898
+ assert results == [0, 1, 2]
899
+
900
+ spans = exporter.get_exported_spans()
901
+ assert len(spans) == 1
902
+
903
+ exporter.clear_exported_spans()
904
+
905
+ # Call with suppression - should NOT create span
906
+ with suppress_instrumentation():
907
+ results = list(sample_generator_function(4))
908
+ assert results == [0, 1, 2, 3]
909
+
910
+ provider.shutdown()
911
+ spans = exporter.get_exported_spans()
912
+ assert len(spans) == 0
913
+
914
+
915
+ @pytest.mark.asyncio
916
+ async def test_suppress_instrumentation_async_generator_function(setup_tracer):
917
+ """Test that suppress_instrumentation prevents spans from being created for async generator functions."""
918
+ from opentelemetry.instrumentation.utils import suppress_instrumentation
919
+
920
+ exporter, provider = setup_tracer
921
+
922
+ @traced()
923
+ async def sample_async_generator_function(n):
924
+ for i in range(n):
925
+ yield i
926
+
927
+ # Call without suppression - should create span
928
+ results = [item async for item in sample_async_generator_function(3)]
929
+ assert results == [0, 1, 2]
930
+
931
+ spans = exporter.get_exported_spans()
932
+ assert len(spans) == 1
933
+
934
+ exporter.clear_exported_spans()
935
+
936
+ # Call with suppression - should NOT create span
937
+ with suppress_instrumentation():
938
+ results = [item async for item in sample_async_generator_function(4)]
939
+ assert results == [0, 1, 2, 3]
940
+
941
+ provider.shutdown()
942
+ spans = exporter.get_exported_spans()
943
+ assert len(spans) == 0
944
+
945
+
946
+ def test_suppress_instrumentation_nested_functions(setup_tracer):
947
+ """Test that suppress_instrumentation prevents spans for nested traced function calls."""
948
+ from opentelemetry.instrumentation.utils import suppress_instrumentation
949
+
950
+ exporter, provider = setup_tracer
951
+
952
+ @traced()
953
+ def inner_function(x):
954
+ return x * 2
955
+
956
+ @traced()
957
+ def outer_function(x):
958
+ return inner_function(x) + 1
959
+
960
+ # Call without suppression - should create 2 spans
961
+ result = outer_function(5)
962
+ assert result == 11
963
+
964
+ spans = exporter.get_exported_spans()
965
+ assert len(spans) == 2
966
+
967
+ exporter.clear_exported_spans()
968
+
969
+ # Call with suppression - should NOT create any spans
970
+ with suppress_instrumentation():
971
+ result = outer_function(10)
972
+ assert result == 21
973
+
974
+ provider.shutdown()
975
+ spans = exporter.get_exported_spans()
976
+ assert len(spans) == 0
@@ -991,7 +991,7 @@ wheels = [
991
991
 
992
992
  [[package]]
993
993
  name = "uipath-core"
994
- version = "0.1.6"
994
+ version = "0.1.7"
995
995
  source = { editable = "." }
996
996
  dependencies = [
997
997
  { name = "opentelemetry-instrumentation" },
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