Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyo3 #504

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
1,159 changes: 649 additions & 510 deletions Cargo.lock

Large diffs are not rendered by default.

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

[workspace.dependencies]
qcs-api = "0.2.1"
qcs-api-client-common = "0.10.1"
qcs-api-client-grpc = "0.10.1"
qcs-api-client-openapi = "0.11.1"
qcs-api-client-common = "0.11.1"
qcs-api-client-grpc = "0.11.1"
qcs-api-client-openapi = "0.12.1"
serde_json = "1.0.86"
thiserror = "1.0.57"
tokio = "1.36.0"
Expand All @@ -25,11 +24,11 @@ quil-rs = { version = "0.28.1", git = "https://github.com/rigetti/quil-rs", tag
# and need to be updated together.
ndarray = { version = "0.15.6", features = ["serde"] }
numpy = "0.20.0"
pyo3 = { version = "0.20.0", features = ["extension-module"] }
pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] }
pyo3 = { version = "0.21.0", features = ["extension-module"] }
pyo3-asyncio-0-21 = { version = "0.21", features = ["tokio-runtime"] }
pyo3-log = { version = "0.8.2" }
pyo3-opentelemetry = { version = "=0.3.2-dev.1" }
pyo3-tracing-subscriber = { version = "=0.1.2-dev.1", default-features = true }
pyo3-opentelemetry = { version = "0.3.4" }
pyo3-tracing-subscriber = { version = "0.1.4", default-features = true }

pyo3-build-config = "0.20.0"
rigetti-pyo3 = { version = "0.4.1", default-features = false, features = ["complex", "time"] }
Expand All @@ -42,3 +41,7 @@ rigetti-pyo3 = { version = "0.4.1", default-features = false, features = ["compl
strip = true
lto = true
codegen-units = 1

[patch.crates-io]
# XXX TEMP
rigetti-pyo3 = { git = "https://github.com/rigetti/rigetti-pyo3", branch = "update-pyo3" }
8 changes: 2 additions & 6 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ ndarray.workspace = true
num = { version = "0.4.0", features = ["serde"] }
opentelemetry = { version = "0.23.0" }
opentelemetry_sdk = { version = "0.23.0" }
qcs-api.workspace = true
qcs-api-client-common.workspace = true
qcs-api-client-openapi.workspace = true
qcs-api-client-grpc.workspace = true
quil-rs.workspace = true
reqwest = { version = "0.11.20", default-features = false, features = [
"rustls-tls",
"json",
] }
reqwest = { version = "0.12.8", default-features = false, features = ["rustls-tls", "json"] }
rmp-serde = "1.1.1"
serde = { version = "1.0.145", features = ["derive"] }
serde_json.workspace = true
Expand All @@ -45,7 +41,7 @@ tokio = { workspace = true, features = ["fs", "rt-multi-thread"] }
toml = "0.7.3"
tracing = { version = "0.1", optional = true, features = ["log"] }
uuid = { version = "1.2.1", features = ["v4"] }
tonic = { version = "0.11.0", features = ["tls", "tls-roots"] }
tonic = { version = "0.12.3", features = ["tls", "tls-roots"] }
zmq = { version = "0.10.0" }
itertools = "0.11.0"
derive_builder = "0.12.0"
Expand Down
7 changes: 3 additions & 4 deletions crates/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
async-trait = "0.1.73"
qcs = { path = "../lib", features = ["tracing-opentelemetry"] }
qcs-api.workspace = true
qcs-api-client-common = { workspace = true, features = ["python"] }
qcs-api-client-grpc.workspace = true
qcs-api-client-openapi.workspace = true
pyo3.workspace = true
pyo3-asyncio.workspace = true
pyo3-asyncio-0-21.workspace = true
pyo3-opentelemetry.workspace = true
pyo3-tracing-subscriber = { workspace = true, features = ["layer-otel-otlp-file", "layer-otel-otlp"] }
quil-rs.workspace = true
Expand All @@ -40,11 +39,11 @@ once_cell = "1.18.0"
opentelemetry = { version = "0.23.0" }
opentelemetry_sdk = { version = "0.23.0" }
tracing = { version = "0.1.37" }
prost = "0.12.6"
prost = "0.13.3"

[build-dependencies]
pyo3-build-config.workspace = true
pyo3-tracing-subscriber = { version = "=0.1.2-dev.1", features = ["layer-otel-otlp-file", "layer-otel-otlp", "stubs"], default-features = false }
pyo3-tracing-subscriber = { workspace = true, features = ["layer-otel-otlp-file", "layer-otel-otlp", "stubs"], default-features = false }

[lints.clippy]
too_many_arguments = "allow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@

__doc__ = layers.__doc__
__all__ = getattr(layers, "__all__", [])

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 @@ -15,3 +15,5 @@

__doc__ = file.__doc__
__all__ = getattr(file, "__all__", [])


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 @@ -15,3 +15,4 @@

__doc__ = otel_otlp.__doc__
__all__ = getattr(otel_otlp, "__all__", [])

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



@final
class Config:
"""
Expand Down Expand Up @@ -96,14 +98,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 @@ -15,3 +15,4 @@

__doc__ = otel_otlp_file.__doc__
__all__ = getattr(otel_otlp_file, "__all__", [])

Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ class Config:
and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported.
"""
...

Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@

__doc__ = subscriber.__doc__
__all__ = getattr(subscriber, "__all__", [])

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": ...

29 changes: 1 addition & 28 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,8 @@ feature-depth = 1
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
[advisories]
ignore = [
{ id = "RUSTSEC-2023-0052", reason = "Introduced by transitive dependency `webpki`. `hyper-proxy`, then `qcs-api-client-rust` need to update in order to remove" },
# { id = "RUSTSEC-2024-0320", reason = "yaml-rust is an unmaintained crate introduced by dev-dependency insta" },
{ id = "RUSTSEC-2024-0336", reason = "introduced by hyper, a transitive dependency of qcs-api-client-grpc" },
{ id = "RUSTSEC-2023-0055", reason = "introduced by lexical, a transitive dependency of quil-rs" },
{ id = "RUSTSEC-2021-0145", reason = "introduced by atty, a transitive dependency of multiple dependencies, with no upgrade path" },
{ id = "RUSTSEC-2024-0375", reason = "introduced by atty, a transitive dependency of multiple dependencies, with no upgrade path" },
{ id = "RUSTSEC-2024-0006", reason = "introduced by shlex, a transitive dependency of bindgen with no upgrade path" },
{ id = "RUSTSEC-2021-0139", reason = "ansi_term is unmaintained, but used by clap" },
]
Expand Down Expand Up @@ -174,29 +171,6 @@ deny = [
#{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] },
]

# List of features to allow/deny
# Each entry the name of a crate and a version range. If version is
# not specified, all versions will be matched.
#[[bans.features]]
#crate = "reqwest"
# Features to not allow
#deny = ["json"]
# Features to allow
#allow = [
# "rustls",
# "__rustls",
# "__tls",
# "hyper-rustls",
# "rustls",
# "rustls-pemfile",
# "rustls-tls-webpki-roots",
# "tokio-rustls",
# "webpki-roots",
#]
# If true, the allowed features must exactly match the enabled feature set. If
# this is set there is no point setting `deny`
#exact = true

# Certain crates/versions that will be skipped when doing duplicate detection.
skip = [
#"ansi_term@0.11.0",
Expand All @@ -212,7 +186,6 @@ skip-tree = [
{ crate = "toml", depth = 20 },
{ crate = "warp", depth = 20 }, # Only used for development
{ crate = "hermit-abi", depth = 20 }, # Only used for development
{ crate = "hyper-rustls", depth = 20 }, # `hyper-proxy` relies on an older version than `reqwest`
{ crate = "itertools", depth = 20 }, # `quil-rs` and various transitive dependencies depend on different versions
{ crate = "hashbrown", depth = 20 }, # `indexmap` and `cached` depend on different versions
]
Expand Down
Loading