Skip to content

Commit 11460bc

Browse files
authored
feat!: upgrade to http=1 (#502)
* upgrade QCS-API packages * purge old qcs-api package * upgrade pyo3-otel crates * update past yanked futures-util
1 parent 0c93dca commit 11460bc

File tree

18 files changed

+701
-576
lines changed

18 files changed

+701
-576
lines changed

Cargo.lock

+594-519
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.dependencies]
6-
qcs-api = "0.2.1"
7-
qcs-api-client-common = "0.10.1"
8-
qcs-api-client-grpc = "0.10.1"
9-
qcs-api-client-openapi = "0.11.1"
6+
qcs-api-client-common = "0.11.2"
7+
qcs-api-client-grpc = "0.11.2"
8+
qcs-api-client-openapi = "0.12.2"
109
serde_json = "1.0.86"
1110
thiserror = "1.0.57"
1211
tokio = "1.36.0"
@@ -25,11 +24,11 @@ quil-rs = { version = "0.28.1", git = "https://github.com/rigetti/quil-rs", tag
2524
# and need to be updated together.
2625
ndarray = { version = "0.15.6", features = ["serde"] }
2726
numpy = "0.20.0"
28-
pyo3 = { version = "0.20.0", features = ["extension-module"] }
27+
pyo3 = { version = "0.20.0", default-features = false}
2928
pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] }
3029
pyo3-log = { version = "0.8.2" }
31-
pyo3-opentelemetry = { version = "=0.3.2-dev.1" }
32-
pyo3-tracing-subscriber = { version = "=0.1.2-dev.1", default-features = true }
30+
pyo3-opentelemetry = { version = "0.3" }
31+
pyo3-tracing-subscriber = { version = "0.1.4", default-features = false }
3332

3433
pyo3-build-config = "0.20.0"
3534
rigetti-pyo3 = { version = "0.4.1", default-features = false, features = ["complex", "time"] }

crates/lib/Cargo.toml

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ ndarray.workspace = true
2828
num = { version = "0.4.0", features = ["serde"] }
2929
opentelemetry = { version = "0.23.0" }
3030
opentelemetry_sdk = { version = "0.23.0" }
31-
qcs-api.workspace = true
3231
qcs-api-client-common.workspace = true
3332
qcs-api-client-openapi.workspace = true
3433
qcs-api-client-grpc.workspace = true
3534
quil-rs.workspace = true
36-
reqwest = { version = "0.11.20", default-features = false, features = [
37-
"rustls-tls",
38-
"json",
39-
] }
35+
reqwest = { version = "0.12.8", default-features = false, features = ["rustls-tls", "json"] }
4036
rmp-serde = "1.1.1"
4137
serde = { version = "1.0.145", features = ["derive"] }
4238
serde_json.workspace = true
@@ -45,7 +41,7 @@ tokio = { workspace = true, features = ["fs", "rt-multi-thread"] }
4541
toml = "0.7.3"
4642
tracing = { version = "0.1", optional = true, features = ["log"] }
4743
uuid = { version = "1.2.1", features = ["v4"] }
48-
tonic = { version = "0.11.0", features = ["tls", "tls-roots"] }
44+
tonic = { version = "0.12.3", features = ["tls", "tls-roots"] }
4945
zmq = { version = "0.10.0" }
5046
itertools = "0.11.0"
5147
derive_builder = "0.12.0"

crates/python/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ crate-type = ["cdylib", "rlib"]
2020
[dependencies]
2121
async-trait = "0.1.73"
2222
qcs = { path = "../lib", features = ["tracing-opentelemetry"] }
23-
qcs-api.workspace = true
2423
qcs-api-client-common = { workspace = true, features = ["python"] }
2524
qcs-api-client-grpc.workspace = true
2625
qcs-api-client-openapi.workspace = true
27-
pyo3.workspace = true
26+
pyo3 = { workspace = true, features = ["extension-module", "multiple-pymethods"] }
2827
pyo3-asyncio.workspace = true
2928
pyo3-opentelemetry.workspace = true
30-
pyo3-tracing-subscriber = { workspace = true, features = ["layer-otel-otlp-file", "layer-otel-otlp"] }
29+
pyo3-tracing-subscriber = { workspace = true, features = ["pyo3", "layer-otel-otlp-file", "layer-otel-otlp"] }
3130
quil-rs.workspace = true
3231
serde_json.workspace = true
3332
tokio.workspace = true
@@ -40,11 +39,12 @@ once_cell = "1.18.0"
4039
opentelemetry = { version = "0.23.0" }
4140
opentelemetry_sdk = { version = "0.23.0" }
4241
tracing = { version = "0.1.37" }
43-
prost = "0.12.6"
42+
prost = "0.13.3"
4443

4544
[build-dependencies]
45+
pyo3 = { workspace = true, features = ["multiple-pymethods"] }
4646
pyo3-build-config.workspace = true
47-
pyo3-tracing-subscriber = { version = "=0.1.2-dev.1", features = ["layer-otel-otlp-file", "layer-otel-otlp", "stubs"], default-features = false }
47+
pyo3-tracing-subscriber = { workspace = true, features = ["layer-otel-otlp-file", "layer-otel-otlp", "stubs"] }
4848

4949
[lints.clippy]
5050
too_many_arguments = "allow"

crates/python/qcs_sdk/_tracing_subscriber/__init__.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ from __future__ import annotations
1515
from types import TracebackType
1616
from typing import TYPE_CHECKING, Optional, Type, final
1717

18+
from . import common as common
1819
from . import layers as layers
1920
from . import subscriber as subscriber
2021

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# *****************************************************************************
2+
# * AUTO-GENERATED CODE *
3+
# * *
4+
# * This code was generated by the `pyo3-tracing-subscriber` crate. Any *
5+
# * modifications to this file should be made to the script or the generation *
6+
# * process that produced this code. Specifically, see: *
7+
# * `pyo3_tracing_subscriber::stubs::write_stub_files` *
8+
# * *
9+
# * Do not manually edit this file, as your changes may be overwritten the *
10+
# * next time the code is generated. *
11+
# *****************************************************************************
12+
13+
from qcs_sdk._tracing_subscriber import common
14+
15+
16+
__doc__ = common.__doc__
17+
__all__ = getattr(common, "__all__", [])
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# *****************************************************************************
2+
# * AUTO-GENERATED CODE *
3+
# * *
4+
# * This code was generated by the `pyo3-tracing-subscriber` crate. Any *
5+
# * modifications to this file should be made to the script or the generation *
6+
# * process that produced this code. Specifically, see: *
7+
# * `pyo3_tracing_subscriber::stubs::write_stub_files` *
8+
# * *
9+
# * Do not manually edit this file, as your changes may be overwritten the *
10+
# * next time the code is generated. *
11+
# *****************************************************************************
12+
13+
from typing import Dict, Optional, final
14+
15+
16+
@final
17+
class InstrumentationLibrary:
18+
"""
19+
Information about a library or crate providing instrumentation.
20+
21+
An instrumentation library should be named to follow any naming conventions
22+
of the instrumented library (e.g. 'middleware' for a web framework).
23+
24+
See the `instrumentation libraries <https://github.com/open-telemetry/opentelemetry-specification/blob/v1.9.0/specification/overview.md#instrumentation-libraries>`_
25+
spec for more information.
26+
"""
27+
28+
def __new__(
29+
cls,
30+
name: str,
31+
version: Optional[str] = None,
32+
schema_url: Optional[str] = None,
33+
attributes: Optional[Dict[str, str]] = None,
34+
) -> "InstrumentationLibrary":
35+
"""
36+
Initializes a new instance of `InstrumentationLibrary`.
37+
38+
:param name: The name of the instrumentation library.
39+
:param version: The version of the instrumentation library.
40+
:param schema_url: The `schema URL <https://opentelemetry.io/docs/specs/otel/schemas/>`_ of
41+
the instrumentation library.
42+
:param attributes: The attributes of the instrumentation library.
43+
"""
44+
...
45+

crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = layers.__doc__
1717
__all__ = getattr(layers, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.pyi

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
from __future__ import annotations
1414
from typing import TYPE_CHECKING
1515

16-
from . import file as file
16+
from . import file as file
1717
from . import otel_otlp_file as otel_otlp_file
1818
from . import otel_otlp as otel_otlp
1919

2020
if TYPE_CHECKING:
21-
from typing import Union
21+
from typing import Union
2222

23-
Config = Union[
24-
file.Config,
25-
otel_otlp_file.Config,
26-
otel_otlp.Config,
27-
]
28-
"""
23+
Config = Union[
24+
file.Config,
25+
otel_otlp_file.Config,
26+
otel_otlp.Config,
27+
]
28+
"""
2929
One of the supported layer configurations that may be set on the subscriber configuration.
3030
"""

crates/python/qcs_sdk/_tracing_subscriber/layers/file/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515

1616
__doc__ = file.__doc__
1717
__all__ = getattr(file, "__all__", [])
18+
19+

crates/python/qcs_sdk/_tracing_subscriber/layers/file/__init__.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ class Config:
3939
:param json: Whether or not to format the output as JSON. Defaults to `True`.
4040
"""
4141
...
42+

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = otel_otlp.__doc__
1717
__all__ = getattr(otel_otlp, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from __future__ import annotations
1414
from typing import Dict, Optional, TYPE_CHECKING, final
15+
from qcs_sdk._tracing_subscriber.common import InstrumentationLibrary
1516

1617
@final
1718
class SpanLimits:
@@ -47,6 +48,8 @@ class Resource:
4748
schema_url: Optional[str] = None,
4849
) -> "Resource": ...
4950

51+
52+
5053
@final
5154
class Config:
5255
"""
@@ -68,6 +71,7 @@ class Config:
6871
timeout_millis: Optional[int] = None,
6972
pre_shutdown_timeout_millis: Optional[int] = 2000,
7073
filter: Optional[str] = None,
74+
instrumentation_library: Optional[InstrumentationLibrary] = None,
7175
) -> "Config":
7276
"""
7377
Initializes a new `Config`.
@@ -92,18 +96,19 @@ class Config:
9296
9397
If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable
9498
and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported.
99+
:param instrumentation_library: Information about the library providing the tracing instrumentation.
95100
"""
96101
...
97102

98103
if TYPE_CHECKING:
99-
from typing import List, Union
104+
from typing import List, Union
100105

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

106-
ResourceValue = Union[bool, int, float, str, ResourceValueArray]
111+
ResourceValue= Union[bool, int, float, str, ResourceValueArray]
107112
"""
108113
A value that can be added to a `Resource`.
109114
"""

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = otel_otlp_file.__doc__
1717
__all__ = getattr(otel_otlp_file, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# *****************************************************************************
1212

1313
from typing import Optional, final
14+
from qcs_sdk._tracing_subscriber.common import InstrumentationLibrary
15+
1416

1517
@final
1618
class Config:
@@ -19,7 +21,7 @@ class Config:
1921
layer.
2022
"""
2123

22-
def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None) -> "Config":
24+
def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None, instrumentation_library: Optional[InstrumentationLibrary] = None) -> "Config":
2325
"""
2426
:param file_path: The path to the file to write to. If not specified, defaults to stdout.
2527
:param filter: A filter string to use for this layer. This uses the same format as the
@@ -30,5 +32,7 @@ class Config:
3032
3133
If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable
3234
and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported.
35+
:param instrumentation_library: Information about the library providing the tracing instrumentation.
3336
"""
3437
...
38+

crates/python/qcs_sdk/_tracing_subscriber/subscriber/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
__doc__ = subscriber.__doc__
1717
__all__ = getattr(subscriber, "__all__", [])
18+

crates/python/qcs_sdk/_tracing_subscriber/subscriber/__init__.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ class Config:
2222
"""
2323

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

deny.toml

+2-28
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ feature-depth = 1
6464
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
6565
[advisories]
6666
ignore = [
67-
{ id = "RUSTSEC-2023-0052", reason = "Introduced by transitive dependency `webpki`. `hyper-proxy`, then `qcs-api-client-rust` need to update in order to remove" },
68-
# { id = "RUSTSEC-2024-0320", reason = "yaml-rust is an unmaintained crate introduced by dev-dependency insta" },
69-
{ id = "RUSTSEC-2024-0336", reason = "introduced by hyper, a transitive dependency of qcs-api-client-grpc" },
70-
{ id = "RUSTSEC-2023-0055", reason = "introduced by lexical, a transitive dependency of quil-rs" },
7167
{ id = "RUSTSEC-2021-0145", reason = "introduced by atty, a transitive dependency of multiple dependencies, with no upgrade path" },
68+
{ id = "RUSTSEC-2024-0375", reason = "introduced by atty, a transitive dependency of multiple dependencies, with no upgrade path" },
7269
{ id = "RUSTSEC-2024-0006", reason = "introduced by shlex, a transitive dependency of bindgen with no upgrade path" },
7370
{ id = "RUSTSEC-2021-0139", reason = "ansi_term is unmaintained, but used by clap" },
7471
]
72+
yanked = "deny"
7573
# If this is true, then cargo deny will use the git executable to fetch advisory database.
7674
# If this is false, then it uses a built-in git library.
7775
# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support.
@@ -174,29 +172,6 @@ deny = [
174172
#{ crate = "[email protected]", wrappers = ["this-crate-directly-depends-on-ansi_term"] },
175173
]
176174

177-
# List of features to allow/deny
178-
# Each entry the name of a crate and a version range. If version is
179-
# not specified, all versions will be matched.
180-
#[[bans.features]]
181-
#crate = "reqwest"
182-
# Features to not allow
183-
#deny = ["json"]
184-
# Features to allow
185-
#allow = [
186-
# "rustls",
187-
# "__rustls",
188-
# "__tls",
189-
# "hyper-rustls",
190-
# "rustls",
191-
# "rustls-pemfile",
192-
# "rustls-tls-webpki-roots",
193-
# "tokio-rustls",
194-
# "webpki-roots",
195-
#]
196-
# If true, the allowed features must exactly match the enabled feature set. If
197-
# this is set there is no point setting `deny`
198-
#exact = true
199-
200175
# Certain crates/versions that will be skipped when doing duplicate detection.
201176
skip = [
202177
@@ -212,7 +187,6 @@ skip-tree = [
212187
{ crate = "toml", depth = 20 },
213188
{ crate = "warp", depth = 20 }, # Only used for development
214189
{ crate = "hermit-abi", depth = 20 }, # Only used for development
215-
{ crate = "hyper-rustls", depth = 20 }, # `hyper-proxy` relies on an older version than `reqwest`
216190
{ crate = "itertools", depth = 20 }, # `quil-rs` and various transitive dependencies depend on different versions
217191
{ crate = "hashbrown", depth = 20 }, # `indexmap` and `cached` depend on different versions
218192
]

0 commit comments

Comments
 (0)