diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a2c1f9fd..2c335f2c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -182,3 +182,26 @@ jobs: -p axum-extra -p axum-macros --target armv5te-unknown-linux-musleabi + + dependecies-are-sorted: + runs-on: ubuntu-latest + strategy: + matrix: + pwd: + - . + - examples + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + toolchain: beta + override: true + profile: minimal + - uses: Swatinem/rust-cache@v1 + - name: Install cargo-sort + run: | + cargo install cargo-sort + - name: Check dependecy tables + working-directory: ${{ matrix.pwd }} + run: | + cargo sort --workspace --grouped --check diff --git a/axum-core/Cargo.toml b/axum-core/Cargo.toml index fe504661..0f7cb823 100644 --- a/axum-core/Cargo.toml +++ b/axum-core/Cargo.toml @@ -19,7 +19,7 @@ http-body = "0.4.5" mime = "0.3.16" [dev-dependencies] -futures-util = "0.3" axum = { path = "../axum", version = "0.5" } +futures-util = "0.3" hyper = "0.14" tokio = { version = "1.0", features = ["macros"] } diff --git a/axum/Cargo.toml b/axum/Cargo.toml index 6368b5be..c685bf3e 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -24,8 +24,8 @@ tower-log = ["tower/log"] ws = ["tokio-tungstenite", "sha-1", "base64"] [dependencies] -axum-core = { path = "../axum-core", version = "0.2.5" } async-trait = "0.1.43" +axum-core = { path = "../axum-core", version = "0.2.5" } bitflags = "1.0" bytes = "1.0" futures-util = { version = "0.3", default-features = false, features = ["alloc"] } @@ -47,16 +47,19 @@ tower-layer = "0.3" tower-service = "0.3" # optional dependencies -base64 = { optional = true, version = "0.13" } -headers = { optional = true, version = "0.3" } -multer = { optional = true, version = "2.0.0" } -serde_json = { version = "1.0", optional = true, features = ["raw_value"] } +base64 = { version = "0.13", optional = true } +headers = { version = "0.3", optional = true } +multer = { version = "2.0.0", optional = true } +serde_json = { features = ["raw_value"], optional = true } serde_urlencoded = { version = "0.7", optional = true } -sha-1 = { optional = true, version = "0.10" } -tokio-tungstenite = { optional = true, version = "0.17" } +sha-1 = { version = "0.10", optional = true } +tokio-tungstenite = { version = "0.17", optional = true } [dev-dependencies] +anyhow = "1.0" futures = "0.3" +quickcheck = "1.0" +quickcheck_macros = "1.0" reqwest = { version = "0.11", default-features = false, features = ["json", "stream", "multipart"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -64,9 +67,10 @@ tokio = { version = "1.6.1", features = ["macros", "rt", "rt-multi-thread", "net tokio-stream = "0.1" tracing = "0.1" uuid = { version = "1.0", features = ["serde", "v4"] } -anyhow = "1.0" -quickcheck = "1.0" -quickcheck_macros = "1.0" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [dev-dependencies.tower] package = "tower" @@ -84,10 +88,6 @@ features = [ version = "0.3.4" features = ["full"] -[package.metadata.docs.rs] -all-features = true -rustdoc-args = ["--cfg", "docsrs"] - [package.metadata.playground] features = [ "http1", diff --git a/examples/async-graphql/Cargo.toml b/examples/async-graphql/Cargo.toml index 96c22469..2501791f 100644 --- a/examples/async-graphql/Cargo.toml +++ b/examples/async-graphql/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" publish = false [dependencies] -axum = { path = "../../axum" } -tokio = { version = "1.0", features = ["full"] } async-graphql = "3.0" +axum = { path = "../../axum" } slab = "0.4.3" +tokio = { version = "1.0", features = ["full"] } diff --git a/examples/customize-extractor-error/Cargo.toml b/examples/customize-extractor-error/Cargo.toml index 897a797e..2c7dd1a1 100644 --- a/examples/customize-extractor-error/Cargo.toml +++ b/examples/customize-extractor-error/Cargo.toml @@ -6,8 +6,8 @@ publish = false [dependencies] axum = { path = "../../axum" } -tokio = { version = "1.0", features = ["full"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" +tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/customize-path-rejection/Cargo.toml b/examples/customize-path-rejection/Cargo.toml index 12539bf8..3373dc65 100644 --- a/examples/customize-path-rejection/Cargo.toml +++ b/examples/customize-path-rejection/Cargo.toml @@ -6,8 +6,8 @@ publish = false [dependencies] axum = { path = "../../axum" } -tokio = { version = "1.0", features = ["full"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" +tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/error-handling-and-dependency-injection/Cargo.toml b/examples/error-handling-and-dependency-injection/Cargo.toml index 84fb69f9..5d7b1ca9 100644 --- a/examples/error-handling-and-dependency-injection/Cargo.toml +++ b/examples/error-handling-and-dependency-injection/Cargo.toml @@ -6,10 +6,10 @@ publish = false [dependencies] axum = { path = "../../axum" } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" tokio = { version = "1.0", features = ["full"] } tower = { version = "0.4", features = ["util"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" uuid = { version = "1.0", features = ["v4", "serde"] } diff --git a/examples/form/Cargo.toml b/examples/form/Cargo.toml index 12b25c12..fc65f6df 100644 --- a/examples/form/Cargo.toml +++ b/examples/form/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] axum = { path = "../../axum" } +serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -serde = { version = "1.0", features = ["derive"] } diff --git a/examples/http-proxy/Cargo.toml b/examples/http-proxy/Cargo.toml index 9cd73466..69f89bba 100644 --- a/examples/http-proxy/Cargo.toml +++ b/examples/http-proxy/Cargo.toml @@ -6,8 +6,8 @@ publish = false [dependencies] axum = { path = "../../axum" } -tokio = { version = "1.0", features = ["full"] } hyper = { version = "0.14", features = ["full"] } +tokio = { version = "1.0", features = ["full"] } tower = { version = "0.4", features = ["make"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/jwt/Cargo.toml b/examples/jwt/Cargo.toml index 2cc783ef..7078a651 100644 --- a/examples/jwt/Cargo.toml +++ b/examples/jwt/Cargo.toml @@ -6,11 +6,11 @@ publish = false [dependencies] axum = { path = "../../axum", features = ["headers"] } -tokio = { version = "1.0", features = ["full"] } -tracing = "0.1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" headers = "0.3" jsonwebtoken = "8.0" once_cell = "1.8" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +tokio = { version = "1.0", features = ["full"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/key-value-store/Cargo.toml b/examples/key-value-store/Cargo.toml index b2ea5bf5..954862cf 100644 --- a/examples/key-value-store/Cargo.toml +++ b/examples/key-value-store/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] axum = { path = "../../axum" } tokio = { version = "1.0", features = ["full"] } -tracing = "0.1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } tower = { version = "0.4", features = ["util", "timeout", "load-shed", "limit"] } tower-http = { version = "0.3.0", features = ["add-extension", "auth", "compression-full", "trace"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/multipart-form/Cargo.toml b/examples/multipart-form/Cargo.toml index cf7d77b1..7860c4dd 100644 --- a/examples/multipart-form/Cargo.toml +++ b/examples/multipart-form/Cargo.toml @@ -7,6 +7,6 @@ publish = false [dependencies] axum = { path = "../../axum", features = ["multipart"] } tokio = { version = "1.0", features = ["full"] } +tower-http = { version = "0.3.0", features = ["trace"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tower-http = { version = "0.3.0", features = ["trace"] } diff --git a/examples/oauth/Cargo.toml b/examples/oauth/Cargo.toml index edcb87b0..c6921de7 100644 --- a/examples/oauth/Cargo.toml +++ b/examples/oauth/Cargo.toml @@ -5,14 +5,14 @@ edition = "2018" publish = false [dependencies] +async-session = "3.0.0" axum = { path = "../../axum", features = ["headers"] } +headers = "0.3" +http = "0.2" +oauth2 = "4.1" +# Use Rustls because it makes it easier to cross-compile on CI +reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] } +serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -oauth2 = "4.1" -async-session = "3.0.0" -serde = { version = "1.0", features = ["derive"] } -# Use Rustls because it makes it easier to cross-compile on CI -reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] } -headers = "0.3" -http = "0.2" diff --git a/examples/print-request-response/Cargo.toml b/examples/print-request-response/Cargo.toml index 3458ba3a..1786e223 100644 --- a/examples/print-request-response/Cargo.toml +++ b/examples/print-request-response/Cargo.toml @@ -6,8 +6,8 @@ publish = false [dependencies] axum = { path = "../../axum" } +hyper = { version = "0.14", features = ["full"] } tokio = { version = "1.0", features = ["full"] } +tower = { version = "0.4", features = ["util", "filter"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tower = { version = "0.4", features = ["util", "filter"] } -hyper = { version = "0.14", features = ["full"] } diff --git a/examples/query-params-with-empty-strings/Cargo.toml b/examples/query-params-with-empty-strings/Cargo.toml index 5b360a29..36a25938 100644 --- a/examples/query-params-with-empty-strings/Cargo.toml +++ b/examples/query-params-with-empty-strings/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] axum = { path = "../../axum" } -tokio = { version = "1.0", features = ["full"] } -serde = { version = "1.0", features = ["derive"] } -tower = { version = "0.4", features = ["util"] } hyper = "0.14" +serde = { version = "1.0", features = ["derive"] } +tokio = { version = "1.0", features = ["full"] } +tower = { version = "0.4", features = ["util"] } diff --git a/examples/rest-grpc-multiplex/Cargo.toml b/examples/rest-grpc-multiplex/Cargo.toml index 3cbcc570..4b4bbfe0 100644 --- a/examples/rest-grpc-multiplex/Cargo.toml +++ b/examples/rest-grpc-multiplex/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] axum = { path = "../../axum" } futures = "0.3" -hyper = { version = "0.14", features = ["full"] } +hyper = { version = "0.14", features = ["full"] } prost = "0.10" tokio = { version = "1", features = ["full"] } tonic = { version = "0.7" } diff --git a/examples/sessions/Cargo.toml b/examples/sessions/Cargo.toml index b7831db3..0129ce41 100644 --- a/examples/sessions/Cargo.toml +++ b/examples/sessions/Cargo.toml @@ -5,10 +5,10 @@ edition = "2018" publish = false [dependencies] +async-session = "3.0.0" axum = { path = "../../axum", features = ["headers"] } +serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -serde = { version = "1.0", features = ["derive"] } uuid = { version = "1.0", features = ["v4", "serde"] } -async-session = "3.0.0" diff --git a/examples/sqlx-postgres/Cargo.toml b/examples/sqlx-postgres/Cargo.toml index 13b7ee43..5a1a19f4 100644 --- a/examples/sqlx-postgres/Cargo.toml +++ b/examples/sqlx-postgres/Cargo.toml @@ -10,5 +10,4 @@ tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } - sqlx = { version = "0.5.10", features = ["runtime-tokio-rustls", "any", "postgres"] } diff --git a/examples/sse/Cargo.toml b/examples/sse/Cargo.toml index f119d63a..8e52f362 100644 --- a/examples/sse/Cargo.toml +++ b/examples/sse/Cargo.toml @@ -6,10 +6,10 @@ publish = false [dependencies] axum = { path = "../../axum", features = ["headers"] } +futures = "0.3" +headers = "0.3" tokio = { version = "1.0", features = ["full"] } +tokio-stream = "0.1" +tower-http = { version = "0.3.0", features = ["fs", "trace"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tower-http = { version = "0.3.0", features = ["fs", "trace"] } -futures = "0.3" -tokio-stream = "0.1" -headers = "0.3" diff --git a/examples/static-file-server/Cargo.toml b/examples/static-file-server/Cargo.toml index 9cadd4d3..af4a6830 100644 --- a/examples/static-file-server/Cargo.toml +++ b/examples/static-file-server/Cargo.toml @@ -8,6 +8,6 @@ publish = false axum = { path = "../../axum" } axum-extra = { path = "../../axum-extra", features = ["spa"] } tokio = { version = "1.0", features = ["full"] } +tower-http = { version = "0.3.0", features = ["fs", "trace"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tower-http = { version = "0.3.0", features = ["fs", "trace"] } diff --git a/examples/templates/Cargo.toml b/examples/templates/Cargo.toml index 2a38fcec..99bc73a3 100644 --- a/examples/templates/Cargo.toml +++ b/examples/templates/Cargo.toml @@ -5,8 +5,8 @@ edition = "2018" publish = false [dependencies] +askama = "0.11" axum = { path = "../../axum" } tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -askama = "0.11" diff --git a/examples/testing/Cargo.toml b/examples/testing/Cargo.toml index e70223b5..8fddfef8 100644 --- a/examples/testing/Cargo.toml +++ b/examples/testing/Cargo.toml @@ -6,13 +6,13 @@ publish = false [dependencies] axum = { path = "../../axum" } +hyper = { version = "0.14", features = ["full"] } mime = "0.3" +serde_json = "1.0" tokio = { version = "1.0", features = ["full"] } +tower-http = { version = "0.3.0", features = ["trace"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tower-http = { version = "0.3.0", features = ["trace"] } -serde_json = "1.0" -hyper = { version = "0.14", features = ["full"] } [dev-dependencies] tower = { version = "0.4", features = ["util"] } diff --git a/examples/todos/Cargo.toml b/examples/todos/Cargo.toml index c1ba73cb..0bfcb8c4 100644 --- a/examples/todos/Cargo.toml +++ b/examples/todos/Cargo.toml @@ -6,10 +6,10 @@ publish = false [dependencies] axum = { path = "../../axum" } +serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.0", features = ["full"] } -tracing = "0.1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } tower = { version = "0.4", features = ["util", "timeout"] } tower-http = { version = "0.3.0", features = ["add-extension", "trace"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } uuid = { version = "1.0", features = ["serde", "v4"] } -serde = { version = "1.0", features = ["derive"] } diff --git a/examples/tokio-postgres/Cargo.toml b/examples/tokio-postgres/Cargo.toml index 79378437..20a4cbee 100644 --- a/examples/tokio-postgres/Cargo.toml +++ b/examples/tokio-postgres/Cargo.toml @@ -6,9 +6,9 @@ publish = false [dependencies] axum = { path = "../../axum" } -tokio = { version = "1.0", features = ["full"] } -tracing = "0.1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } bb8 = "0.7.1" bb8-postgres = "0.7.0" +tokio = { version = "1.0", features = ["full"] } tokio-postgres = "0.7.2" +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/tracing-aka-logging/Cargo.toml b/examples/tracing-aka-logging/Cargo.toml index a64f798b..92ce0857 100644 --- a/examples/tracing-aka-logging/Cargo.toml +++ b/examples/tracing-aka-logging/Cargo.toml @@ -7,6 +7,6 @@ publish = false [dependencies] axum = { path = "../../axum" } tokio = { version = "1.0", features = ["full"] } +tower-http = { version = "0.3.0", features = ["trace"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tower-http = { version = "0.3.0", features = ["trace"] } diff --git a/examples/unix-domain-socket/Cargo.toml b/examples/unix-domain-socket/Cargo.toml index c01d0fbe..d283adc7 100644 --- a/examples/unix-domain-socket/Cargo.toml +++ b/examples/unix-domain-socket/Cargo.toml @@ -6,9 +6,9 @@ publish = false [dependencies] axum = { path = "../../axum" } +futures = "0.3" +hyper = { version = "0.14", features = ["full"] } tokio = { version = "1.0", features = ["full"] } +tower = { version = "0.4", features = ["util"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -hyper = { version = "0.14", features = ["full"] } -tower = { version = "0.4", features = ["util"] } -futures = "0.3" diff --git a/examples/websockets/Cargo.toml b/examples/websockets/Cargo.toml index 67935f3c..6a435ac2 100644 --- a/examples/websockets/Cargo.toml +++ b/examples/websockets/Cargo.toml @@ -6,8 +6,8 @@ publish = false [dependencies] axum = { path = "../../axum", features = ["ws", "headers"] } +headers = "0.3" tokio = { version = "1.0", features = ["full"] } +tower-http = { version = "0.3.0", features = ["fs", "trace"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tower-http = { version = "0.3.0", features = ["fs", "trace"] } -headers = "0.3"