Skip to content

Commit

Permalink
Merge pull request #303 from umccr/build/deps-update
Browse files Browse the repository at this point in the history
build: deps update
  • Loading branch information
mmalenic authored Feb 18, 2025
2 parents a0a78cd + 3718257 commit cb75923
Show file tree
Hide file tree
Showing 14 changed files with 468 additions and 574 deletions.
912 changes: 427 additions & 485 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions htsget-actix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ rustls = "0.23"
actix-cors = "0.7"
http_1 = { package = "http", version = "1" }
http = "0.2"
rustls-pemfile = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
futures-util = { version = "0.3" }
futures = { version = "0.3" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

tracing-actix-web = "0.7"
Expand All @@ -41,10 +38,11 @@ tracing = "0.1"
htsget-http = { version = "0.5.2", path = "../htsget-http", default-features = false }
htsget-search = { version = "0.10.0", path = "../htsget-search", default-features = false }
htsget-config = { version = "0.13.0", path = "../htsget-config", default-features = false }
htsget-test = { version = "0.7.2", path = "../htsget-test", features = ["http"], default-features = false }
htsget-axum = { version = "0.3.0", path = "../htsget-axum", default-features = false }

[dev-dependencies]
htsget-test = { path = "../htsget-test", features = ["http"], default-features = false }

async-trait = "0.1"

criterion = { version = "0.5", features = ["async_tokio"] }
Expand Down
12 changes: 5 additions & 7 deletions htsget-axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,25 @@ rustls = "0.23"
hyper-util = "0.1"
tower-http = { version = "0.6", features = ["trace", "cors", "fs"] }
http = "1"
axum = { version = "0.7", features = ["http2"] }
axum-extra = { version = "0.9", features = ["erased-json"] }
axum = { version = "0.8", features = ["http2"] }
axum-extra = { version = "0.10", features = ["erased-json"] }
tower = { version = "0.5", features = ["make", "util"] }

# Async
tokio-rustls = "0.26"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
futures = { version = "0.3" }
async-trait = "0.1"

# Tracing and error
thiserror = "1"
thiserror = "2"
tracing = "0.1"

htsget-config = { version = "0.13.0", path = "../htsget-config", default-features = false }
htsget-test = { version = "0.7.2", path = "../htsget-test", features = ["http"], default-features = false }
htsget-search = { version = "0.10.0", path = "../htsget-search", default-features = false }
htsget-http = { version = "0.5.2", path = "../htsget-http", default-features = false }

[dev-dependencies]
tempfile = "3"
data-url = "0.3"
htsget-test = { path = "../htsget-test", features = ["http"], default-features = false }

tempfile = "3"
reqwest = { version = "0.12", default-features = false, features = ["json", "blocking", "rustls-tls"] }
2 changes: 1 addition & 1 deletion htsget-axum/src/server/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl DataServer {
/// Create the router for the data server.
pub fn router<P: AsRef<Path>>(cors: CorsConfig, path: P) -> Router {
Router::new()
.nest_service("/", ServeDir::new(path))
.fallback_service(ServeDir::new(path))
.layer(configure_cors(cors))
.layer(TraceLayer::new_for_http())
}
Expand Down
11 changes: 9 additions & 2 deletions htsget-axum/src/server/ticket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use htsget_config::config::service_info::ServiceInfo;
use htsget_config::config::ticket_server::TicketServerConfig;
use htsget_config::config::Config;
use htsget_search::HtsGet;
use http::{StatusCode, Uri};
use std::net::SocketAddr;
use tokio::task::JoinHandle;
use tower::ServiceBuilder;
Expand Down Expand Up @@ -69,12 +70,13 @@ where
"/reads/service-info",
get(reads_service_info::<H>).post(reads_service_info::<H>),
)
.route("/reads/*id", get(get::reads).post(post::reads))
.route("/reads/{*id}", get(get::reads).post(post::reads))
.route(
"/variants/service-info",
get(variants_service_info::<H>).post(variants_service_info::<H>),
)
.route("/variants/*id", get(get::variants).post(post::variants))
.route("/variants/{*id}", get(get::variants).post(post::variants))
.fallback(Self::fallback)
.layer(
ServiceBuilder::new()
.layer(TraceLayer::new_for_http())
Expand All @@ -87,6 +89,11 @@ where
pub fn local_addr(&self) -> Result<SocketAddr> {
self.server.local_addr()
}

/// A handler for when a route is not found.
async fn fallback(uri: Uri) -> (StatusCode, String) {
(StatusCode::NOT_FOUND, format!("No route for {uri}"))
}
}

/// Spawn a task to run the ticket server.
Expand Down
5 changes: 2 additions & 3 deletions htsget-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ experimental = ["dep:crypt4gh", "dep:tokio", "dep:futures-util"]
default = []

[dependencies]
thiserror = "1"
thiserror = "2"
async-trait = "0.1"
noodles = { version = "0.83", features = ["core"] }
noodles = { version = "0.87", features = ["core"] }
serde = { version = "1", features = ["derive"] }
serde_with = "3"
serde_json = "1"
serde_regex = "1"
regex = "1"
Expand Down
6 changes: 4 additions & 2 deletions htsget-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ experimental = ["htsget-config/experimental", "htsget-search/experimental", "hts
default = []

[dependencies]
thiserror = "1"
thiserror = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
http = "1"
htsget-search = { version = "0.10.0", path = "../htsget-search", default-features = false }
htsget-config = { version = "0.13.0", path = "../htsget-config", default-features = false }
htsget-test = { version = "0.7.2", path = "../htsget-test", default-features = false }
futures = { version = "0.3" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tracing = "0.1"
cfg-if = "1"

[dev-dependencies]
htsget-test = { path = "../htsget-test", default-features = false }
25 changes: 4 additions & 21 deletions htsget-lambda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,21 @@ homepage = "https://github.com/umccr/htsget-rs/blob/main/htsget-lambda/README.md
repository = "https://github.com/umccr/htsget-rs"

[features]
aws = ["htsget-axum/aws", "htsget-config/aws", "htsget-search/aws", "htsget-http/aws", "htsget-test/aws"]
url = ["htsget-axum/url", "htsget-config/url", "htsget-search/url", "htsget-http/url", "htsget-test/url"]
aws = ["htsget-axum/aws", "htsget-config/aws", "htsget-http/aws"]
url = ["htsget-axum/url", "htsget-config/url", "htsget-http/url"]
experimental = [
"htsget-axum/experimental",
"htsget-config/experimental",
"htsget-search/experimental",
"htsget-http/experimental",
"htsget-test/experimental"
"htsget-http/experimental"
]
default = []

[dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tower-http = { version = "0.6", features = ["cors"] }
rustls = "0.23"
lambda_http = { version = "0.13" }
lambda_runtime = { version = "0.13" }
serde = { version = "1" }
serde_json = "1"
mime = "0.3"
regex = "1"
lambda_http = { version = "0.14" }
tracing = "0.1"
tracing-subscriber = "0.3"
bytes = "1"

htsget-config = { version = "0.13.0", path = "../htsget-config", default-features = false }
htsget-search = { version = "0.10.0", path = "../htsget-search", default-features = false }
htsget-http = { version = "0.5.2", path = "../htsget-http", default-features = false }
htsget-test = { version = "0.7.2", path = "../htsget-test", features = ["http"], default-features = false }
htsget-axum = { version = "0.3.0", path = "../htsget-axum", default-features = false }

[dev-dependencies]
async-trait = "0.1"
query_map = { version = "0.7", features = ["url-query"] }
tempfile = "3"
7 changes: 3 additions & 4 deletions htsget-search/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,20 @@ futures-util = "0.3"
async-trait = "0.1"

# Noodles
noodles = { version = "0.83", features = ["async", "core", "bgzf", "bam", "bcf", "cram", "csi", "sam", "tabix", "vcf"] }
noodles = { version = "0.87", features = ["async", "core", "bgzf", "bam", "bcf", "cram", "csi", "sam", "tabix", "vcf"] }

# Error control, tracing, config
thiserror = "1"
http = "1"
tracing = "0.1"

htsget-config = { version = "0.13.0", path = "../htsget-config", default-features = false }
htsget-storage = { version = "0.3.0", path = "../htsget-storage", default-features = false }
htsget-test = { version = "0.7.2", path = "../htsget-test", features = ["http"], default-features = false }

[dev-dependencies]
tempfile = "3"
http = "1"

criterion = { version = "0.5", features = ["async_tokio"] }
htsget-test = { path = "../htsget-test", features = ["http"], default-features = false }

[[bench]]
name = "search-benchmarks"
Expand Down
12 changes: 2 additions & 10 deletions htsget-search/src/cram_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use htsget_config::types::Interval;

use crate::search::{Search, SearchAll, SearchReads};
use crate::Class::Body;
use crate::{ConcurrencyError, ParsedHeader};
use crate::ConcurrencyError;
use crate::{Format, HtsGetError, Query, Result};
use htsget_storage::types::{BytesPosition, DataBlock};
use htsget_storage::{Storage, Streamable};
Expand Down Expand Up @@ -137,15 +137,7 @@ impl Search<PhantomData<Self>, Index, AsyncReader, Header> for CramSearch {
}

async fn read_header(reader: &mut AsyncReader) -> io::Result<Header> {
reader.read_file_definition().await?;

Ok(
reader
.read_file_header()
.await?
.parse::<ParsedHeader<Header>>()?
.into_inner(),
)
reader.read_header().await
}

async fn read_index_inner<T: AsyncRead + Send + Unpin>(inner: T) -> io::Result<Index> {
Expand Down
27 changes: 0 additions & 27 deletions htsget-search/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ pub use htsget_storage::Storage;

pub use htsget_storage::local::FileStorage;

use std::fmt::Display;
use std::str::FromStr;

use async_trait::async_trait;
use tokio::task::JoinError;

Expand Down Expand Up @@ -43,30 +40,6 @@ pub trait HtsGet {
}
}

/// A struct to represent a parsed header
pub struct ParsedHeader<T>(T);

impl<T> ParsedHeader<T> {
/// Get the inner header value.
pub fn into_inner(self) -> T {
self.0
}
}

impl<T> FromStr for ParsedHeader<T>
where
T: FromStr,
<T as FromStr>::Err: Display,
{
type Err = HtsGetError;

fn from_str(header: &str) -> Result<Self> {
Ok(ParsedHeader(header.parse::<T>().map_err(|err| {
HtsGetError::parse_error(format!("parsing header: {}", err))
})?))
}
}

pub(crate) struct ConcurrencyError(JoinError);

impl ConcurrencyError {
Expand Down
10 changes: 4 additions & 6 deletions htsget-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ http = "1"
cfg-if = "1"

# Async
tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "fs"] }
tokio-util = { version = "0.7", features = ["io", "compat"] }
futures = { version = "0.3" }
futures-util = "0.3"
Expand All @@ -54,20 +54,18 @@ crypt4gh = { version = "0.4", git = "https://github.com/EGA-archive/crypt4gh-rus
bincode = { version = "1", optional = true }

# Error control, tracing, config
thiserror = "1"
thiserror = "2"
tracing = "0.1"
base64 = "0.22"

htsget-config = { version = "0.13.0", path = "../htsget-config", default-features = false }
htsget-test = { version = "0.7.2", path = "../htsget-test", features = ["http"], default-features = false }

[dev-dependencies]
tower-http = { version = "0.6", features = ["fs"] }
axum = "0.7"
axum = "0.8"
tempfile = "3"
data-url = "0.3"

# Axum server
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }

criterion = { version = "0.5", features = ["async_tokio"] }
htsget-test = { path = "../htsget-test", features = ["http"], default-features = false }
4 changes: 2 additions & 2 deletions htsget-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ default = []
# Server tests dependencies
htsget-config = { version = "0.13.0", path = "../htsget-config", default-features = false, optional = true }

noodles = { version = "0.83", optional = true, features = ["async", "bgzf", "vcf", "cram", "bcf", "bam", "fasta"] }
noodles = { version = "0.87", optional = true, features = ["async", "bgzf", "vcf", "cram", "bcf", "bam", "fasta"] }

reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"], optional = true }
tokio = { version = "1", features = ["rt-multi-thread", "fs"], optional = true }
Expand All @@ -67,4 +67,4 @@ crypt4gh = { version = "0.4", git = "https://github.com/EGA-archive/crypt4gh-rus

# Default dependencies
rcgen = "0.13"
thiserror = "1"
thiserror = "2"
3 changes: 3 additions & 0 deletions release-plz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[package]]
name = "htsget-test"
release = false

0 comments on commit cb75923

Please sign in to comment.