mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
.
This commit is contained in:
parent
9717fb58af
commit
77055f0c9d
143 changed files with 584 additions and 178 deletions
107
Cargo.lock
generated
107
Cargo.lock
generated
|
@ -88,6 +88,13 @@ dependencies = [
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anyhow"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow 1.0.98",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.98"
|
version = "1.0.98"
|
||||||
|
@ -509,7 +516,7 @@ version = "0.2.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "527f6e2a4e80492e90628052be879a5996c2453ad5ec745bfa310a80b7eca20a"
|
checksum = "527f6e2a4e80492e90628052be879a5996c2453ad5ec745bfa310a80b7eca20a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 1.0.98",
|
||||||
"core-foundation",
|
"core-foundation",
|
||||||
"filetime",
|
"filetime",
|
||||||
"hex",
|
"hex",
|
||||||
|
@ -3113,7 +3120,7 @@ version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "57f17d28a6e6acfe1733fe24bcd30774d13bffa4b8a22535b4c8c98423088d4e"
|
checksum = "57f17d28a6e6acfe1733fe24bcd30774d13bffa4b8a22535b4c8c98423088d4e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 1.0.98",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"http",
|
"http",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
@ -3128,7 +3135,7 @@ version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "29c73e4195a6bfbcb174b790d9b3407ab90646976c55de58a6515da25d851178"
|
checksum = "29c73e4195a6bfbcb174b790d9b3407ab90646976c55de58a6515da25d851178"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 1.0.98",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"futures",
|
"futures",
|
||||||
"getrandom 0.2.15",
|
"getrandom 0.2.15",
|
||||||
|
@ -4297,7 +4304,7 @@ version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "382e025ef8e0db646343dd2cf56af9d7fe6f5eabce5f388f8e5ec7234f555a0f"
|
checksum = "382e025ef8e0db646343dd2cf56af9d7fe6f5eabce5f388f8e5ec7234f555a0f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 1.0.98",
|
||||||
"fs-err 2.11.0",
|
"fs-err 2.11.0",
|
||||||
"itertools 0.13.0",
|
"itertools 0.13.0",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
@ -4384,6 +4391,22 @@ dependencies = [
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "traversable-derive"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "traversable-error"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow 0.1.0",
|
||||||
|
"traversable-derive",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "try-lock"
|
name = "try-lock"
|
||||||
version = "0.2.5"
|
version = "0.2.5"
|
||||||
|
@ -4575,7 +4598,7 @@ name = "uv"
|
||||||
version = "0.7.2"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
"assert_fs",
|
"assert_fs",
|
||||||
"axoupdater",
|
"axoupdater",
|
||||||
|
@ -4621,6 +4644,7 @@ dependencies = [
|
||||||
"tracing-durations-export",
|
"tracing-durations-export",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"tracing-tree",
|
"tracing-tree",
|
||||||
|
"traversable-error",
|
||||||
"unicode-width 0.2.0",
|
"unicode-width 0.2.0",
|
||||||
"url",
|
"url",
|
||||||
"uv-auth",
|
"uv-auth",
|
||||||
|
@ -4678,7 +4702,7 @@ dependencies = [
|
||||||
name = "uv-auth"
|
name = "uv-auth"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"futures",
|
"futures",
|
||||||
|
@ -4708,7 +4732,7 @@ dependencies = [
|
||||||
name = "uv-bench"
|
name = "uv-bench"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"codspeed-criterion-compat",
|
"codspeed-criterion-compat",
|
||||||
"criterion",
|
"criterion",
|
||||||
"jiff",
|
"jiff",
|
||||||
|
@ -4736,7 +4760,7 @@ dependencies = [
|
||||||
name = "uv-build"
|
name = "uv-build"
|
||||||
version = "0.7.2"
|
version = "0.7.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"uv-build-backend",
|
"uv-build-backend",
|
||||||
"uv-version",
|
"uv-version",
|
||||||
]
|
]
|
||||||
|
@ -4761,6 +4785,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-distribution-filename",
|
"uv-distribution-filename",
|
||||||
"uv-fs",
|
"uv-fs",
|
||||||
"uv-globfilter",
|
"uv-globfilter",
|
||||||
|
@ -4797,6 +4822,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"toml_edit",
|
"toml_edit",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-configuration",
|
"uv-configuration",
|
||||||
"uv-distribution",
|
"uv-distribution",
|
||||||
"uv-distribution-types",
|
"uv-distribution-types",
|
||||||
|
@ -4849,6 +4875,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -4868,7 +4895,7 @@ name = "uv-cli"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"clap",
|
"clap",
|
||||||
"clap_complete_command",
|
"clap_complete_command",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
|
@ -4895,7 +4922,7 @@ dependencies = [
|
||||||
name = "uv-client"
|
name = "uv-client"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"async_http_range_reader",
|
"async_http_range_reader",
|
||||||
"async_zip",
|
"async_zip",
|
||||||
|
@ -4925,6 +4952,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-auth",
|
"uv-auth",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
|
@ -4950,7 +4978,7 @@ dependencies = [
|
||||||
name = "uv-configuration"
|
name = "uv-configuration"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"clap",
|
"clap",
|
||||||
"either",
|
"either",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
|
@ -4963,6 +4991,7 @@ dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-auth",
|
"uv-auth",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
|
@ -4989,7 +5018,7 @@ name = "uv-dev"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"clap",
|
"clap",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
"itertools 0.14.0",
|
"itertools 0.14.0",
|
||||||
|
@ -5043,13 +5072,14 @@ dependencies = [
|
||||||
name = "uv-dispatch"
|
name = "uv-dispatch"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"futures",
|
"futures",
|
||||||
"itertools 0.14.0",
|
"itertools 0.14.0",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-build-backend",
|
"uv-build-backend",
|
||||||
"uv-build-frontend",
|
"uv-build-frontend",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
|
@ -5074,7 +5104,7 @@ dependencies = [
|
||||||
name = "uv-distribution"
|
name = "uv-distribution"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"either",
|
"either",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
"futures",
|
"futures",
|
||||||
|
@ -5093,6 +5123,7 @@ dependencies = [
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
"uv-cache-info",
|
"uv-cache-info",
|
||||||
|
@ -5127,6 +5158,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache-key",
|
"uv-cache-key",
|
||||||
"uv-normalize",
|
"uv-normalize",
|
||||||
|
@ -5156,6 +5188,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-auth",
|
"uv-auth",
|
||||||
"uv-cache-info",
|
"uv-cache-info",
|
||||||
|
@ -5191,6 +5224,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-configuration",
|
"uv-configuration",
|
||||||
"uv-distribution-filename",
|
"uv-distribution-filename",
|
||||||
"uv-pypi-types",
|
"uv-pypi-types",
|
||||||
|
@ -5225,7 +5259,8 @@ dependencies = [
|
||||||
name = "uv-git"
|
name = "uv-git"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
|
"anyhow 1.0.98",
|
||||||
"cargo-util",
|
"cargo-util",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
|
@ -5234,6 +5269,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-auth",
|
"uv-auth",
|
||||||
"uv-cache-key",
|
"uv-cache-key",
|
||||||
|
@ -5251,6 +5287,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5268,6 +5305,7 @@ dependencies = [
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5275,7 +5313,7 @@ dependencies = [
|
||||||
name = "uv-install-wheel"
|
name = "uv-install-wheel"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"assert_fs",
|
"assert_fs",
|
||||||
"clap",
|
"clap",
|
||||||
"configparser",
|
"configparser",
|
||||||
|
@ -5297,6 +5335,7 @@ dependencies = [
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-cache-info",
|
"uv-cache-info",
|
||||||
"uv-distribution-filename",
|
"uv-distribution-filename",
|
||||||
"uv-fs",
|
"uv-fs",
|
||||||
|
@ -5313,7 +5352,7 @@ dependencies = [
|
||||||
name = "uv-installer"
|
name = "uv-installer"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
"futures",
|
"futures",
|
||||||
|
@ -5324,6 +5363,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
"uv-cache-info",
|
"uv-cache-info",
|
||||||
|
@ -5367,6 +5407,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-distribution-filename",
|
"uv-distribution-filename",
|
||||||
"uv-normalize",
|
"uv-normalize",
|
||||||
"uv-pypi-types",
|
"uv-pypi-types",
|
||||||
|
@ -5430,6 +5471,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-test",
|
"tracing-test",
|
||||||
|
"traversable-error",
|
||||||
"unicode-width 0.2.0",
|
"unicode-width 0.2.0",
|
||||||
"url",
|
"url",
|
||||||
"uv-fs",
|
"uv-fs",
|
||||||
|
@ -5456,6 +5498,7 @@ dependencies = [
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
|
"traversable-error",
|
||||||
"uv-small-str",
|
"uv-small-str",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5481,6 +5524,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-auth",
|
"uv-auth",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
|
@ -5500,7 +5544,7 @@ dependencies = [
|
||||||
name = "uv-pypi-types"
|
name = "uv-pypi-types"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"hashbrown 0.15.3",
|
"hashbrown 0.15.3",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"insta",
|
"insta",
|
||||||
|
@ -5517,6 +5561,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"toml_edit",
|
"toml_edit",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-distribution-filename",
|
"uv-distribution-filename",
|
||||||
"uv-git-types",
|
"uv-git-types",
|
||||||
|
@ -5530,7 +5575,7 @@ dependencies = [
|
||||||
name = "uv-python"
|
name = "uv-python"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"assert_fs",
|
"assert_fs",
|
||||||
"clap",
|
"clap",
|
||||||
"configparser",
|
"configparser",
|
||||||
|
@ -5562,6 +5607,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
"uv-cache-info",
|
"uv-cache-info",
|
||||||
|
@ -5590,7 +5636,7 @@ dependencies = [
|
||||||
name = "uv-requirements"
|
name = "uv-requirements"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"configparser",
|
"configparser",
|
||||||
"console",
|
"console",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
|
@ -5600,6 +5646,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache-key",
|
"uv-cache-key",
|
||||||
"uv-client",
|
"uv-client",
|
||||||
|
@ -5624,7 +5671,7 @@ dependencies = [
|
||||||
name = "uv-requirements-txt"
|
name = "uv-requirements-txt"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"assert_fs",
|
"assert_fs",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
"indoc",
|
"indoc",
|
||||||
|
@ -5639,6 +5686,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"unscanny",
|
"unscanny",
|
||||||
"url",
|
"url",
|
||||||
"uv-client",
|
"uv-client",
|
||||||
|
@ -5681,6 +5729,7 @@ dependencies = [
|
||||||
"toml",
|
"toml",
|
||||||
"toml_edit",
|
"toml_edit",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache-key",
|
"uv-cache-key",
|
||||||
"uv-client",
|
"uv-client",
|
||||||
|
@ -5718,6 +5767,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"toml",
|
"toml",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-pep440",
|
"uv-pep440",
|
||||||
"uv-pep508",
|
"uv-pep508",
|
||||||
|
@ -5738,6 +5788,7 @@ dependencies = [
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache-info",
|
"uv-cache-info",
|
||||||
"uv-configuration",
|
"uv-configuration",
|
||||||
|
@ -5761,7 +5812,7 @@ dependencies = [
|
||||||
name = "uv-shell"
|
name = "uv-shell"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"home",
|
"home",
|
||||||
"same-file",
|
"same-file",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
@ -5810,6 +5861,7 @@ dependencies = [
|
||||||
"toml",
|
"toml",
|
||||||
"toml_edit",
|
"toml_edit",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
"uv-dirs",
|
"uv-dirs",
|
||||||
"uv-distribution-types",
|
"uv-distribution-types",
|
||||||
|
@ -5837,6 +5889,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-distribution-types",
|
"uv-distribution-types",
|
||||||
"uv-normalize",
|
"uv-normalize",
|
||||||
|
@ -5849,11 +5902,12 @@ dependencies = [
|
||||||
name = "uv-trampoline-builder"
|
name = "uv-trampoline-builder"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
"assert_fs",
|
"assert_fs",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
|
"traversable-error",
|
||||||
"uv-fs",
|
"uv-fs",
|
||||||
"which",
|
"which",
|
||||||
"zip",
|
"zip",
|
||||||
|
@ -5863,9 +5917,10 @@ dependencies = [
|
||||||
name = "uv-types"
|
name = "uv-types"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-cache",
|
"uv-cache",
|
||||||
"uv-configuration",
|
"uv-configuration",
|
||||||
|
@ -5895,6 +5950,7 @@ dependencies = [
|
||||||
"self-replace",
|
"self-replace",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"uv-fs",
|
"uv-fs",
|
||||||
"uv-pypi-types",
|
"uv-pypi-types",
|
||||||
"uv-python",
|
"uv-python",
|
||||||
|
@ -5915,7 +5971,7 @@ dependencies = [
|
||||||
name = "uv-workspace"
|
name = "uv-workspace"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow 0.1.0",
|
||||||
"assert_fs",
|
"assert_fs",
|
||||||
"fs-err 3.1.0",
|
"fs-err 3.1.0",
|
||||||
"glob",
|
"glob",
|
||||||
|
@ -5932,6 +5988,7 @@ dependencies = [
|
||||||
"toml",
|
"toml",
|
||||||
"toml_edit",
|
"toml_edit",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"traversable-error",
|
||||||
"url",
|
"url",
|
||||||
"uv-build-backend",
|
"uv-build-backend",
|
||||||
"uv-cache-key",
|
"uv-cache-key",
|
||||||
|
|
|
@ -20,6 +20,8 @@ authors = ["uv"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
traversable-error = { path = "crates/traversable-error" }
|
||||||
|
traversable-derive = { path = "crates/traversable-derive" }
|
||||||
uv-auth = { path = "crates/uv-auth" }
|
uv-auth = { path = "crates/uv-auth" }
|
||||||
uv-build-backend = { path = "crates/uv-build-backend" }
|
uv-build-backend = { path = "crates/uv-build-backend" }
|
||||||
uv-build-frontend = { path = "crates/uv-build-frontend" }
|
uv-build-frontend = { path = "crates/uv-build-frontend" }
|
||||||
|
@ -72,7 +74,8 @@ uv-warnings = { path = "crates/uv-warnings" }
|
||||||
uv-workspace = { path = "crates/uv-workspace" }
|
uv-workspace = { path = "crates/uv-workspace" }
|
||||||
|
|
||||||
anstream = { version = "0.6.15" }
|
anstream = { version = "0.6.15" }
|
||||||
anyhow = { version = "1.0.89" }
|
anyhow = { path = "crates/anyhow-wrapper" }
|
||||||
|
anyhow-original = { package = "anyhow", version = "1.0.89" }
|
||||||
arcstr = { version = "1.2.0" }
|
arcstr = { version = "1.2.0" }
|
||||||
astral-tokio-tar = { version = "0.5.1" }
|
astral-tokio-tar = { version = "0.5.1" }
|
||||||
async-channel = { version = "2.3.1" }
|
async-channel = { version = "2.3.1" }
|
||||||
|
|
16
crates/anyhow-wrapper/Cargo.toml
Normal file
16
crates/anyhow-wrapper/Cargo.toml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[package]
|
||||||
|
name = "anyhow"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
anyhow-original = { workspace = true }
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
174
crates/anyhow-wrapper/src/lib.rs
Normal file
174
crates/anyhow-wrapper/src/lib.rs
Normal file
|
@ -0,0 +1,174 @@
|
||||||
|
// macro pass-through
|
||||||
|
pub use anyhow_original;
|
||||||
|
use std::convert::Infallible;
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! anyhow {
|
||||||
|
($($args:tt)*) => {
|
||||||
|
$crate::Error::Anyhow($crate::anyhow_original::anyhow!($($args)*))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! format_err {
|
||||||
|
($($args:tt)*) => {
|
||||||
|
$crate::Error::Anyhow($crate::anyhow_original::format_err!($($args)*))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! bail {
|
||||||
|
($msg:literal $(,)?) => {
|
||||||
|
return $crate::anyhow_original::__private::Err($crate::anyhow!($msg))
|
||||||
|
};
|
||||||
|
($err:expr $(,)?) => {
|
||||||
|
return $crate::anyhow_original::__private::Err($crate::anyhow!($err))
|
||||||
|
};
|
||||||
|
($fmt:expr, $($arg:tt)*) => {
|
||||||
|
return $crate::anyhow_original::__private::Err($crate::anyhow!($fmt, $($arg)*))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Copied almost verbatim from anyhow
|
||||||
|
pub trait Context<T, E> {
|
||||||
|
/// Wrap the error value with additional context.
|
||||||
|
fn context<C>(self, context: C) -> anyhow_original::Result<T, Error>
|
||||||
|
where
|
||||||
|
C: std::fmt::Display + Send + Sync + 'static;
|
||||||
|
|
||||||
|
/// Wrap the error value with additional context that is evaluated lazily
|
||||||
|
/// only once an error does occur.
|
||||||
|
fn with_context<C, F>(self, f: F) -> anyhow_original::Result<T, Error>
|
||||||
|
where
|
||||||
|
C: std::fmt::Display + Send + Sync + 'static,
|
||||||
|
F: FnOnce() -> C;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T, E> Context<T, E> for std::result::Result<T, E>
|
||||||
|
where
|
||||||
|
E: std::error::Error + Send + Sync + 'static,
|
||||||
|
{
|
||||||
|
fn context<C>(self, context: C) -> std::result::Result<T, Error>
|
||||||
|
where
|
||||||
|
C: std::fmt::Display + Send + Sync + 'static,
|
||||||
|
{
|
||||||
|
Ok(anyhow_original::Context::context(self, context)?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn with_context<C, F>(self, context: F) -> std::result::Result<T, Error>
|
||||||
|
where
|
||||||
|
C: std::fmt::Display + Send + Sync + 'static,
|
||||||
|
F: FnOnce() -> C,
|
||||||
|
{
|
||||||
|
Ok(anyhow_original::Context::with_context(self, context)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> Context<T, Infallible> for Option<T> {
|
||||||
|
fn context<C>(self, context: C) -> std::result::Result<T, Error>
|
||||||
|
where
|
||||||
|
C: std::fmt::Display + Send + Sync + 'static,
|
||||||
|
{
|
||||||
|
Ok(anyhow_original::Context::context(self, context)?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn with_context<C, F>(self, context: F) -> std::result::Result<T, Error>
|
||||||
|
where
|
||||||
|
C: std::fmt::Display + Send + Sync + 'static,
|
||||||
|
F: FnOnce() -> C,
|
||||||
|
{
|
||||||
|
Ok(anyhow_original::Context::with_context(self, context)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
||||||
|
|
||||||
|
pub trait TraversableError: std::error::Error + Send + Sync + 'static {
|
||||||
|
fn name(&self) -> &str;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum Error {
|
||||||
|
Traversable(Box<dyn TraversableError>),
|
||||||
|
Anyhow(anyhow_original::Error),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Error {
|
||||||
|
pub fn new<E>(error: E) -> Self
|
||||||
|
where
|
||||||
|
E: std::error::Error + Send + Sync + 'static,
|
||||||
|
{
|
||||||
|
Self::Anyhow(anyhow_original::Error::new(error))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn chain(&self) -> anyhow_original::Chain {
|
||||||
|
match self {
|
||||||
|
Error::Traversable(err) => anyhow_original::Chain::new(err.as_ref()),
|
||||||
|
Error::Anyhow(err) => err.chain(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for Error {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
Self::Traversable(err) => std::fmt::Debug::fmt(err, f),
|
||||||
|
Self::Anyhow(err) => std::fmt::Debug::fmt(err, f),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Display for Error {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
Self::Traversable(err) => std::fmt::Display::fmt(err, f),
|
||||||
|
Self::Anyhow(err) => std::fmt::Display::fmt(err, f),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::error::Error for Error {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||||
|
match self {
|
||||||
|
Self::Traversable(err) => Some(err.as_ref()),
|
||||||
|
Self::Anyhow(err) => Some(err.as_ref()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<E: TraversableError> From<E> for Error {
|
||||||
|
fn from(error: E) -> Self {
|
||||||
|
Self::Traversable(Box::new(error))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<E: TraversableError> TraversableError for Box<E> {
|
||||||
|
fn name(&self) -> &str {
|
||||||
|
(&**self).name()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TraversableError for std::fmt::Error {
|
||||||
|
fn name(&self) -> &str {
|
||||||
|
"std::fmt::Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TraversableError for std::io::Error {
|
||||||
|
fn name(&self) -> &str {
|
||||||
|
"std::io::Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(konsti): Where are the matching std and anyhow methods?
|
||||||
|
// anyhow supports `GIT.as_ref()?` but our error doesn't.
|
||||||
|
impl<E: TraversableError> TraversableError for &'static E {
|
||||||
|
fn name(&self) -> &str {
|
||||||
|
TraversableError::name(*self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<anyhow_original::Error> for Error {
|
||||||
|
fn from(error: anyhow_original::Error) -> Self {
|
||||||
|
Self::Anyhow(error)
|
||||||
|
}
|
||||||
|
}
|
20
crates/traversable-derive/Cargo.toml
Normal file
20
crates/traversable-derive/Cargo.toml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
[package]
|
||||||
|
name = "traversable-derive"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
proc-macro = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
quote = { workspace = true }
|
||||||
|
syn = { workspace = true }
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
51
crates/traversable-derive/src/lib.rs
Normal file
51
crates/traversable-derive/src/lib.rs
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
use proc_macro::TokenStream;
|
||||||
|
use quote::quote;
|
||||||
|
use syn::{parse_macro_input, Data, DeriveInput, Fields};
|
||||||
|
|
||||||
|
#[proc_macro_derive(TraversableError)]
|
||||||
|
pub fn derive_traversable_error(input: TokenStream) -> TokenStream {
|
||||||
|
let input = parse_macro_input!(input as DeriveInput);
|
||||||
|
let name = input.ident;
|
||||||
|
|
||||||
|
let name_impl = match input.data {
|
||||||
|
Data::Enum(ref enum_data) => {
|
||||||
|
let match_arms = enum_data.variants.iter().map(|variant| {
|
||||||
|
let variant_name = &variant.ident;
|
||||||
|
let field_pattern = match &variant.fields {
|
||||||
|
Fields::Named(_) => quote! { { .. } },
|
||||||
|
Fields::Unnamed(_) => quote! { (..) },
|
||||||
|
Fields::Unit => quote! {},
|
||||||
|
};
|
||||||
|
|
||||||
|
quote! {
|
||||||
|
#name::#variant_name #field_pattern => {
|
||||||
|
concat!(stringify!(#name), "::", stringify!(#variant_name))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
quote! {
|
||||||
|
fn name(&self) -> &str {
|
||||||
|
match self {
|
||||||
|
#(#match_arms,)*
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
quote! {
|
||||||
|
fn name(&self) -> &str {
|
||||||
|
stringify!(#name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let expanded = quote! {
|
||||||
|
impl ::traversable_error::anyhow::TraversableError for #name {
|
||||||
|
#name_impl
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
expanded.into()
|
||||||
|
}
|
19
crates/traversable-error/Cargo.toml
Normal file
19
crates/traversable-error/Cargo.toml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
[package]
|
||||||
|
name = "traversable-error"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
documentation.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
anyhow = { workspace = true}
|
||||||
|
traversable-derive = { workspace = true}
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
|
@ -243,10 +243,13 @@ impl Middleware for AuthMiddleware {
|
||||||
// <https://github.com/TrueLayer/reqwest-middleware/blob/abdf1844c37092d323683c2396b7eefda1418d3c/reqwest-retry/src/middleware.rs#L141-L149>
|
// <https://github.com/TrueLayer/reqwest-middleware/blob/abdf1844c37092d323683c2396b7eefda1418d3c/reqwest-retry/src/middleware.rs#L141-L149>
|
||||||
// Clone the request so we can retry it on authentication failure
|
// Clone the request so we can retry it on authentication failure
|
||||||
let retry_request = request.try_clone().ok_or_else(|| {
|
let retry_request = request.try_clone().ok_or_else(|| {
|
||||||
Error::Middleware(anyhow!(
|
Error::Middleware(
|
||||||
"Request object is not cloneable. Are you passing a streaming body?"
|
anyhow!(
|
||||||
.to_string()
|
"Request object is not cloneable. Are you passing a streaming body?"
|
||||||
))
|
.to_string()
|
||||||
|
)
|
||||||
|
.into(),
|
||||||
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let response = next.clone().run(request, extensions).await?;
|
let response = next.clone().run(request, extensions).await?;
|
||||||
|
@ -336,9 +339,9 @@ impl Middleware for AuthMiddleware {
|
||||||
if let Some(response) = response {
|
if let Some(response) = response {
|
||||||
Ok(response)
|
Ok(response)
|
||||||
} else {
|
} else {
|
||||||
Err(Error::Middleware(format_err!(
|
Err(Error::Middleware(
|
||||||
"Missing credentials for {url}"
|
format_err!("Missing credentials for {url}").into(),
|
||||||
)))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -361,7 +364,9 @@ impl AuthMiddleware {
|
||||||
};
|
};
|
||||||
let url = request.url().clone();
|
let url = request.url().clone();
|
||||||
if matches!(auth_policy, AuthPolicy::Always) && credentials.password().is_none() {
|
if matches!(auth_policy, AuthPolicy::Always) && credentials.password().is_none() {
|
||||||
return Err(Error::Middleware(format_err!("Missing password for {url}")));
|
return Err(Error::Middleware(
|
||||||
|
format_err!("Missing password for {url}").into(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
let result = next.run(request, extensions).await;
|
let result = next.run(request, extensions).await;
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ sha2 = { workspace = true }
|
||||||
spdx = { workspace = true }
|
spdx = { workspace = true }
|
||||||
tar = { workspace = true }
|
tar = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
toml = { workspace = true }
|
toml = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
version-ranges = { workspace = true }
|
version-ranges = { workspace = true }
|
||||||
|
|
|
@ -24,7 +24,7 @@ use uv_pypi_types::{Identifier, IdentifierParseError};
|
||||||
|
|
||||||
use crate::metadata::ValidationError;
|
use crate::metadata::ValidationError;
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
|
|
@ -26,7 +26,7 @@ use crate::{BuildBackendSettings, Error};
|
||||||
/// By default, we ignore generated python files.
|
/// By default, we ignore generated python files.
|
||||||
pub(crate) const DEFAULT_EXCLUDES: &[&str] = &["__pycache__", "*.pyc", "*.pyo"];
|
pub(crate) const DEFAULT_EXCLUDES: &[&str] = &["__pycache__", "*.pyc", "*.pyo"];
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum ValidationError {
|
pub enum ValidationError {
|
||||||
/// The spec isn't clear about what the values in that field would be, and we only support the
|
/// The spec isn't clear about what the values in that field would be, and we only support the
|
||||||
/// default value (UTF-8).
|
/// default value (UTF-8).
|
||||||
|
|
|
@ -41,6 +41,7 @@ serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
toml_edit = { workspace = true }
|
toml_edit = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
|
|
|
@ -54,7 +54,7 @@ static TORCH_NOT_FOUND_RE: LazyLock<Regex> =
|
||||||
static DISTUTILS_NOT_FOUND_RE: LazyLock<Regex> =
|
static DISTUTILS_NOT_FOUND_RE: LazyLock<Regex> =
|
||||||
LazyLock::new(|| Regex::new(r"ModuleNotFoundError: No module named 'distutils'").unwrap());
|
LazyLock::new(|| Regex::new(r"ModuleNotFoundError: No module named 'distutils'").unwrap());
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
@ -120,7 +120,7 @@ enum MissingLibrary {
|
||||||
DeprecatedModule(String, Version),
|
DeprecatedModule(String, Version),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct MissingHeaderCause {
|
pub struct MissingHeaderCause {
|
||||||
missing_library: MissingLibrary,
|
missing_library: MissingLibrary,
|
||||||
package_name: Option<PackageName>,
|
package_name: Option<PackageName>,
|
||||||
|
@ -248,7 +248,7 @@ impl Display for MissingHeaderCause {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct BuildBackendError {
|
pub struct BuildBackendError {
|
||||||
message: String,
|
message: String,
|
||||||
exit_code: ExitStatus,
|
exit_code: ExitStatus,
|
||||||
|
@ -287,7 +287,7 @@ impl Display for BuildBackendError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct MissingHeaderError {
|
pub struct MissingHeaderError {
|
||||||
message: String,
|
message: String,
|
||||||
exit_code: ExitStatus,
|
exit_code: ExitStatus,
|
||||||
|
|
|
@ -21,6 +21,7 @@ globwalk = { workspace = true }
|
||||||
schemars = { workspace = true, optional = true }
|
schemars = { workspace = true, optional = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
toml = { workspace = true }
|
toml = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
walkdir = { workspace = true }
|
walkdir = { workspace = true }
|
||||||
|
|
|
@ -9,7 +9,7 @@ use tracing::{debug, warn};
|
||||||
use crate::git_info::{Commit, Tags};
|
use crate::git_info::{Commit, Tags};
|
||||||
use crate::timestamp::Timestamp;
|
use crate::timestamp::Timestamp;
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum CacheInfoError {
|
pub enum CacheInfoError {
|
||||||
#[error("Failed to parse glob patterns for `cache-keys`: {0}")]
|
#[error("Failed to parse glob patterns for `cache-keys`: {0}")]
|
||||||
Glob(#[from] globwalk::GlobError),
|
Glob(#[from] globwalk::GlobError),
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
|
||||||
use tracing::warn;
|
use tracing::warn;
|
||||||
use walkdir::WalkDir;
|
use walkdir::WalkDir;
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub(crate) enum GitInfoError {
|
pub(crate) enum GitInfoError {
|
||||||
#[error("The repository at {0} is missing a `.git` directory")]
|
#[error("The repository at {0} is missing a `.git` directory")]
|
||||||
MissingGitDir(PathBuf),
|
MissingGitDir(PathBuf),
|
||||||
|
|
|
@ -51,6 +51,7 @@ serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
sys-info = { workspace = true }
|
sys-info = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tl = { workspace = true }
|
tl = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tokio-util = { workspace = true }
|
tokio-util = { workspace = true }
|
||||||
|
|
|
@ -11,7 +11,7 @@ use uv_normalize::PackageName;
|
||||||
use crate::middleware::OfflineError;
|
use crate::middleware::OfflineError;
|
||||||
use crate::{html, FlatIndexError};
|
use crate::{html, FlatIndexError};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
kind: Box<ErrorKind>,
|
kind: Box<ErrorKind>,
|
||||||
|
@ -147,7 +147,7 @@ impl From<ErrorKind> for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum ErrorKind {
|
pub enum ErrorKind {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
InvalidUrl(#[from] uv_distribution_types::ToUrlError),
|
InvalidUrl(#[from] uv_distribution_types::ToUrlError),
|
||||||
|
|
|
@ -16,7 +16,7 @@ use crate::cached_client::{CacheControl, CachedClientError};
|
||||||
use crate::html::SimpleHtml;
|
use crate::html::SimpleHtml;
|
||||||
use crate::{CachedClient, Connectivity, Error, ErrorKind, OwnedArchive};
|
use crate::{CachedClient, Connectivity, Error, ErrorKind, OwnedArchive};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum FlatIndexError {
|
pub enum FlatIndexError {
|
||||||
#[error("Expected a file URL, but received: {0}")]
|
#[error("Expected a file URL, but received: {0}")]
|
||||||
NonFileUrl(Url),
|
NonFileUrl(Url),
|
||||||
|
@ -28,7 +28,7 @@ pub enum FlatIndexError {
|
||||||
FindLinksUrl(Url, #[source] Error),
|
FindLinksUrl(Url, #[source] Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum FindLinksDirectoryError {
|
pub enum FindLinksDirectoryError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -224,7 +224,7 @@ impl SimpleHtml {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Utf8(#[from] std::str::Utf8Error),
|
Utf8(#[from] std::str::Utf8Error),
|
||||||
|
|
|
@ -2,7 +2,7 @@ use reqwest::Identity;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub(crate) enum CertificateError {
|
pub(crate) enum CertificateError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -39,6 +39,7 @@ serde = { workspace = true }
|
||||||
serde-untagged = { workspace = true }
|
serde-untagged = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ impl serde::Serialize for TrustedHost {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum TrustedHostError {
|
pub enum TrustedHostError {
|
||||||
#[error("missing host for `--trusted-host`: `{0}`")]
|
#[error("missing host for `--trusted-host`: `{0}`")]
|
||||||
MissingHost(String),
|
MissingHost(String),
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::process::{Command, Stdio};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use uv_git::GIT;
|
use uv_git::GIT;
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum VersionControlError {
|
pub enum VersionControlError {
|
||||||
#[error("Attempted to initialize a Git repository, but `git` was not found in PATH")]
|
#[error("Attempted to initialize a Git repository, but `git` was not found in PATH")]
|
||||||
GitNotInstalled,
|
GitNotInstalled,
|
||||||
|
|
|
@ -41,5 +41,6 @@ futures = { workspace = true }
|
||||||
itertools = { workspace = true }
|
itertools = { workspace = true }
|
||||||
rustc-hash = { workspace = true }
|
rustc-hash = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
|
|
|
@ -40,7 +40,7 @@ use uv_types::{
|
||||||
};
|
};
|
||||||
use uv_workspace::WorkspaceCache;
|
use uv_workspace::WorkspaceCache;
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum BuildDispatchError {
|
pub enum BuildDispatchError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
BuildFrontend(#[from] AnyErrorBuild),
|
BuildFrontend(#[from] AnyErrorBuild),
|
||||||
|
|
|
@ -27,6 +27,7 @@ rkyv = { workspace = true, features = ["smallvec-1"] }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
smallvec = { workspace = true }
|
smallvec = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::str::FromStr;
|
||||||
|
|
||||||
use uv_small_str::SmallString;
|
use uv_small_str::SmallString;
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum BuildTagError {
|
pub enum BuildTagError {
|
||||||
#[error("must not be empty")]
|
#[error("must not be empty")]
|
||||||
Empty,
|
Empty,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use thiserror::Error;
|
||||||
use uv_normalize::{InvalidNameError, PackageName};
|
use uv_normalize::{InvalidNameError, PackageName};
|
||||||
use uv_pep440::{Version, VersionParseError};
|
use uv_pep440::{Version, VersionParseError};
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum EggInfoFilenameError {
|
pub enum EggInfoFilenameError {
|
||||||
#[error("The filename \"{0}\" does not end in `.egg-info`")]
|
#[error("The filename \"{0}\" does not end in `.egg-info`")]
|
||||||
InvalidExtension(String),
|
InvalidExtension(String),
|
||||||
|
|
|
@ -104,7 +104,7 @@ impl Display for SourceDistExtension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum ExtensionError {
|
pub enum ExtensionError {
|
||||||
#[error("`.whl`, `.tar.gz`, `.zip`, `.tar.bz2`, `.tar.lz`, `.tar.lzma`, `.tar.xz`, `.tar.zst`, `.tar`, `.tbz`, `.tgz`, `.tlz`, or `.txz`")]
|
#[error("`.whl`, `.tar.gz`, `.zip`, `.tar.bz2`, `.tar.lz`, `.tar.lzma`, `.tar.xz`, `.tar.zst`, `.tar`, `.tbz`, `.tgz`, `.tlz`, or `.txz`")]
|
||||||
Dist,
|
Dist,
|
||||||
|
|
|
@ -141,7 +141,7 @@ impl Display for SourceDistFilename {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug, Clone)]
|
#[derive(traversable_error::TraversableError, Error, Debug, Clone)]
|
||||||
pub struct SourceDistFilenameError {
|
pub struct SourceDistFilenameError {
|
||||||
filename: String,
|
filename: String,
|
||||||
kind: SourceDistFilenameErrorKind,
|
kind: SourceDistFilenameErrorKind,
|
||||||
|
@ -157,7 +157,7 @@ impl Display for SourceDistFilenameError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug, Clone)]
|
#[derive(traversable_error::TraversableError, Error, Debug, Clone)]
|
||||||
enum SourceDistFilenameErrorKind {
|
enum SourceDistFilenameErrorKind {
|
||||||
#[error("Name doesn't start with package name {0}")]
|
#[error("Name doesn't start with package name {0}")]
|
||||||
Filename(PackageName),
|
Filename(PackageName),
|
||||||
|
|
|
@ -355,7 +355,7 @@ impl Serialize for WheelFilename {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum WheelFilenameError {
|
pub enum WheelFilenameError {
|
||||||
#[error("The wheel filename \"{0}\" is invalid: {1}")]
|
#[error("The wheel filename \"{0}\" is invalid: {1}")]
|
||||||
InvalidWheelFileName(String, String),
|
InvalidWheelFileName(String, String),
|
||||||
|
|
|
@ -44,6 +44,7 @@ schemars = { workspace = true, optional = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
version-ranges = { workspace = true }
|
version-ranges = { workspace = true }
|
||||||
|
|
|
@ -2,7 +2,7 @@ use url::Url;
|
||||||
|
|
||||||
use uv_normalize::PackageName;
|
use uv_normalize::PackageName;
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -11,7 +11,7 @@ use uv_pypi_types::{CoreMetadata, HashDigests, Yanked};
|
||||||
use uv_small_str::SmallString;
|
use uv_small_str::SmallString;
|
||||||
|
|
||||||
/// Error converting [`uv_pypi_types::File`] to [`distribution_type::File`].
|
/// Error converting [`uv_pypi_types::File`] to [`distribution_type::File`].
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum FileConversionError {
|
pub enum FileConversionError {
|
||||||
#[error("Failed to parse `requires-python`: `{0}`")]
|
#[error("Failed to parse `requires-python`: `{0}`")]
|
||||||
RequiresPython(String, #[source] VersionSpecifiersParseError),
|
RequiresPython(String, #[source] VersionSpecifiersParseError),
|
||||||
|
@ -197,7 +197,7 @@ impl Display for UrlString {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error that occurs when a [`FileLocation`] is not a valid URL.
|
/// An error that occurs when a [`FileLocation`] is not a valid URL.
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, thiserror::Error)]
|
#[derive(Clone, Debug, Eq, PartialEq, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum ToUrlError {
|
pub enum ToUrlError {
|
||||||
/// An error that occurs when the base URL in [`FileLocation::Relative`]
|
/// An error that occurs when the base URL in [`FileLocation::Relative`]
|
||||||
/// could not be parsed as a valid URL.
|
/// could not be parsed as a valid URL.
|
||||||
|
|
|
@ -375,7 +375,7 @@ impl<'a> From<&'a IndexUrl> for IndexMetadataRef<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error that can occur when parsing an [`Index`].
|
/// An error that can occur when parsing an [`Index`].
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum IndexSourceError {
|
pub enum IndexSourceError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Url(#[from] IndexUrlError),
|
Url(#[from] IndexUrlError),
|
||||||
|
|
|
@ -87,7 +87,7 @@ impl Deref for IndexName {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error that can occur when parsing an [`IndexName`].
|
/// An error that can occur when parsing an [`IndexName`].
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum IndexNameError {
|
pub enum IndexNameError {
|
||||||
#[error("Index included a name, but the name was empty")]
|
#[error("Index included a name, but the name was empty")]
|
||||||
EmptyName,
|
EmptyName,
|
||||||
|
|
|
@ -160,7 +160,7 @@ impl Verbatim for IndexUrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error that can occur when parsing an [`IndexUrl`].
|
/// An error that can occur when parsing an [`IndexUrl`].
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum IndexUrlError {
|
pub enum IndexUrlError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -17,7 +17,7 @@ use uv_pypi_types::{DirectUrl, MetadataError};
|
||||||
|
|
||||||
use crate::{DistributionMetadata, InstalledMetadata, InstalledVersion, Name, VersionOrUrlRef};
|
use crate::{DistributionMetadata, InstalledMetadata, InstalledVersion, Name, VersionOrUrlRef};
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum InstalledDistError {
|
pub enum InstalledDistError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -22,7 +22,7 @@ use uv_pypi_types::{
|
||||||
ParsedUrl, ParsedUrlError, VerbatimParsedUrl,
|
ParsedUrl, ParsedUrlError, VerbatimParsedUrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum RequirementError {
|
pub enum RequirementError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
VerbatimUrlError(#[from] uv_pep508::VerbatimUrlError),
|
VerbatimUrlError(#[from] uv_pep508::VerbatimUrlError),
|
||||||
|
|
|
@ -49,6 +49,7 @@ rustc-hash = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tokio-util = { workspace = true, features = ["compat"] }
|
tokio-util = { workspace = true, features = ["compat"] }
|
||||||
toml = { workspace = true }
|
toml = { workspace = true }
|
||||||
|
|
|
@ -15,7 +15,7 @@ use uv_pep440::{Version, VersionSpecifiers};
|
||||||
use uv_pypi_types::{HashAlgorithm, HashDigest};
|
use uv_pypi_types::{HashAlgorithm, HashDigest};
|
||||||
use uv_types::AnyErrorBuild;
|
use uv_types::AnyErrorBuild;
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Building source distributions is disabled")]
|
#[error("Building source distributions is disabled")]
|
||||||
NoBuild,
|
NoBuild,
|
||||||
|
@ -162,7 +162,9 @@ impl From<reqwest::Error> for Error {
|
||||||
impl From<reqwest_middleware::Error> for Error {
|
impl From<reqwest_middleware::Error> for Error {
|
||||||
fn from(error: reqwest_middleware::Error) -> Self {
|
fn from(error: reqwest_middleware::Error) -> Self {
|
||||||
match error {
|
match error {
|
||||||
reqwest_middleware::Error::Middleware(error) => Self::ReqwestMiddlewareError(error),
|
reqwest_middleware::Error::Middleware(error) => {
|
||||||
|
Self::ReqwestMiddlewareError(error.into())
|
||||||
|
}
|
||||||
reqwest_middleware::Error::Reqwest(error) => {
|
reqwest_middleware::Error::Reqwest(error) => {
|
||||||
Self::Reqwest(WrappedReqwestError::from(error))
|
Self::Reqwest(WrappedReqwestError::from(error))
|
||||||
}
|
}
|
||||||
|
|
|
@ -502,7 +502,7 @@ impl LoweredRequirement {
|
||||||
|
|
||||||
/// An error parsing and merging `tool.uv.sources` with
|
/// An error parsing and merging `tool.uv.sources` with
|
||||||
/// `project.{dependencies,optional-dependencies}`.
|
/// `project.{dependencies,optional-dependencies}`.
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum LoweringError {
|
pub enum LoweringError {
|
||||||
#[error("`{0}` is included as a workspace member, but is missing an entry in `tool.uv.sources` (e.g., `{0} = {{ workspace = true }}`)")]
|
#[error("`{0}` is included as a workspace member, but is missing an entry in `tool.uv.sources` (e.g., `{0} = {{ workspace = true }}`)")]
|
||||||
MissingWorkspaceSource(PackageName),
|
MissingWorkspaceSource(PackageName),
|
||||||
|
|
|
@ -20,7 +20,7 @@ mod build_requires;
|
||||||
mod lowering;
|
mod lowering;
|
||||||
mod requires_dist;
|
mod requires_dist;
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum MetadataError {
|
pub enum MetadataError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Workspace(#[from] WorkspaceError),
|
Workspace(#[from] WorkspaceError),
|
||||||
|
|
|
@ -32,6 +32,7 @@ reqwest = { workspace = true }
|
||||||
rustc-hash = { workspace = true }
|
rustc-hash = { workspace = true }
|
||||||
sha2 = { workspace = true }
|
sha2 = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tokio-util = { workspace = true, features = ["compat"] }
|
tokio-util = { workspace = true, features = ["compat"] }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::{ffi::OsString, path::PathBuf};
|
use std::{ffi::OsString, path::PathBuf};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Zip(#[from] zip::result::ZipError),
|
Zip(#[from] zip::result::ZipError),
|
||||||
|
|
|
@ -18,5 +18,6 @@ workspace = true
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
|
@ -9,7 +9,7 @@ mod github;
|
||||||
mod oid;
|
mod oid;
|
||||||
mod reference;
|
mod reference;
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum GitUrlParseError {
|
pub enum GitUrlParseError {
|
||||||
#[error(
|
#[error(
|
||||||
"Unsupported Git URL scheme `{0}:` in `{1}` (expected one of `https:`, `ssh:`, or `file:`)"
|
"Unsupported Git URL scheme `{0}:` in `{1}` (expected one of `https:`, `ssh:`, or `file:`)"
|
||||||
|
|
|
@ -24,7 +24,7 @@ impl GitOid {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError, PartialEq)]
|
#[derive(Debug, traversable_error::TraversableError, Error, PartialEq)]
|
||||||
pub enum OidParseError {
|
pub enum OidParseError {
|
||||||
#[error("Object ID can be at most 40 hex characters")]
|
#[error("Object ID can be at most 40 hex characters")]
|
||||||
TooLong,
|
TooLong,
|
||||||
|
|
|
@ -24,12 +24,14 @@ uv-static = { workspace = true }
|
||||||
uv-version = { workspace = true }
|
uv-version = { workspace = true }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
|
anyhow_original = { package = "anyhow", version = "1" }
|
||||||
cargo-util = { workspace = true }
|
cargo-util = { workspace = true }
|
||||||
dashmap = { workspace = true }
|
dashmap = { workspace = true }
|
||||||
fs-err = { workspace = true, features = ["tokio"] }
|
fs-err = { workspace = true, features = ["tokio"] }
|
||||||
reqwest = { workspace = true, features = ["blocking"] }
|
reqwest = { workspace = true, features = ["blocking"] }
|
||||||
reqwest-middleware = { workspace = true }
|
reqwest-middleware = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
|
@ -7,7 +7,7 @@ use std::path::{Path, PathBuf};
|
||||||
use std::str::{self};
|
use std::str::{self};
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow_original::{Context, Result};
|
||||||
use cargo_util::{paths, ProcessBuilder};
|
use cargo_util::{paths, ProcessBuilder};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use reqwest_middleware::ClientWithMiddleware;
|
use reqwest_middleware::ClientWithMiddleware;
|
||||||
|
@ -23,7 +23,7 @@ use uv_version::version;
|
||||||
/// checkout is ready to go. See [`GitCheckout::reset`] for why we need this.
|
/// checkout is ready to go. See [`GitCheckout::reset`] for why we need this.
|
||||||
const CHECKOUT_READY_LOCK: &str = ".ok";
|
const CHECKOUT_READY_LOCK: &str = ".ok";
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum GitError {
|
pub enum GitError {
|
||||||
#[error("Git executable not found. Ensure that Git is installed and available.")]
|
#[error("Git executable not found. Ensure that Git is installed and available.")]
|
||||||
GitNotFound,
|
GitNotFound,
|
||||||
|
@ -97,7 +97,7 @@ impl ReferenceOrOid<'_> {
|
||||||
Self::Oid(s) => repo.rev_parse(&format!("{s}^0")),
|
Self::Oid(s) => repo.rev_parse(&format!("{s}^0")),
|
||||||
};
|
};
|
||||||
|
|
||||||
result.with_context(|| anyhow::format_err!("failed to find {refkind} `{self}`"))
|
result.with_context(|| anyhow_original::format_err!("failed to find {refkind} `{self}`"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the kind of this [`ReferenceOrOid`].
|
/// Returns the kind of this [`ReferenceOrOid`].
|
||||||
|
|
|
@ -16,14 +16,14 @@ use uv_version::version;
|
||||||
|
|
||||||
use crate::{Fetch, GitSource, Reporter};
|
use crate::{Fetch, GitSource, Reporter};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum GitResolverError {
|
pub enum GitResolverError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Join(#[from] tokio::task::JoinError),
|
Join(#[from] tokio::task::JoinError),
|
||||||
#[error("Git operation failed")]
|
#[error("Git operation failed")]
|
||||||
Git(#[source] anyhow::Error),
|
Git(#[source] anyhow_original::Error),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Reqwest(#[from] reqwest::Error),
|
Reqwest(#[from] reqwest::Error),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
@ -158,7 +158,7 @@ impl GitResolver {
|
||||||
|
|
||||||
let fetch = tokio::task::spawn_blocking(move || source.fetch())
|
let fetch = tokio::task::spawn_blocking(move || source.fetch())
|
||||||
.await?
|
.await?
|
||||||
.map_err(GitResolverError::Git)?;
|
.map_err(|err: anyhow::Error| GitResolverError::Git(err.into()))?;
|
||||||
|
|
||||||
// Insert the resolved URL into the in-memory cache. This ensures that subsequent fetches
|
// Insert the resolved URL into the in-memory cache. This ensures that subsequent fetches
|
||||||
// resolve to the same precise commit.
|
// resolve to the same precise commit.
|
||||||
|
|
|
@ -16,6 +16,7 @@ owo-colors = { workspace = true }
|
||||||
regex = { workspace = true }
|
regex = { workspace = true }
|
||||||
regex-automata = { workspace = true }
|
regex-automata = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
walkdir = { workspace = true }
|
walkdir = { workspace = true }
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use globset::{Glob, GlobBuilder};
|
||||||
use owo_colors::OwoColorize;
|
use owo_colors::OwoColorize;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum PortableGlobError {
|
pub enum PortableGlobError {
|
||||||
/// Shows the failing glob in the error message.
|
/// Shows the failing glob in the error message.
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
|
|
@ -47,6 +47,7 @@ serde_json = { workspace = true }
|
||||||
sha2 = { workspace = true }
|
sha2 = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
walkdir = { workspace = true }
|
walkdir = { workspace = true }
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub struct Layout {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Note: The caller is responsible for adding the path of the wheel we're installing.
|
/// Note: The caller is responsible for adding the path of the wheel we're installing.
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
|
|
@ -44,6 +44,7 @@ rustc-hash = { workspace = true }
|
||||||
same-file = { workspace = true }
|
same-file = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
|
@ -22,7 +22,7 @@ const COMPILEALL_SCRIPT: &str = include_str!("pip_compileall.py");
|
||||||
/// This is longer than any compilation should ever take.
|
/// This is longer than any compilation should ever take.
|
||||||
const COMPILE_TIMEOUT: Duration = Duration::from_secs(60);
|
const COMPILE_TIMEOUT: Duration = Duration::from_secs(60);
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum CompileError {
|
pub enum CompileError {
|
||||||
#[error("Failed to list files in `site-packages`")]
|
#[error("Failed to list files in `site-packages`")]
|
||||||
Walkdir(#[from] walkdir::Error),
|
Walkdir(#[from] walkdir::Error),
|
||||||
|
|
|
@ -210,7 +210,7 @@ impl<'a, Context: BuildContext> Preparer<'a, Context> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Building source distributions is disabled, but attempted to build `{0}`")]
|
#[error("Building source distributions is disabled, but attempted to build `{0}`")]
|
||||||
NoBuild(PackageName),
|
NoBuild(PackageName),
|
||||||
|
|
|
@ -24,7 +24,7 @@ pub async fn uninstall(
|
||||||
Ok(uninstall)
|
Ok(uninstall)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum UninstallError {
|
pub enum UninstallError {
|
||||||
#[error("Unable to uninstall `{0}`. distutils-installed distributions do not include the metadata required to uninstall safely.")]
|
#[error("Unable to uninstall `{0}`. distutils-installed distributions do not include the metadata required to uninstall safely.")]
|
||||||
Distutils(InstalledEggInfoFile),
|
Distutils(InstalledEggInfoFile),
|
||||||
|
|
|
@ -21,6 +21,7 @@ async_zip = { workspace = true }
|
||||||
fs-err = { workspace = true }
|
fs-err = { workspace = true }
|
||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tokio-util = { workspace = true }
|
tokio-util = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
|
|
|
@ -15,7 +15,7 @@ use uv_pypi_types::ResolutionMetadata;
|
||||||
use zip::ZipArchive;
|
use zip::ZipArchive;
|
||||||
|
|
||||||
/// The caller is responsible for attaching the path or url we failed to read.
|
/// The caller is responsible for attaching the path or url we failed to read.
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Failed to read `dist-info` metadata from built wheel")]
|
#[error("Failed to read `dist-info` metadata from built wheel")]
|
||||||
DistInfo,
|
DistInfo,
|
||||||
|
|
|
@ -33,6 +33,7 @@ schemars = { workspace = true, optional = true }
|
||||||
serde = { workspace = true, features = ["derive", "rc"] }
|
serde = { workspace = true, features = ["derive", "rc"] }
|
||||||
smallvec = { workspace = true }
|
smallvec = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tracing = { workspace = true, optional = true }
|
tracing = { workspace = true, optional = true }
|
||||||
unicode-width = { workspace = true }
|
unicode-width = { workspace = true }
|
||||||
url = { workspace = true, features = ["serde"] }
|
url = { workspace = true, features = ["serde"] }
|
||||||
|
|
|
@ -67,7 +67,7 @@ pub struct Pep508Error<T: Pep508Url = VerbatimUrl> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Either we have an error string from our parser or an upstream error from `url`
|
/// Either we have an error string from our parser or an upstream error from `url`
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum Pep508ErrorSource<T: Pep508Url = VerbatimUrl> {
|
pub enum Pep508ErrorSource<T: Pep508Url = VerbatimUrl> {
|
||||||
/// An error from our parser.
|
/// An error from our parser.
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
|
|
|
@ -317,7 +317,7 @@ impl Pep508Url for VerbatimUrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error that can occur when parsing a [`VerbatimUrl`].
|
/// An error that can occur when parsing a [`VerbatimUrl`].
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum VerbatimUrlError {
|
pub enum VerbatimUrlError {
|
||||||
/// Failed to parse a URL.
|
/// Failed to parse a URL.
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
|
|
@ -23,6 +23,7 @@ rkyv = { workspace = true}
|
||||||
rustc-hash = { workspace = true }
|
rustc-hash = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
insta = { version = "1.40.0" }
|
insta = { version = "1.40.0" }
|
||||||
|
|
|
@ -280,7 +280,7 @@ impl FromStr for AbiTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error, PartialEq, Eq)]
|
||||||
pub enum ParseAbiTagError {
|
pub enum ParseAbiTagError {
|
||||||
#[error("Unknown ABI tag format: {0}")]
|
#[error("Unknown ABI tag format: {0}")]
|
||||||
UnknownFormat(String),
|
UnknownFormat(String),
|
||||||
|
|
|
@ -206,7 +206,7 @@ impl FromStr for LanguageTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error, PartialEq, Eq)]
|
||||||
pub enum ParseLanguageTagError {
|
pub enum ParseLanguageTagError {
|
||||||
#[error("Unknown language tag format: {0}")]
|
#[error("Unknown language tag format: {0}")]
|
||||||
UnknownFormat(String),
|
UnknownFormat(String),
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::{fmt, io};
|
||||||
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum PlatformError {
|
pub enum PlatformError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
IOError(#[from] io::Error),
|
IOError(#[from] io::Error),
|
||||||
|
|
|
@ -620,7 +620,7 @@ impl FromStr for PlatformTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error, PartialEq, Eq)]
|
||||||
pub enum ParsePlatformTagError {
|
pub enum ParsePlatformTagError {
|
||||||
#[error("Unknown platform tag format: {0}")]
|
#[error("Unknown platform tag format: {0}")]
|
||||||
UnknownFormat(String),
|
UnknownFormat(String),
|
||||||
|
|
|
@ -10,7 +10,7 @@ use uv_small_str::SmallString;
|
||||||
|
|
||||||
use crate::{AbiTag, Arch, LanguageTag, Os, Platform, PlatformError, PlatformTag};
|
use crate::{AbiTag, Arch, LanguageTag, Os, Platform, PlatformError, PlatformTag};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum TagsError {
|
pub enum TagsError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
PlatformError(#[from] PlatformError),
|
PlatformError(#[from] PlatformError),
|
||||||
|
|
|
@ -40,6 +40,7 @@ rustc-hash = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tokio-util = { workspace = true , features = ["io"] }
|
tokio-util = { workspace = true , features = ["io"] }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
|
|
|
@ -43,7 +43,7 @@ use uv_warnings::{warn_user, warn_user_once};
|
||||||
|
|
||||||
use crate::trusted_publishing::TrustedPublishingError;
|
use crate::trusted_publishing::TrustedPublishingError;
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum PublishError {
|
pub enum PublishError {
|
||||||
#[error("The publish path is not a valid glob pattern: `{0}`")]
|
#[error("The publish path is not a valid glob pattern: `{0}`")]
|
||||||
Pattern(String, #[source] PatternError),
|
Pattern(String, #[source] PatternError),
|
||||||
|
@ -81,7 +81,7 @@ pub enum PublishError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Failure to get the metadata for a specific file.
|
/// Failure to get the metadata for a specific file.
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum PublishPrepareError {
|
pub enum PublishPrepareError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
@ -100,7 +100,7 @@ pub enum PublishPrepareError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Failure in or after (HTTP) transport for a specific file.
|
/// Failure in or after (HTTP) transport for a specific file.
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum PublishSendError {
|
pub enum PublishSendError {
|
||||||
#[error("Failed to send POST request")]
|
#[error("Failed to send POST request")]
|
||||||
ReqwestMiddleware(#[source] reqwest_middleware::Error),
|
ReqwestMiddleware(#[source] reqwest_middleware::Error),
|
||||||
|
|
|
@ -14,7 +14,7 @@ use tracing::{debug, trace};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use uv_static::EnvVars;
|
use uv_static::EnvVars;
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum TrustedPublishingError {
|
pub enum TrustedPublishingError {
|
||||||
#[error("Environment variable {0} not set, is the `id-token: write` permission missing?")]
|
#[error("Environment variable {0} not set, is the `id-token: write` permission missing?")]
|
||||||
MissingEnvVar(&'static str),
|
MissingEnvVar(&'static str),
|
||||||
|
|
|
@ -36,6 +36,7 @@ schemars = { workspace = true, optional = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde-untagged = { workspace = true }
|
serde-untagged = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
toml_edit = { workspace = true }
|
toml_edit = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub fn base_url_join_relative(base: &str, relative: &str) -> Result<Url, JoinRel
|
||||||
///
|
///
|
||||||
/// The error message includes the URL (`base` or `maybe_relative`) passed to
|
/// The error message includes the URL (`base` or `maybe_relative`) passed to
|
||||||
/// `base_url_join_relative` that provoked the error.
|
/// `base_url_join_relative` that provoked the error.
|
||||||
#[derive(Clone, Debug, thiserror::Error)]
|
#[derive(Clone, Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum JoinRelativeError {
|
pub enum JoinRelativeError {
|
||||||
#[error("Failed to parse URL: `{original}`")]
|
#[error("Failed to parse URL: `{original}`")]
|
||||||
ParseError {
|
ParseError {
|
||||||
|
|
|
@ -540,7 +540,7 @@ impl hashbrown::Equivalent<ConflictPackage> for ConflictPackageRef<'_> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error that occurs when the given conflicting set is invalid somehow.
|
/// An error that occurs when the given conflicting set is invalid somehow.
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum ConflictError {
|
pub enum ConflictError {
|
||||||
/// An error for when there are zero conflicting items.
|
/// An error for when there are zero conflicting items.
|
||||||
#[error("Each set of conflicts must have at least two entries, but found none")]
|
#[error("Each set of conflicts must have at least two entries, but found none")]
|
||||||
|
|
|
@ -12,7 +12,7 @@ use thiserror::Error;
|
||||||
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct Identifier(Box<str>);
|
pub struct Identifier(Box<str>);
|
||||||
|
|
||||||
#[derive(Debug, Clone, Error, traversable_error::TraversableError)]
|
#[derive(Debug, Clone, traversable_error::TraversableError, Error)]
|
||||||
pub enum IdentifierParseError {
|
pub enum IdentifierParseError {
|
||||||
#[error("An identifier must not be empty")]
|
#[error("An identifier must not be empty")]
|
||||||
Empty,
|
Empty,
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub use requires_txt::RequiresTxt;
|
||||||
/// <https://github.com/PyO3/python-pkginfo-rs/blob/d719988323a0cfea86d4737116d7917f30e819e2/src/error.rs>
|
/// <https://github.com/PyO3/python-pkginfo-rs/blob/d719988323a0cfea86d4737116d7917f30e819e2/src/error.rs>
|
||||||
///
|
///
|
||||||
/// The error type
|
/// The error type
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum MetadataError {
|
pub enum MetadataError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
MailParse(#[from] MailParseError),
|
MailParse(#[from] MailParseError),
|
||||||
|
|
|
@ -12,7 +12,7 @@ use uv_pep508::{
|
||||||
|
|
||||||
use crate::{ArchiveInfo, DirInfo, DirectUrl, VcsInfo, VcsKind};
|
use crate::{ArchiveInfo, DirInfo, DirectUrl, VcsInfo, VcsKind};
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum ParsedUrlError {
|
pub enum ParsedUrlError {
|
||||||
#[error("Unsupported URL prefix `{prefix}` in URL: `{url}` ({message})")]
|
#[error("Unsupported URL prefix `{prefix}` in URL: `{url}` ({message})")]
|
||||||
UnsupportedUrlPrefix {
|
UnsupportedUrlPrefix {
|
||||||
|
|
|
@ -570,7 +570,7 @@ impl IntoIterator for HashDigests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum HashError {
|
pub enum HashError {
|
||||||
#[error("Unexpected hash (expected `<algorithm>:<hash>`): {0}")]
|
#[error("Unexpected hash (expected `<algorithm>:<hash>`): {0}")]
|
||||||
InvalidStructure(String),
|
InvalidStructure(String),
|
||||||
|
|
|
@ -56,6 +56,7 @@ sys-info = { workspace = true }
|
||||||
target-lexicon = { workspace = true }
|
target-lexicon = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tokio-util = { workspace = true, features = ["compat"] }
|
tokio-util = { workspace = true, features = ["compat"] }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
|
|
|
@ -175,7 +175,7 @@ type FindPythonResult = Result<PythonInstallation, PythonNotFound>;
|
||||||
/// The result of failed Python installation discovery.
|
/// The result of failed Python installation discovery.
|
||||||
///
|
///
|
||||||
/// See [`FindPythonResult`].
|
/// See [`FindPythonResult`].
|
||||||
#[derive(Clone, Debug, Error, traversable_error::TraversableError)]
|
#[derive(Clone, Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct PythonNotFound {
|
pub struct PythonNotFound {
|
||||||
pub request: PythonRequest,
|
pub request: PythonRequest,
|
||||||
pub python_preference: PythonPreference,
|
pub python_preference: PythonPreference,
|
||||||
|
@ -209,7 +209,7 @@ pub enum PythonSource {
|
||||||
ParentInterpreter,
|
ParentInterpreter,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
|
|
@ -38,7 +38,7 @@ use crate::platform::{self, Arch, Libc, Os};
|
||||||
use crate::PythonVariant;
|
use crate::PythonVariant;
|
||||||
use crate::{Interpreter, PythonRequest, PythonVersion, VersionRequest};
|
use crate::{Interpreter, PythonRequest, PythonVersion, VersionRequest};
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
@ -1042,7 +1042,7 @@ impl Error {
|
||||||
pub(crate) fn from_reqwest_middleware(url: Url, err: reqwest_middleware::Error) -> Self {
|
pub(crate) fn from_reqwest_middleware(url: Url, err: reqwest_middleware::Error) -> Self {
|
||||||
match err {
|
match err {
|
||||||
reqwest_middleware::Error::Middleware(error) => {
|
reqwest_middleware::Error::Middleware(error) => {
|
||||||
Self::NetworkMiddlewareError(url, error)
|
Self::NetworkMiddlewareError(url, error.into())
|
||||||
}
|
}
|
||||||
reqwest_middleware::Error::Reqwest(error) => {
|
reqwest_middleware::Error::Reqwest(error) => {
|
||||||
Self::NetworkError(url, WrappedReqwestError::from(error))
|
Self::NetworkError(url, WrappedReqwestError::from(error))
|
||||||
|
|
|
@ -33,13 +33,13 @@ struct PythonEnvironmentShared {
|
||||||
/// The result of failed environment discovery.
|
/// The result of failed environment discovery.
|
||||||
///
|
///
|
||||||
/// Generally this is cast from [`PythonNotFound`] by [`PythonEnvironment::find`].
|
/// Generally this is cast from [`PythonNotFound`] by [`PythonEnvironment::find`].
|
||||||
#[derive(Clone, Debug, Error, traversable_error::TraversableError)]
|
#[derive(Clone, Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct EnvironmentNotFound {
|
pub struct EnvironmentNotFound {
|
||||||
request: PythonRequest,
|
request: PythonRequest,
|
||||||
preference: EnvironmentPreference,
|
preference: EnvironmentPreference,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Error, traversable_error::TraversableError)]
|
#[derive(Clone, Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct InvalidEnvironment {
|
pub struct InvalidEnvironment {
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
pub kind: InvalidEnvironmentKind,
|
pub kind: InvalidEnvironmentKind,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::{
|
||||||
};
|
};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Unknown Python implementation `{0}`")]
|
#[error("Unknown Python implementation `{0}`")]
|
||||||
UnknownImplementation(String),
|
UnknownImplementation(String),
|
||||||
|
|
|
@ -253,7 +253,7 @@ impl PythonInstallation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum PythonInstallationKeyError {
|
pub enum PythonInstallationKeyError {
|
||||||
#[error("Failed to parse Python installation key `{0}`: {1}")]
|
#[error("Failed to parse Python installation key `{0}`: {1}")]
|
||||||
ParseError(String, String),
|
ParseError(String, String),
|
||||||
|
|
|
@ -598,7 +598,7 @@ impl ExternallyManaged {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct UnexpectedResponseError {
|
pub struct UnexpectedResponseError {
|
||||||
#[source]
|
#[source]
|
||||||
pub(super) err: serde_json::Error,
|
pub(super) err: serde_json::Error,
|
||||||
|
@ -636,7 +636,7 @@ impl Display for UnexpectedResponseError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct StatusCodeError {
|
pub struct StatusCodeError {
|
||||||
pub(super) code: ExitStatus,
|
pub(super) code: ExitStatus,
|
||||||
pub(super) stdout: String,
|
pub(super) stdout: String,
|
||||||
|
@ -673,7 +673,7 @@ impl Display for StatusCodeError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Failed to query Python interpreter")]
|
#[error("Failed to query Python interpreter")]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
@ -701,7 +701,7 @@ pub enum Error {
|
||||||
Encode(#[from] rmp_serde::encode::Error),
|
Encode(#[from] rmp_serde::encode::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub struct BrokenSymlink {
|
pub struct BrokenSymlink {
|
||||||
pub path: PathBuf,
|
pub path: PathBuf,
|
||||||
/// Whether the interpreter path looks like a virtual environment.
|
/// Whether the interpreter path looks like a virtual environment.
|
||||||
|
@ -735,7 +735,7 @@ enum InterpreterInfoResult {
|
||||||
Success(Box<InterpreterInfo>),
|
Success(Box<InterpreterInfo>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError, Deserialize, Serialize)]
|
#[derive(Debug, traversable_error::TraversableError, Error, Deserialize, Serialize)]
|
||||||
#[serde(tag = "kind", rename_all = "snake_case")]
|
#[serde(tag = "kind", rename_all = "snake_case")]
|
||||||
pub enum InterpreterInfoError {
|
pub enum InterpreterInfoError {
|
||||||
#[error("Could not detect a glibc or a musl libc (while running on Linux)")]
|
#[error("Could not detect a glibc or a musl libc (while running on Linux)")]
|
||||||
|
|
|
@ -63,7 +63,7 @@ pub(crate) fn current_dir() -> Result<std::path::PathBuf, std::io::Error> {
|
||||||
.unwrap_or(std::env::current_dir())
|
.unwrap_or(std::env::current_dir())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -14,7 +14,7 @@ use thiserror::Error;
|
||||||
use tracing::trace;
|
use tracing::trace;
|
||||||
use uv_fs::Simplified;
|
use uv_fs::Simplified;
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum LibcDetectionError {
|
pub enum LibcDetectionError {
|
||||||
#[error("Could not detect either glibc version nor musl libc version, at least one of which is required")]
|
#[error("Could not detect either glibc version nor musl libc version, at least one of which is required")]
|
||||||
NoLibcFound,
|
NoLibcFound,
|
||||||
|
|
|
@ -31,7 +31,7 @@ pub fn patch_dylib_install_name(dylib: PathBuf) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -27,7 +27,7 @@ use crate::platform::{Arch, Libc, Os};
|
||||||
use crate::python_version::PythonVersion;
|
use crate::python_version::PythonVersion;
|
||||||
use crate::{macos_dylib, sysconfig, PythonRequest, PythonVariant};
|
use crate::{macos_dylib, sysconfig, PythonRequest, PythonVariant};
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::ops::Deref;
|
||||||
use std::{fmt, str::FromStr};
|
use std::{fmt, str::FromStr};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Error, traversable_error::TraversableError, Debug)]
|
#[derive(traversable_error::TraversableError, Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Unknown operating system: {0}")]
|
#[error("Unknown operating system: {0}")]
|
||||||
UnknownOs(String),
|
UnknownOs(String),
|
||||||
|
|
|
@ -381,7 +381,7 @@ fn patch_pkgconfig(contents: &str) -> Option<String> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] std::io::Error),
|
Io(#[from] std::io::Error),
|
||||||
|
|
|
@ -249,7 +249,7 @@ const fn is_python_whitespace(c: char) -> bool {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(traversable_error::TraversableError, thiserror::Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Missing opening brace")]
|
#[error("Missing opening brace")]
|
||||||
MissingOpenBrace,
|
MissingOpenBrace,
|
||||||
|
|
|
@ -48,7 +48,7 @@ pub struct PyVenvConfiguration {
|
||||||
pub(crate) version: Option<PythonVersion>,
|
pub(crate) version: Option<PythonVersion>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
|
|
|
@ -125,7 +125,7 @@ fn read_registry_entry(company: &str, tag: &str, tag_key: &Key) -> Option<Window
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error, traversable_error::TraversableError)]
|
#[derive(Debug, traversable_error::TraversableError, Error)]
|
||||||
pub enum ManagedPep514Error {
|
pub enum ManagedPep514Error {
|
||||||
#[error("Windows has an unknown pointer width for arch: `{_0}`")]
|
#[error("Windows has an unknown pointer width for arch: `{_0}`")]
|
||||||
InvalidPointerSize(Arch),
|
InvalidPointerSize(Arch),
|
||||||
|
|
|
@ -30,6 +30,7 @@ memchr = { workspace = true }
|
||||||
reqwest = { workspace = true, optional = true }
|
reqwest = { workspace = true, optional = true }
|
||||||
reqwest-middleware = { workspace = true, optional = true }
|
reqwest-middleware = { workspace = true, optional = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
traversable-error = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
unscanny = { workspace = true }
|
unscanny = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
|
@ -41,9 +41,9 @@ use std::path::{Path, PathBuf};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
|
use traversable_error::TraversableError;
|
||||||
use unscanny::{Pattern, Scanner};
|
use unscanny::{Pattern, Scanner};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[cfg(feature = "http")]
|
#[cfg(feature = "http")]
|
||||||
use uv_client::BaseClient;
|
use uv_client::BaseClient;
|
||||||
use uv_client::BaseClientBuilder;
|
use uv_client::BaseClientBuilder;
|
||||||
|
@ -206,10 +206,10 @@ impl RequirementsTxt {
|
||||||
.await
|
.await
|
||||||
.map_err(RequirementsTxtParserError::Io)
|
.map_err(RequirementsTxtParserError::Io)
|
||||||
}
|
}
|
||||||
.map_err(|err| RequirementsTxtFileError {
|
.map_err(|err| RequirementsTxtFileError {
|
||||||
file: requirements_txt.to_path_buf(),
|
file: requirements_txt.to_path_buf(),
|
||||||
error: err,
|
error: err,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let requirements_dir = requirements_txt.parent().unwrap_or(working_dir);
|
let requirements_dir = requirements_txt.parent().unwrap_or(working_dir);
|
||||||
let data = Self::parse_inner(
|
let data = Self::parse_inner(
|
||||||
|
@ -960,7 +960,7 @@ async fn read_url_to_string(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Error parsing requirements.txt, wrapper with filename
|
/// Error parsing requirements.txt, wrapper with filename
|
||||||
#[derive(Debug)]
|
#[derive(Debug, TraversableError)]
|
||||||
pub struct RequirementsTxtFileError {
|
pub struct RequirementsTxtFileError {
|
||||||
file: PathBuf,
|
file: PathBuf,
|
||||||
error: RequirementsTxtParserError,
|
error: RequirementsTxtParserError,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use uv_pep508::{
|
||||||
};
|
};
|
||||||
use uv_pypi_types::{ParsedDirectoryUrl, ParsedUrl, VerbatimParsedUrl};
|
use uv_pypi_types::{ParsedDirectoryUrl, ParsedUrl, VerbatimParsedUrl};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, traversable_error::TraversableError, thiserror::Error)]
|
||||||
pub enum EditableError {
|
pub enum EditableError {
|
||||||
#[error("Editable `{0}` must refer to a local directory")]
|
#[error("Editable `{0}` must refer to a local directory")]
|
||||||
MissingVersion(PackageName),
|
MissingVersion(PackageName),
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue