Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
300 changes: 194 additions & 106 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ members = ["crates/*"]
resolver = "2"

[workspace.dependencies]
qcs-api-client-common = "0.12.5"
qcs-api-client-grpc = "0.12.5"
qcs-api-client-openapi = "0.13.5"
qcs-api-client-common = "0.12.8"
qcs-api-client-grpc = "0.12.8"
qcs-api-client-openapi = "0.13.8"
serde_json = "1.0.86"
thiserror = "1.0.57"
tokio = "1.36.0"
Expand Down
6 changes: 4 additions & 2 deletions crates/python/qcs_sdk/_tracing_subscriber/common/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@

from typing import Dict, Optional, final


@final
class InstrumentationLibrary:
"""
Information about a library or crate providing instrumentation.

An instrumentation library should be named to follow any naming conventions
of the instrumented library (e.g. 'middleware' for a web framework).

See the `instrumentation libraries <https://github.com/open-telemetry/opentelemetry-specification/blob/v1.9.0/specification/overview.md#instrumentation-libraries>`_
spec for more information.
"""
Expand All @@ -41,3 +42,4 @@ class InstrumentationLibrary:
:param attributes: The attributes of the instrumentation library.
"""
...

16 changes: 8 additions & 8 deletions crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
from __future__ import annotations
from typing import TYPE_CHECKING

from . import file as file
from . import file as file
from . import otel_otlp_file as otel_otlp_file
from . import otel_otlp as otel_otlp

if TYPE_CHECKING:
from typing import Union
from typing import Union

Config = Union[
file.Config,
otel_otlp_file.Config,
otel_otlp.Config,
]
"""
Config = Union[
file.Config,
otel_otlp_file.Config,
otel_otlp.Config,
]
"""
One of the supported layer configurations that may be set on the subscriber configuration.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ class Config:
:param json: Whether or not to format the output as JSON. Defaults to `True`.
"""
...

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class Resource:
schema_url: Optional[str] = None,
) -> "Resource": ...



@final
class Config:
"""
Expand Down Expand Up @@ -99,14 +101,14 @@ class Config:
...

if TYPE_CHECKING:
from typing import List, Union
from typing import List, Union

ResourceValueArray = Union[List[bool], List[int], List[float], List[str]]
"""
An array of `ResourceValue`s. This array is homogenous, so all values must be of the same type.
"""

ResourceValue = Union[bool, int, float, str, ResourceValueArray]
ResourceValue= Union[bool, int, float, str, ResourceValueArray]
"""
A value that can be added to a `Resource`.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,15 @@
from typing import Optional, final
from qcs_sdk._tracing_subscriber.common import InstrumentationLibrary


@final
class Config:
"""
A configuration for `opentelemetry-stdout <https://docs.rs/opentelemetry-stdout/latest/opentelemetry_stdout/>`_
layer.
"""

def __new__(
cls,
*,
file_path: Optional[str] = None,
filter: Optional[str] = None,
instrumentation_library: Optional[InstrumentationLibrary] = None,
) -> "Config":
def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None, instrumentation_library: Optional[InstrumentationLibrary] = None) -> "Config":
"""
:param file_path: The path to the file to write to. If not specified, defaults to stdout.
:param filter: A filter string to use for this layer. This uses the same format as the
Expand All @@ -40,3 +35,4 @@ class Config:
:param instrumentation_library: Information about the library providing the tracing instrumentation.
"""
...

Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ class Config:
"""

def __new__(cls, *, layer: layers.Config) -> "Config": ...

2 changes: 1 addition & 1 deletion crates/python/qcs_sdk/qpu/translation.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Riverlane:
are specially authorized and are not generally available to the client.
"""

def __new__(cls, /, ds2_configuration_data: Optional[Dict[str, bytes]] = ...) -> Self: ...
def __new__(cls, qeci_configuration_data: Dict[str, bytes] = ..., qeci_max_nanoseconds_until_read_available = int) -> Self: ...

@final
class TranslationOptions:
Expand Down
12 changes: 9 additions & 3 deletions crates/python/src/qpu/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,16 @@ pub struct PyRiverlane(Riverlane);
#[pymethods]
impl PyRiverlane {
#[new]
#[pyo3(signature = (/, ds2_configuration_data = None))]
fn __new__(ds2_configuration_data: Option<HashMap<String, Vec<u8>>>) -> PyResult<Self> {
#[pyo3(
signature = (qeci_configuration_data, qeci_max_nanoseconds_until_read_available, /)
)]
fn __new__(
qeci_configuration_data: HashMap<String, Vec<u8>>,
qeci_max_nanoseconds_until_read_available: u64,
) -> PyResult<Self> {
Ok(Self(Riverlane {
ds2_configuration_data: ds2_configuration_data.unwrap_or_default(),
qeci_configuration_data,
qeci_max_nanoseconds_until_read_available,
}))
}
}
Expand Down
Loading