mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2025-08-06 20:06:57 +02:00
fix: make pyo3 usage optional per the feature flag (#1731)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
and cleanup feature flag usage (only specifying defaults in syncserver's Cargo.toml) Closes STOR-295
This commit is contained in:
parent
f8715d4e91
commit
2fb6b84ad4
@ -47,7 +47,7 @@ syncserver-settings = { path = "../syncserver-settings" }
|
||||
syncstorage-db = { path = "../syncstorage-db" }
|
||||
syncstorage-settings = { path = "../syncstorage-settings" }
|
||||
time = "^0.3"
|
||||
tokenserver-auth = { path = "../tokenserver-auth", default-features = false }
|
||||
tokenserver-auth = { path = "../tokenserver-auth" }
|
||||
tokenserver-common = { path = "../tokenserver-common" }
|
||||
tokenserver-db = { path = "../tokenserver-db" }
|
||||
tokenserver-settings = { path = "../tokenserver-settings" }
|
||||
@ -60,7 +60,7 @@ woothee = "0.13"
|
||||
[features]
|
||||
default = ["mysql", "py_verifier"]
|
||||
no_auth = []
|
||||
py_verifier = ["tokenserver-auth/py"]
|
||||
py_verifier = ["tokenserver-auth/py", "tokenserver-common/py"]
|
||||
mysql = ["syncstorage-db/mysql"]
|
||||
spanner = ["syncstorage-db/spanner"]
|
||||
actix-compress = ["actix-web/compress-brotli", "actix-web/compress-gzip", "actix-web/compress-zstd"]
|
||||
|
@ -36,5 +36,4 @@ mockito = "1.4.0"
|
||||
tokio = { workspace = true, features = ["macros"] }
|
||||
|
||||
[features]
|
||||
default = ["py"]
|
||||
py = ["pyo3"]
|
||||
py = ["pyo3", "tokenserver-common/py"]
|
||||
|
@ -15,5 +15,4 @@ pyo3 = { version = "0.24", features = ["auto-initialize"], optional = true }
|
||||
syncserver-common = { path = "../syncserver-common" }
|
||||
|
||||
[features]
|
||||
default = ["py"]
|
||||
py = ["pyo3"]
|
||||
py = ["pyo3"]
|
||||
|
@ -3,7 +3,6 @@ use std::{cmp::PartialEq, error::Error, fmt};
|
||||
use actix_web::{HttpResponse, ResponseError};
|
||||
use backtrace::Backtrace;
|
||||
use http::StatusCode;
|
||||
use pyo3::prelude::PyErr;
|
||||
use serde::{
|
||||
ser::{SerializeMap, Serializer},
|
||||
Serialize,
|
||||
@ -326,8 +325,9 @@ impl InternalError for TokenserverError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PyErr> for TokenserverError {
|
||||
fn from(err: PyErr) -> Self {
|
||||
#[cfg(feature = "py")]
|
||||
impl From<pyo3::prelude::PyErr> for TokenserverError {
|
||||
fn from(err: pyo3::prelude::PyErr) -> Self {
|
||||
InternalError::internal_error(err.to_string())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user