[package]
name = "qcs-api-client-common"
version = "0.12.9"
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/rigetti/qcs-api-client-rust"
homepage = "https://github.com/rigetti/qcs-api-client-rust"
categories = ["api-bindings", "authentication"]
keywords = ["qcs", "quantum", "rigetti", "api"]
description = "Common code for QCS API clients"
publish = ["crates-io"]

[package.metadata.docs.rs]
features = ["python", "tracing"]

[lib]
# The name of the native library. This is the name which will be used in Python to import the
# library. If you change this, you must also change the name of the
# `#[pymodule]` in `src/lib.rs`.
name = "qcs_api_client_common"
crate-type = ["cdylib", "rlib"]

[features]
tracing = ["dep:tracing", "urlpattern"]
tracing-config = ["tracing"]
python = [
    "dep:pyo3",
    "dep:pyo3-asyncio",
    "dep:paste",
    "dep:rigetti-pyo3",
    "tokio/macros",
    "pyo3-build-config",
]

[dependencies]
async-tempfile = { version = "0.7.0", features = ["uuid"] }
async-trait = "0.1"
backoff = { workspace = true }
derive_builder = "0.20.0"
figment = { version = "0.10.18", features = ["env", "toml"] }
futures = "0.3.26"
home = "0.5.5"
http = { workspace = true }
http-body-util = { workspace = true }
hyper = { workspace = true, features = ["server"] }
hyper-util = { workspace = true }
jsonwebtoken = { workspace = true }
oauth2 = { version = "5.0", default-features = false, features = ["reqwest", "native-tls"] }
paste = { version = "1.0.15", optional = true }
pyo3 = { version = "0.20.3", features = ["multiple-pymethods"], optional = true }
pyo3-asyncio = { version = "0.20.0", features = ["tokio-runtime"], optional = true }
reqwest = { workspace = true, default-features = false, features = ["socks", "rustls-tls-native-roots"] }
rigetti-pyo3 = { version = "0.3.6", optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
shellexpand = { version = "3.1.0", default-features = false, features = ["base-0"] }
thiserror = { workspace = true }
time = { version = "0.3.34", features = ["macros", "parsing", "serde"] }
tokio = { workspace = true, features = ["rt-multi-thread", "sync", "fs", "signal"] }
tokio-util = { workspace = true }
toml = { version = "0.9.8", features = ["preserve_order"] }
toml_edit = "0.23.7"
tracing = { workspace = true, optional = true }
url = { workspace = true }
urlpattern = { workspace = true, optional = true }
webbrowser = "0.8.15"

[build-dependencies]
pyo3-build-config = { version = "0.22.1", optional = true }

[dev-dependencies]
figment = { version = "0.10.18", features = ["env", "toml", "test"] }
httpmock = "0.8.0-alpha.1"
# This library is young and has a few strange bugs and misspellings - pin to a specific version for now so we don't get broken or hacked by updates.
oauth2-test-server = "=0.1.2"
rstest = { workspace = true }
serial_test = "3.1.1"
tokio = { workspace = true, features = ["fs", "macros"] }

[lints.clippy]
# Covers correctness, suspicious, style, complexity, and perf
all = "deny"
# negative 'priority' makes overriding specific lints easier
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -2 }
module_name_repetitions = "allow"    # This lint just seems silly
redundant_pub_crate = "allow"        # Has false positives that conflict with unreachable_pub
unsafe_derive_deserialize = "allow"  # Deriving `Deserialize` on a `pyclass` triggers this lint, but is not an issue.

[lints.rust]
# Extra non-clippy lints
absolute_paths_not_starting_with_crate = "warn"
anonymous_parameters = "warn"
bad_style = "warn"
dead_code = "warn"
keyword_idents = "warn"
improper_ctypes = "warn"
macro_use_extern_crate = "warn"
meta_variable_misuse = "warn"
missing_abi = "warn"
missing_debug_implementations = "warn"
missing_docs = "warn"
no_mangle_generic_items = "warn"
non_shorthand_field_patterns = "warn"
noop_method_call = "warn"
overflowing_literals = "warn"
path_statements = "warn"
patterns_in_fns_without_body = "warn"
semicolon_in_expressions_from_macros = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unconditional_recursion = "warn"
unreachable_pub = "warn"
unsafe_code = "warn"
unused = "warn"
unused_allocation = "warn"
unused_comparisons = "warn"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_parens = "warn"
unused_qualifications = "warn"
while_true = "warn"
