Skip to content

Commit a66e53d

Browse files
committed
Add support for pip list --outdated
1 parent 273f453 commit a66e53d

9 files changed

Lines changed: 417 additions & 28 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/uv-cli/src/compat.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,19 @@ impl CompatArgs for PipCompileCompatArgs {
167167
pub struct PipListCompatArgs {
168168
#[clap(long, hide = true)]
169169
disable_pip_version_check: bool,
170-
171-
#[clap(long, hide = true)]
172-
outdated: bool,
173170
}
174171

175172
impl CompatArgs for PipListCompatArgs {
176173
/// Validate the arguments passed for `pip list` compatibility.
177174
///
178175
/// This method will warn when an argument is passed that has no effect but matches uv's
179176
/// behavior. If an argument is passed that does _not_ match uv's behavior (e.g.,
180-
/// `--outdated`), this method will return an error.
177+
/// `--disable-pip-version-check`), this method will return an error.
181178
fn validate(&self) -> Result<()> {
182179
if self.disable_pip_version_check {
183180
warn_user!("pip's `--disable-pip-version-check` has no effect");
184181
}
185182

186-
if self.outdated {
187-
return Err(anyhow!("pip's `--outdated` is unsupported"));
188-
}
189-
190183
Ok(())
191184
}
192185
}

crates/uv-cli/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,16 @@ pub struct PipListArgs {
19071907
#[arg(long, value_enum, default_value_t = ListFormat::default())]
19081908
pub format: ListFormat,
19091909

1910+
/// List outdated packages.
1911+
///
1912+
/// The latest version of each package will be shown alongside the installed version. Up-to-date
1913+
/// packages will be omitted from the output.
1914+
#[arg(long, overrides_with("no_outdated"))]
1915+
pub outdated: bool,
1916+
1917+
#[arg(long, overrides_with("outdated"), hide = true)]
1918+
pub no_outdated: bool,
1919+
19101920
/// Validate the Python environment, to detect packages with missing dependencies and other
19111921
/// issues.
19121922
#[arg(long, overrides_with("no_strict"))]

crates/uv/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ petgraph = { workspace = true }
7979
rayon = { workspace = true }
8080
regex = { workspace = true }
8181
reqwest = { workspace = true }
82+
rkyv = { workspace = true }
8283
rustc-hash = { workspace = true }
8384
serde = { workspace = true }
8485
serde_json = { workspace = true }

0 commit comments

Comments
 (0)