dreadnode 1.0.0rc2__tar.gz → 1.0.1__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 (27) hide show
  1. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/PKG-INFO +3 -2
  2. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/main.py +8 -1
  3. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/task.py +19 -0
  4. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/tracing/span.py +11 -2
  5. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/pyproject.toml +5 -5
  6. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/README.md +0 -0
  7. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/__init__.py +0 -0
  8. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/api/__init__.py +0 -0
  9. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/api/client.py +0 -0
  10. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/api/models.py +0 -0
  11. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/artifact/__init__.py +0 -0
  12. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/artifact/merger.py +0 -0
  13. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/artifact/storage.py +0 -0
  14. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/artifact/tree_builder.py +0 -0
  15. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/constants.py +0 -0
  16. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/integrations/__init__.py +0 -0
  17. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/integrations/transformers.py +0 -0
  18. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/metric.py +0 -0
  19. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/object.py +0 -0
  20. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/py.typed +0 -0
  21. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/serialization.py +0 -0
  22. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/tracing/__init__.py +0 -0
  23. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/tracing/constants.py +0 -0
  24. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/tracing/exporters.py +0 -0
  25. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/types.py +0 -0
  26. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/util.py +0 -0
  27. {dreadnode-1.0.0rc2 → dreadnode-1.0.1}/dreadnode/version.py +0 -0
@@ -1,14 +1,15 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dreadnode
3
- Version: 1.0.0rc2
3
+ Version: 1.0.1
4
4
  Summary: Dreadnode SDK
5
5
  Author: Nick Landers
6
6
  Author-email: monoxgas@gmail.com
7
- Requires-Python: >=3.10,<3.13
7
+ Requires-Python: >=3.10,<3.14
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.10
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
12
13
  Provides-Extra: training
13
14
  Requires-Dist: coolname (>=2.2.0,<3.0.0)
14
15
  Requires-Dist: fast-depends (>=2.4.12,<3.0.0)
@@ -48,6 +48,7 @@ from dreadnode.tracing.span import (
48
48
  )
49
49
  from dreadnode.types import (
50
50
  AnyDict,
51
+ JsonDict,
51
52
  JsonValue,
52
53
  )
53
54
  from dreadnode.util import handle_internal_errors
@@ -268,6 +269,7 @@ class Dreadnode:
268
269
  service_version=self.service_version,
269
270
  console=logfire.ConsoleOptions() if self.console is True else self.console,
270
271
  scrubbing=False,
272
+ inspect_arguments=False,
271
273
  )
272
274
  self._logfire.config.ignore_no_config = True
273
275
 
@@ -758,6 +760,7 @@ class Dreadnode:
758
760
  origin: t.Any | None = None,
759
761
  timestamp: datetime | None = None,
760
762
  mode: MetricAggMode | None = None,
763
+ attributes: JsonDict | None = None,
761
764
  to: ToObject = "task-or-run",
762
765
  ) -> None:
763
766
  """
@@ -787,6 +790,7 @@ class Dreadnode:
787
790
  - avg: the average of all reported values for this metric
788
791
  - sum: the cumulative sum of all reported values for this metric
789
792
  - count: increment every time this metric is logged - disregard value
793
+ attributes: A dictionary of additional attributes to attach to the metric.
790
794
  to: The target object to log the metric to. Can be "task-or-run" or "run".
791
795
  Defaults to "task-or-run". If "task-or-run", the metric will be logged
792
796
  to the current task or run, whichever is the nearest ancestor.
@@ -841,6 +845,7 @@ class Dreadnode:
841
845
  origin: t.Any | None = None,
842
846
  timestamp: datetime | None = None,
843
847
  mode: MetricAggMode | None = None,
848
+ attributes: JsonDict | None = None,
844
849
  to: ToObject = "task-or-run",
845
850
  ) -> None:
846
851
  task = current_task_span.get()
@@ -853,7 +858,9 @@ class Dreadnode:
853
858
  metric = (
854
859
  value
855
860
  if isinstance(value, Metric)
856
- else Metric(float(value), step, timestamp or datetime.now(timezone.utc))
861
+ else Metric(
862
+ float(value), step, timestamp or datetime.now(timezone.utc), attributes or {}
863
+ )
857
864
  )
858
865
  target.log_metric(key, metric, origin=origin, mode=mode)
859
866
 
@@ -128,6 +128,25 @@ class Task(t.Generic[P, R]):
128
128
  self.__name__ = getattr(self.func, "__name__", self.name)
129
129
  self.__doc__ = getattr(self.func, "__doc__", None)
130
130
 
131
+ def __get__(self, obj: t.Any, objtype: t.Any) -> "Task[P, R]":
132
+ if obj is None:
133
+ return self
134
+
135
+ bound_func = self.func.__get__(obj, objtype)
136
+
137
+ return Task(
138
+ tracer=self.tracer,
139
+ name=self.name,
140
+ label=self.label,
141
+ attributes=self.attributes,
142
+ func=bound_func,
143
+ scorers=[scorer.clone() for scorer in self.scorers],
144
+ tags=self.tags.copy(),
145
+ log_params=self.log_params,
146
+ log_inputs=self.log_inputs,
147
+ log_output=self.log_output,
148
+ )
149
+
131
150
  def _bind_args(self, *args: P.args, **kwargs: P.kwargs) -> dict[str, t.Any]:
132
151
  signature = inspect.signature(self.func)
133
152
  bound_args = signature.bind(*args, **kwargs)
@@ -301,6 +301,7 @@ class RunSpan(Span):
301
301
  ) -> None:
302
302
  self.set_attribute(SPAN_ATTRIBUTE_PARAMS, self._params)
303
303
  self.set_attribute(SPAN_ATTRIBUTE_INPUTS, self._inputs, schema=False)
304
+ self.set_attribute(SPAN_ATTRIBUTE_OUTPUTS, self._outputs, schema=False)
304
305
  self.set_attribute(SPAN_ATTRIBUTE_METRICS, self._metrics, schema=False)
305
306
  self.set_attribute(SPAN_ATTRIBUTE_OBJECTS, self._objects, schema=False)
306
307
  self.set_attribute(
@@ -527,6 +528,7 @@ class RunSpan(Span):
527
528
  origin: t.Any | None = None,
528
529
  timestamp: datetime | None = None,
529
530
  mode: MetricAggMode | None = None,
531
+ attributes: JsonDict | None = None,
530
532
  ) -> None: ...
531
533
 
532
534
  @t.overload
@@ -548,11 +550,14 @@ class RunSpan(Span):
548
550
  origin: t.Any | None = None,
549
551
  timestamp: datetime | None = None,
550
552
  mode: MetricAggMode | None = None,
553
+ attributes: JsonDict | None = None,
551
554
  ) -> None:
552
555
  metric = (
553
556
  value
554
557
  if isinstance(value, Metric)
555
- else Metric(float(value), step, timestamp or datetime.now(timezone.utc))
558
+ else Metric(
559
+ float(value), step, timestamp or datetime.now(timezone.utc), attributes or {}
560
+ )
556
561
  )
557
562
 
558
563
  if origin is not None:
@@ -740,6 +745,7 @@ class TaskSpan(Span, t.Generic[R]):
740
745
  origin: t.Any | None = None,
741
746
  timestamp: datetime | None = None,
742
747
  mode: MetricAggMode | None = None,
748
+ attributes: JsonDict | None = None,
743
749
  ) -> None: ...
744
750
 
745
751
  @t.overload
@@ -761,11 +767,14 @@ class TaskSpan(Span, t.Generic[R]):
761
767
  origin: t.Any | None = None,
762
768
  timestamp: datetime | None = None,
763
769
  mode: MetricAggMode | None = None,
770
+ attributes: JsonDict | None = None,
764
771
  ) -> None:
765
772
  metric = (
766
773
  value
767
774
  if isinstance(value, Metric)
768
- else Metric(float(value), step, timestamp or datetime.now(timezone.utc))
775
+ else Metric(
776
+ float(value), step, timestamp or datetime.now(timezone.utc), attributes or {}
777
+ )
769
778
  )
770
779
 
771
780
  if origin is not None:
@@ -1,19 +1,19 @@
1
1
  [project]
2
2
  name = "dreadnode"
3
- version = "1.0.0-rc.2"
3
+ version = "1.0.1"
4
4
  description = "Dreadnode SDK"
5
- requires-python = ">=3.10,<3.13"
5
+ requires-python = ">=3.10,<3.14"
6
6
 
7
7
  [tool.poetry]
8
8
  name = "dreadnode"
9
- version = "1.0.0-rc.2"
9
+ version = "1.0.1"
10
10
  description = "Dreadnode SDK"
11
11
  authors = ["Nick Landers <monoxgas@gmail.com>"]
12
12
  repository = "https://github.com/dreadnode/sdk"
13
13
  readme = "README.md"
14
14
 
15
15
  [tool.poetry.dependencies]
16
- python = ">=3.10,<3.13"
16
+ python = ">=3.10,<3.14"
17
17
  pydantic = "^2.9.2"
18
18
  httpx = "^0.28.0"
19
19
  logfire = "^3.5.3"
@@ -31,7 +31,7 @@ training = ["transformers"]
31
31
  [tool.poetry.group.dev.dependencies]
32
32
  mypy = "^1.8.0"
33
33
  ruff = "^0.11.6"
34
- pre-commit = "^3.8.0"
34
+ pre-commit = "^4.0.0"
35
35
  pytest = "^8.3.3"
36
36
  pytest-asyncio = "^0.24.0"
37
37
  types-protobuf = "^5.29.1.20250208"
File without changes