mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 20:31:12 +00:00
Use relative paths for user display (#2559)
## Summary
This PR changes our user-facing representation for paths to use relative
paths, when the path is within the current working directory. This
mirrors what we do in Ruff. (If the path is _outside_ the current
working directory, we print an absolute path.)
Before:
```shell
❯ uv venv .venv2
Using Python 3.12.2 interpreter at: /Users/crmarsh/workspace/uv/.venv/bin/python3
Creating virtualenv at: .venv2
Activate with: source .venv2/bin/activate
```
After:
```shell
❯ cargo run venv .venv2
Finished dev [unoptimized + debuginfo] target(s) in 0.15s
Running `target/debug/uv venv .venv2`
Using Python 3.12.2 interpreter at: .venv/bin/python3
Creating virtualenv at: .venv2
Activate with: source .venv2/bin/activate
```
Note that we still want to use the existing `.simplified_display()`
anywhere that the path is being simplified, but _still_ intended for
machine consumption (e.g., when passing to `.current_dir()`).
This commit is contained in:
parent
204b159cf4
commit
00fc44012c
30 changed files with 149 additions and 183 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -4657,6 +4657,7 @@ dependencies = [
|
||||||
"fs-err",
|
"fs-err",
|
||||||
"fs2",
|
"fs2",
|
||||||
"junction",
|
"junction",
|
||||||
|
"once_cell",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
|
|
||||||
|
|
@ -114,12 +114,8 @@ impl InstalledDist {
|
||||||
pub fn metadata(&self) -> Result<pypi_types::Metadata23> {
|
pub fn metadata(&self) -> Result<pypi_types::Metadata23> {
|
||||||
let path = self.path().join("METADATA");
|
let path = self.path().join("METADATA");
|
||||||
let contents = fs::read(&path)?;
|
let contents = fs::read(&path)?;
|
||||||
pypi_types::Metadata23::parse_metadata(&contents).with_context(|| {
|
pypi_types::Metadata23::parse_metadata(&contents)
|
||||||
format!(
|
.with_context(|| format!("Failed to parse METADATA file at: {}", path.user_display()))
|
||||||
"Failed to parse METADATA file at: {}",
|
|
||||||
path.simplified_display()
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the `INSTALLER` of the distribution.
|
/// Return the `INSTALLER` of the distribution.
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ pub enum Error {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Io(#[from] io::Error),
|
Io(#[from] io::Error),
|
||||||
/// Custom error type to add a path to error reading a file from a zip
|
/// Custom error type to add a path to error reading a file from a zip
|
||||||
#[error("Failed to reflink {} to {}", from.simplified_display(), to.simplified_display())]
|
#[error("Failed to reflink {} to {}", from.user_display(), to.user_display())]
|
||||||
Reflink {
|
Reflink {
|
||||||
from: PathBuf,
|
from: PathBuf,
|
||||||
to: PathBuf,
|
to: PathBuf,
|
||||||
|
|
@ -82,7 +82,7 @@ pub enum Error {
|
||||||
DirectUrlJson(#[from] serde_json::Error),
|
DirectUrlJson(#[from] serde_json::Error),
|
||||||
#[error("No .dist-info directory found")]
|
#[error("No .dist-info directory found")]
|
||||||
MissingDistInfo,
|
MissingDistInfo,
|
||||||
#[error("Cannot uninstall package; RECORD file not found at: {}", _0.simplified_display())]
|
#[error("Cannot uninstall package; RECORD file not found at: {}", _0.user_display())]
|
||||||
MissingRecord(PathBuf),
|
MissingRecord(PathBuf),
|
||||||
#[error("Multiple .dist-info directories found: {0}")]
|
#[error("Multiple .dist-info directories found: {0}")]
|
||||||
MultipleDistInfo(String),
|
MultipleDistInfo(String),
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ pub(crate) fn windows_script_launcher(
|
||||||
}
|
}
|
||||||
|
|
||||||
let python = python_executable.as_ref();
|
let python = python_executable.as_ref();
|
||||||
let python_path = python.simplified().to_string_lossy();
|
let python_path = python.simplified_display().to_string();
|
||||||
|
|
||||||
let mut launcher: Vec<u8> = Vec::with_capacity(launcher_bin.len() + payload.len());
|
let mut launcher: Vec<u8> = Vec::with_capacity(launcher_bin.len() + payload.len());
|
||||||
launcher.extend_from_slice(launcher_bin);
|
launcher.extend_from_slice(launcher_bin);
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,7 @@ impl RequirementsTxt {
|
||||||
if data == Self::default() {
|
if data == Self::default() {
|
||||||
warn_user!(
|
warn_user!(
|
||||||
"Requirements file {} does not contain any dependencies",
|
"Requirements file {} does not contain any dependencies",
|
||||||
requirements_txt.simplified_display()
|
requirements_txt.user_display()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1024,35 +1024,35 @@ impl Display for RequirementsTxtFileError {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Invalid URL in `{}` at position {start}: `{url}`",
|
"Invalid URL in `{}` at position {start}: `{url}`",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::InvalidEditablePath(given) => {
|
RequirementsTxtParserError::InvalidEditablePath(given) => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Invalid editable path in `{}`: {given}",
|
"Invalid editable path in `{}`: {given}",
|
||||||
self.file.simplified_display()
|
self.file.user_display()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::UnsupportedUrl(url) => {
|
RequirementsTxtParserError::UnsupportedUrl(url) => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Unsupported URL (expected a `file://` scheme) in `{}`: `{url}`",
|
"Unsupported URL (expected a `file://` scheme) in `{}`: `{url}`",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::MissingRequirementPrefix(given) => {
|
RequirementsTxtParserError::MissingRequirementPrefix(given) => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Requirement `{given}` in `{}` looks like a requirements file but was passed as a package name. Did you mean `-r {given}`?",
|
"Requirement `{given}` in `{}` looks like a requirements file but was passed as a package name. Did you mean `-r {given}`?",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::MissingEditablePrefix(given) => {
|
RequirementsTxtParserError::MissingEditablePrefix(given) => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Requirement `{given}` in `{}` looks like a directory but was passed as a package name. Did you mean `-e {given}`?",
|
"Requirement `{given}` in `{}` looks like a directory but was passed as a package name. Did you mean `-e {given}`?",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::Parser {
|
RequirementsTxtParserError::Parser {
|
||||||
|
|
@ -1063,28 +1063,28 @@ impl Display for RequirementsTxtFileError {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"{message} at {}:{line}:{column}",
|
"{message} at {}:{line}:{column}",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::UnsupportedRequirement { start, .. } => {
|
RequirementsTxtParserError::UnsupportedRequirement { start, .. } => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Unsupported requirement in {} at position {start}",
|
"Unsupported requirement in {} at position {start}",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::Pep508 { start, .. } => {
|
RequirementsTxtParserError::Pep508 { start, .. } => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Couldn't parse requirement in `{}` at position {start}",
|
"Couldn't parse requirement in `{}` at position {start}",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::Subfile { start, .. } => {
|
RequirementsTxtParserError::Subfile { start, .. } => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Error parsing included file in `{}` at position {start}",
|
"Error parsing included file in `{}` at position {start}",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RequirementsTxtParserError::NonUnicodeUrl { url } => {
|
RequirementsTxtParserError::NonUnicodeUrl { url } => {
|
||||||
|
|
@ -1099,7 +1099,7 @@ impl Display for RequirementsTxtFileError {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"Error while accessing remote requirements file {}: {err}",
|
"Error while accessing remote requirements file {}: {err}",
|
||||||
self.file.simplified_display(),
|
self.file.user_display(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1276,9 +1276,8 @@ mod test {
|
||||||
.take(2)
|
.take(2)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
let missing_txt = regex::escape(&missing_txt.path().user_display().to_string());
|
||||||
let missing_txt = regex::escape(&missing_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(missing_txt.as_str(), "<MISSING_TXT>"),
|
(missing_txt.as_str(), "<MISSING_TXT>"),
|
||||||
|
|
@ -1313,8 +1312,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
@ -1350,8 +1348,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
@ -1387,8 +1384,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
@ -1419,8 +1415,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![(requirement_txt.as_str(), "<REQUIREMENTS_TXT>")];
|
let filters = vec![(requirement_txt.as_str(), "<REQUIREMENTS_TXT>")];
|
||||||
insta::with_settings!({
|
insta::with_settings!({
|
||||||
filters => filters
|
filters => filters
|
||||||
|
|
@ -1453,8 +1448,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
@ -1488,8 +1482,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
@ -1528,8 +1521,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
@ -1692,8 +1684,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
@ -1746,8 +1737,7 @@ mod test {
|
||||||
.unwrap_err();
|
.unwrap_err();
|
||||||
let errors = anyhow::Error::new(error).chain().join("\n");
|
let errors = anyhow::Error::new(error).chain().join("\n");
|
||||||
|
|
||||||
let requirement_txt =
|
let requirement_txt = regex::escape(&requirements_txt.path().user_display().to_string());
|
||||||
regex::escape(&requirements_txt.path().simplified_display().to_string());
|
|
||||||
let filters = vec![
|
let filters = vec![
|
||||||
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
|
||||||
(r"\\", "/"),
|
(r"\\", "/"),
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ encoding_rs_io = { workspace = true }
|
||||||
fs-err = { workspace = true }
|
fs-err = { workspace = true }
|
||||||
fs2 = { workspace = true }
|
fs2 = { workspace = true }
|
||||||
junction = { workspace = true }
|
junction = { workspace = true }
|
||||||
|
once_cell = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
tokio = { workspace = true, optional = true }
|
tokio = { workspace = true, optional = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ pub async fn write_atomic(path: impl AsRef<Path>, data: impl AsRef<[u8]>) -> std
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!(
|
format!(
|
||||||
"Failed to persist temporary file to {}: {}",
|
"Failed to persist temporary file to {}: {}",
|
||||||
path.simplified_display(),
|
path.user_display(),
|
||||||
err.error
|
err.error
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -135,7 +135,7 @@ pub fn write_atomic_sync(path: impl AsRef<Path>, data: impl AsRef<[u8]>) -> std:
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!(
|
format!(
|
||||||
"Failed to persist temporary file to {}: {}",
|
"Failed to persist temporary file to {}: {}",
|
||||||
path.simplified_display(),
|
path.user_display(),
|
||||||
err.error
|
err.error
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -288,7 +288,7 @@ impl LockedFile {
|
||||||
warn_user!(
|
warn_user!(
|
||||||
"Waiting to acquire lock for {} (lockfile: {})",
|
"Waiting to acquire lock for {} (lockfile: {})",
|
||||||
resource,
|
resource,
|
||||||
path.simplified_display(),
|
path.user_display(),
|
||||||
);
|
);
|
||||||
file.file().lock_exclusive()?;
|
file.file().lock_exclusive()?;
|
||||||
Ok(Self(file))
|
Ok(Self(file))
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,26 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::path::{Component, Path, PathBuf};
|
use std::path::{Component, Path, PathBuf};
|
||||||
|
|
||||||
|
use once_cell::sync::Lazy;
|
||||||
|
|
||||||
|
pub static CWD: Lazy<PathBuf> = Lazy::new(|| std::env::current_dir().unwrap());
|
||||||
|
|
||||||
pub trait Simplified {
|
pub trait Simplified {
|
||||||
/// Simplify a [`Path`].
|
/// Simplify a [`Path`].
|
||||||
///
|
///
|
||||||
/// On Windows, this will strip the `\\?\` prefix from paths. On other platforms, it's a no-op.
|
/// On Windows, this will strip the `\\?\` prefix from paths. On other platforms, it's a no-op.
|
||||||
fn simplified(&self) -> &Path;
|
fn simplified(&self) -> &Path;
|
||||||
|
|
||||||
/// Render a [`Path`] for user-facing display.
|
/// Render a [`Path`] for display.
|
||||||
///
|
///
|
||||||
/// On Windows, this will strip the `\\?\` prefix from paths. On other platforms, it's
|
/// On Windows, this will strip the `\\?\` prefix from paths. On other platforms, it's
|
||||||
/// equivalent to [`std::path::Display`].
|
/// equivalent to [`std::path::Display`].
|
||||||
fn simplified_display(&self) -> std::path::Display;
|
fn simplified_display(&self) -> std::path::Display;
|
||||||
|
|
||||||
|
/// Render a [`Path`] for user-facing display.
|
||||||
|
///
|
||||||
|
/// Like [`simplified_display`], but relativizes the path against the current working directory.
|
||||||
|
fn user_display(&self) -> std::path::Display;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsRef<Path>> Simplified for T {
|
impl<T: AsRef<Path>> Simplified for T {
|
||||||
|
|
@ -22,6 +31,11 @@ impl<T: AsRef<Path>> Simplified for T {
|
||||||
fn simplified_display(&self) -> std::path::Display {
|
fn simplified_display(&self) -> std::path::Display {
|
||||||
dunce::simplified(self.as_ref()).display()
|
dunce::simplified(self.as_ref()).display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn user_display(&self) -> std::path::Display {
|
||||||
|
let path = dunce::simplified(self.as_ref());
|
||||||
|
path.strip_prefix(&*CWD).unwrap_or(path).display()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait PythonExt {
|
pub trait PythonExt {
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ impl GitRemote {
|
||||||
let reference = locked_ref.as_ref().unwrap_or(reference);
|
let reference = locked_ref.as_ref().unwrap_or(reference);
|
||||||
if let Some(mut db) = db {
|
if let Some(mut db) = db {
|
||||||
fetch(&mut db.repo, self.url.as_str(), reference, strategy, client)
|
fetch(&mut db.repo, self.url.as_str(), reference, strategy, client)
|
||||||
.with_context(|| format!("failed to fetch into: {}", into.simplified_display()))?;
|
.with_context(|| format!("failed to fetch into: {}", into.user_display()))?;
|
||||||
|
|
||||||
let resolved_commit_hash = match locked_rev {
|
let resolved_commit_hash = match locked_rev {
|
||||||
Some(rev) => db.contains(rev).then_some(rev),
|
Some(rev) => db.contains(rev).then_some(rev),
|
||||||
|
|
@ -190,7 +190,7 @@ impl GitRemote {
|
||||||
paths::create_dir_all(into)?;
|
paths::create_dir_all(into)?;
|
||||||
let mut repo = init(into, true)?;
|
let mut repo = init(into, true)?;
|
||||||
fetch(&mut repo, self.url.as_str(), reference, strategy, client)
|
fetch(&mut repo, self.url.as_str(), reference, strategy, client)
|
||||||
.with_context(|| format!("failed to clone into: {}", into.simplified_display()))?;
|
.with_context(|| format!("failed to clone into: {}", into.user_display()))?;
|
||||||
let rev = match locked_rev {
|
let rev = match locked_rev {
|
||||||
Some(rev) => rev,
|
Some(rev) => rev,
|
||||||
None => reference.resolve(&repo)?,
|
None => reference.resolve(&repo)?,
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ async fn worker(
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
debug!(
|
debug!(
|
||||||
"Bytecode compilation `python` at {} stderr:\n{}\n---",
|
"Bytecode compilation `python` at {} stderr:\n{}\n---",
|
||||||
interpreter.simplified_display(),
|
interpreter.user_display(),
|
||||||
stderr
|
stderr
|
||||||
);
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ impl<'a> Planner<'a> {
|
||||||
if !wheel.filename.is_compatible(tags) {
|
if !wheel.filename.is_compatible(tags) {
|
||||||
bail!(
|
bail!(
|
||||||
"A path dependency is incompatible with the current platform: {}",
|
"A path dependency is incompatible with the current platform: {}",
|
||||||
wheel.path.simplified_display()
|
wheel.path.user_display()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -485,20 +485,20 @@ impl InterpreterInfo {
|
||||||
debug!(
|
debug!(
|
||||||
"Cached interpreter info for Python {}, skipping probing: {}",
|
"Cached interpreter info for Python {}, skipping probing: {}",
|
||||||
cached.data.markers.python_full_version,
|
cached.data.markers.python_full_version,
|
||||||
executable.simplified_display()
|
executable.user_display()
|
||||||
);
|
);
|
||||||
return Ok(cached.data);
|
return Ok(cached.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"Ignoring stale cached markers for: {}",
|
"Ignoring stale cached markers for: {}",
|
||||||
executable.simplified_display()
|
executable.user_display()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
warn!(
|
warn!(
|
||||||
"Broken cache entry at {}, removing: {err}",
|
"Broken cache entry at {}, removing: {err}",
|
||||||
cache_entry.path().simplified_display()
|
cache_entry.path().user_display()
|
||||||
);
|
);
|
||||||
let _ = fs_err::remove_file(cache_entry.path());
|
let _ = fs_err::remove_file(cache_entry.path());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ pub fn create_bare_venv(
|
||||||
if metadata.is_file() {
|
if metadata.is_file() {
|
||||||
return Err(Error::IO(io::Error::new(
|
return Err(Error::IO(io::Error::new(
|
||||||
io::ErrorKind::AlreadyExists,
|
io::ErrorKind::AlreadyExists,
|
||||||
format!("File exists at `{}`", location.simplified_display()),
|
format!("File exists at `{}`", location.user_display()),
|
||||||
)));
|
)));
|
||||||
} else if metadata.is_dir() {
|
} else if metadata.is_dir() {
|
||||||
if location.join("pyvenv.cfg").is_file() {
|
if location.join("pyvenv.cfg").is_file() {
|
||||||
|
|
@ -103,7 +103,7 @@ pub fn create_bare_venv(
|
||||||
io::ErrorKind::AlreadyExists,
|
io::ErrorKind::AlreadyExists,
|
||||||
format!(
|
format!(
|
||||||
"The directory `{}` exists, but it's not a virtualenv",
|
"The directory `{}` exists, but it's not a virtualenv",
|
||||||
location.simplified_display()
|
location.user_display()
|
||||||
),
|
),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ pub(crate) fn cache_clean(
|
||||||
writeln!(
|
writeln!(
|
||||||
printer.stderr(),
|
printer.stderr(),
|
||||||
"No cache found at: {}",
|
"No cache found at: {}",
|
||||||
cache.root().simplified_display().cyan()
|
cache.root().user_display().cyan()
|
||||||
)?;
|
)?;
|
||||||
return Ok(ExitStatus::Success);
|
return Ok(ExitStatus::Success);
|
||||||
}
|
}
|
||||||
|
|
@ -29,14 +29,11 @@ pub(crate) fn cache_clean(
|
||||||
writeln!(
|
writeln!(
|
||||||
printer.stderr(),
|
printer.stderr(),
|
||||||
"Clearing cache at: {}",
|
"Clearing cache at: {}",
|
||||||
cache.root().simplified_display().cyan()
|
cache.root().user_display().cyan()
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let summary = cache.clear().with_context(|| {
|
let summary = cache.clear().with_context(|| {
|
||||||
format!(
|
format!("Failed to clear cache at: {}", cache.root().user_display())
|
||||||
"Failed to clear cache at: {}",
|
|
||||||
cache.root().simplified_display()
|
|
||||||
)
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
// Write a summary of the number of files and directories removed.
|
// Write a summary of the number of files and directories removed.
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@ use uv_fs::Simplified;
|
||||||
|
|
||||||
/// Show the cache directory.
|
/// Show the cache directory.
|
||||||
pub(crate) fn cache_dir(cache: &Cache) {
|
pub(crate) fn cache_dir(cache: &Cache) {
|
||||||
anstream::println!("{}", cache.root().simplified_display().cyan());
|
anstream::println!("{}", cache.root().user_display().cyan());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ pub(super) async fn compile_bytecode(
|
||||||
.with_context(|| {
|
.with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
"Failed to bytecode-compile Python file in: {}",
|
"Failed to bytecode-compile Python file in: {}",
|
||||||
site_packages.simplified_display()
|
site_packages.user_display()
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ pub(crate) fn pip_check(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} environment at {}",
|
"Using Python {} environment at {}",
|
||||||
venv.interpreter().python_version(),
|
venv.interpreter().python_version(),
|
||||||
venv.python_executable().simplified_display().cyan()
|
venv.python_executable().user_display().cyan()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Build the installed index.
|
// Build the installed index.
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ pub(crate) async fn pip_compile(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} interpreter at {} for builds",
|
"Using Python {} interpreter at {} for builds",
|
||||||
interpreter.python_version(),
|
interpreter.python_version(),
|
||||||
interpreter.sys_executable().simplified_display().cyan()
|
interpreter.sys_executable().user_display().cyan()
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(python_version) = python_version.as_ref() {
|
if let Some(python_version) = python_version.as_ref() {
|
||||||
|
|
@ -456,7 +456,7 @@ fn cmd(
|
||||||
}
|
}
|
||||||
let args = env::args_os()
|
let args = env::args_os()
|
||||||
.skip(1)
|
.skip(1)
|
||||||
.map(|arg| arg.simplified_display().to_string())
|
.map(|arg| arg.user_display().to_string())
|
||||||
.scan(None, move |skip_next, arg| {
|
.scan(None, move |skip_next, arg| {
|
||||||
if matches!(skip_next, Some(true)) {
|
if matches!(skip_next, Some(true)) {
|
||||||
// Reset state; skip this iteration.
|
// Reset state; skip this iteration.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ pub(crate) fn pip_freeze(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} environment at {}",
|
"Using Python {} environment at {}",
|
||||||
venv.interpreter().python_version(),
|
venv.interpreter().python_version(),
|
||||||
venv.python_executable().simplified_display().cyan()
|
venv.python_executable().user_display().cyan()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Build the installed index.
|
// Build the installed index.
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ pub(crate) async fn pip_install(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} environment at {}",
|
"Using Python {} environment at {}",
|
||||||
venv.interpreter().python_version(),
|
venv.interpreter().python_version(),
|
||||||
venv.python_executable().simplified_display().cyan()
|
venv.python_executable().user_display().cyan()
|
||||||
);
|
);
|
||||||
|
|
||||||
// If the environment is externally managed, abort.
|
// If the environment is externally managed, abort.
|
||||||
|
|
@ -131,13 +131,13 @@ pub(crate) async fn pip_install(
|
||||||
return if let Some(error) = externally_managed.into_error() {
|
return if let Some(error) = externally_managed.into_error() {
|
||||||
Err(anyhow::anyhow!(
|
Err(anyhow::anyhow!(
|
||||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
||||||
venv.root().simplified_display().cyan(),
|
venv.root().user_display().cyan(),
|
||||||
textwrap::indent(&error, " ").green(),
|
textwrap::indent(&error, " ").green(),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow::anyhow!(
|
Err(anyhow::anyhow!(
|
||||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
||||||
venv.root().simplified_display().cyan()
|
venv.root().user_display().cyan()
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -688,7 +688,7 @@ async fn install(
|
||||||
)) => {
|
)) => {
|
||||||
warn_user!(
|
warn_user!(
|
||||||
"Failed to uninstall package at {} due to missing RECORD file. Installation may result in an incomplete environment.",
|
"Failed to uninstall package at {} due to missing RECORD file. Installation may result in an incomplete environment.",
|
||||||
dist_info.path().simplified_display().cyan(),
|
dist_info.path().user_display().cyan(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Err(err) => return Err(err.into()),
|
Err(err) => return Err(err.into()),
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ pub(crate) fn pip_list(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} environment at {}",
|
"Using Python {} environment at {}",
|
||||||
venv.interpreter().python_version(),
|
venv.interpreter().python_version(),
|
||||||
venv.python_executable().simplified_display().cyan()
|
venv.python_executable().user_display().cyan()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Build the installed index.
|
// Build the installed index.
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ pub(crate) fn pip_show(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} environment at {}",
|
"Using Python {} environment at {}",
|
||||||
venv.interpreter().python_version(),
|
venv.interpreter().python_version(),
|
||||||
venv.python_executable().simplified_display().cyan()
|
venv.python_executable().user_display().cyan()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Build the installed index.
|
// Build the installed index.
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ pub(crate) async fn pip_sync(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} environment at {}",
|
"Using Python {} environment at {}",
|
||||||
venv.interpreter().python_version(),
|
venv.interpreter().python_version(),
|
||||||
venv.python_executable().simplified_display().cyan()
|
venv.python_executable().user_display().cyan()
|
||||||
);
|
);
|
||||||
|
|
||||||
// If the environment is externally managed, abort.
|
// If the environment is externally managed, abort.
|
||||||
|
|
@ -95,13 +95,13 @@ pub(crate) async fn pip_sync(
|
||||||
return if let Some(error) = externally_managed.into_error() {
|
return if let Some(error) = externally_managed.into_error() {
|
||||||
Err(anyhow::anyhow!(
|
Err(anyhow::anyhow!(
|
||||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
||||||
venv.root().simplified_display().cyan(),
|
venv.root().user_display().cyan(),
|
||||||
textwrap::indent(&error, " ").green(),
|
textwrap::indent(&error, " ").green(),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow::anyhow!(
|
Err(anyhow::anyhow!(
|
||||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
||||||
venv.root().simplified_display().cyan()
|
venv.root().user_display().cyan()
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -303,7 +303,7 @@ pub(crate) async fn pip_sync(
|
||||||
)) => {
|
)) => {
|
||||||
warn_user!(
|
warn_user!(
|
||||||
"Failed to uninstall package at {} due to missing RECORD file. Installation may result in an incomplete environment.",
|
"Failed to uninstall package at {} due to missing RECORD file. Installation may result in an incomplete environment.",
|
||||||
dist_info.path().simplified_display().cyan(),
|
dist_info.path().user_display().cyan(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Err(err) => return Err(err.into()),
|
Err(err) => return Err(err.into()),
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ pub(crate) async fn pip_uninstall(
|
||||||
debug!(
|
debug!(
|
||||||
"Using Python {} environment at {}",
|
"Using Python {} environment at {}",
|
||||||
venv.interpreter().python_version(),
|
venv.interpreter().python_version(),
|
||||||
venv.python_executable().simplified_display().cyan(),
|
venv.python_executable().user_display().cyan(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// If the environment is externally managed, abort.
|
// If the environment is externally managed, abort.
|
||||||
|
|
@ -62,13 +62,13 @@ pub(crate) async fn pip_uninstall(
|
||||||
return if let Some(error) = externally_managed.into_error() {
|
return if let Some(error) = externally_managed.into_error() {
|
||||||
Err(anyhow::anyhow!(
|
Err(anyhow::anyhow!(
|
||||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
||||||
venv.root().simplified_display().cyan(),
|
venv.root().user_display().cyan(),
|
||||||
textwrap::indent(&error, " ").green(),
|
textwrap::indent(&error, " ").green(),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow::anyhow!(
|
Err(anyhow::anyhow!(
|
||||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
||||||
venv.root().simplified_display().cyan()
|
venv.root().user_display().cyan()
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,14 +116,14 @@ async fn venv_impl(
|
||||||
printer.stderr(),
|
printer.stderr(),
|
||||||
"Using Python {} interpreter at: {}",
|
"Using Python {} interpreter at: {}",
|
||||||
interpreter.python_version(),
|
interpreter.python_version(),
|
||||||
interpreter.sys_executable().simplified_display().cyan()
|
interpreter.sys_executable().user_display().cyan()
|
||||||
)
|
)
|
||||||
.into_diagnostic()?;
|
.into_diagnostic()?;
|
||||||
|
|
||||||
writeln!(
|
writeln!(
|
||||||
printer.stderr(),
|
printer.stderr(),
|
||||||
"Creating virtualenv at: {}",
|
"Creating virtualenv at: {}",
|
||||||
path.simplified_display().cyan()
|
path.user_display().cyan()
|
||||||
)
|
)
|
||||||
.into_diagnostic()?;
|
.into_diagnostic()?;
|
||||||
|
|
||||||
|
|
@ -264,7 +264,7 @@ async fn venv_impl(
|
||||||
/// Quote a path, if necessary, for safe use in a POSIX-compatible shell command.
|
/// Quote a path, if necessary, for safe use in a POSIX-compatible shell command.
|
||||||
fn shlex_posix(executable: impl AsRef<Path>) -> String {
|
fn shlex_posix(executable: impl AsRef<Path>) -> String {
|
||||||
// Convert to a display path.
|
// Convert to a display path.
|
||||||
let executable = executable.as_ref().simplified_display().to_string();
|
let executable = executable.as_ref().user_display().to_string();
|
||||||
|
|
||||||
// Like Python's `shlex.quote`:
|
// Like Python's `shlex.quote`:
|
||||||
// > Use single quotes, and put single quotes into double quotes
|
// > Use single quotes, and put single quotes into double quotes
|
||||||
|
|
@ -279,7 +279,7 @@ fn shlex_posix(executable: impl AsRef<Path>) -> String {
|
||||||
/// Quote a path, if necessary, for safe use in `PowerShell` and `cmd`.
|
/// Quote a path, if necessary, for safe use in `PowerShell` and `cmd`.
|
||||||
fn shlex_windows(executable: impl AsRef<Path>, shell: Shell) -> String {
|
fn shlex_windows(executable: impl AsRef<Path>, shell: Shell) -> String {
|
||||||
// Convert to a display path.
|
// Convert to a display path.
|
||||||
let executable = executable.as_ref().simplified_display().to_string();
|
let executable = executable.as_ref().user_display().to_string();
|
||||||
|
|
||||||
// Wrap the executable in quotes (and a `&` invocation on PowerShell), if it contains spaces.
|
// Wrap the executable in quotes (and a `&` invocation on PowerShell), if it contains spaces.
|
||||||
if executable.contains(' ') {
|
if executable.contains(' ') {
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ impl RequirementsSpecification {
|
||||||
RequirementsSource::PyprojectToml(path) => {
|
RequirementsSource::PyprojectToml(path) => {
|
||||||
let contents = uv_fs::read_to_string(path).await?;
|
let contents = uv_fs::read_to_string(path).await?;
|
||||||
let pyproject_toml = toml::from_str::<pyproject_toml::PyProjectToml>(&contents)
|
let pyproject_toml = toml::from_str::<pyproject_toml::PyProjectToml>(&contents)
|
||||||
.with_context(|| format!("Failed to parse `{}`", path.simplified_display()))?;
|
.with_context(|| format!("Failed to parse `{}`", path.user_display()))?;
|
||||||
let mut used_extras = FxHashSet::default();
|
let mut used_extras = FxHashSet::default();
|
||||||
let mut requirements = Vec::new();
|
let mut requirements = Vec::new();
|
||||||
let mut project_name = None;
|
let mut project_name = None;
|
||||||
|
|
@ -222,7 +222,7 @@ impl RequirementsSpecification {
|
||||||
// Parse the project name.
|
// Parse the project name.
|
||||||
let parsed_project_name =
|
let parsed_project_name =
|
||||||
PackageName::new(project.name).with_context(|| {
|
PackageName::new(project.name).with_context(|| {
|
||||||
format!("Invalid `project.name` in {}", path.simplified_display())
|
format!("Invalid `project.name` in {}", path.user_display())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
// Include the default dependencies.
|
// Include the default dependencies.
|
||||||
|
|
@ -258,7 +258,7 @@ impl RequirementsSpecification {
|
||||||
.any(|v| v.name.as_dist_info_name().starts_with("poetry"))
|
.any(|v| v.name.as_dist_info_name().starts_with("poetry"))
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
warn_user!("`{}` does not contain any dependencies (hint: specify dependencies in the `project.dependencies` section; `tool.poetry.dependencies` is not currently supported)", path.simplified_display());
|
warn_user!("`{}` does not contain any dependencies (hint: specify dependencies in the `project.dependencies` section; `tool.poetry.dependencies` is not currently supported)", path.user_display());
|
||||||
}
|
}
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
|
||||||
|
|
@ -2019,7 +2019,7 @@ fn compile_wheel_path_dependency() -> Result<()> {
|
||||||
requirements_in.write_str(&format!("flask @ {}", flask_wheel.path().display()))?;
|
requirements_in.write_str(&format!("flask @ {}", flask_wheel.path().display()))?;
|
||||||
|
|
||||||
// In addition to the standard filters, remove the temporary directory from the snapshot.
|
// In addition to the standard filters, remove the temporary directory from the snapshot.
|
||||||
let filter_path = regex::escape(&flask_wheel.simplified_display().to_string());
|
let filter_path = regex::escape(&flask_wheel.user_display().to_string());
|
||||||
let filters: Vec<_> = [(filter_path.as_str(), "/[TEMP_DIR]/")]
|
let filters: Vec<_> = [(filter_path.as_str(), "/[TEMP_DIR]/")]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(INSTA_FILTERS.to_vec())
|
.chain(INSTA_FILTERS.to_vec())
|
||||||
|
|
@ -2532,7 +2532,7 @@ fn compile_editable() -> Result<()> {
|
||||||
"
|
"
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_in.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_in.user_display().to_string());
|
||||||
let filters: Vec<_> = [(filter_path.as_str(), "requirements.in")]
|
let filters: Vec<_> = [(filter_path.as_str(), "requirements.in")]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(INSTA_FILTERS.to_vec())
|
.chain(INSTA_FILTERS.to_vec())
|
||||||
|
|
@ -2591,7 +2591,7 @@ fn recursive_extras_direct_url() -> Result<()> {
|
||||||
let requirements_in = context.temp_dir.child("requirements.in");
|
let requirements_in = context.temp_dir.child("requirements.in");
|
||||||
requirements_in.write_str("black[dev] @ ../../scripts/editable-installs/black_editable")?;
|
requirements_in.write_str("black[dev] @ ../../scripts/editable-installs/black_editable")?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_in.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_in.user_display().to_string());
|
||||||
let filters: Vec<_> = [(filter_path.as_str(), "requirements.in")]
|
let filters: Vec<_> = [(filter_path.as_str(), "requirements.in")]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(INSTA_FILTERS.to_vec())
|
.chain(INSTA_FILTERS.to_vec())
|
||||||
|
|
@ -2654,7 +2654,7 @@ fn compile_editable_url_requirement() -> Result<()> {
|
||||||
let requirements_in = context.temp_dir.child("requirements.in");
|
let requirements_in = context.temp_dir.child("requirements.in");
|
||||||
requirements_in.write_str("-e ../../scripts/editable-installs/hatchling_editable")?;
|
requirements_in.write_str("-e ../../scripts/editable-installs/hatchling_editable")?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_in.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_in.user_display().to_string());
|
||||||
let filters: Vec<_> = [(filter_path.as_str(), "requirements.in")]
|
let filters: Vec<_> = [(filter_path.as_str(), "requirements.in")]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(INSTA_FILTERS.to_vec())
|
.chain(INSTA_FILTERS.to_vec())
|
||||||
|
|
@ -2739,7 +2739,7 @@ fn cache_errors_are_non_fatal() -> Result<()> {
|
||||||
for file in &cache_files {
|
for file in &cache_files {
|
||||||
let file = context.cache_dir.join(file);
|
let file = context.cache_dir.join(file);
|
||||||
if !file.is_file() {
|
if !file.is_file() {
|
||||||
bail!("Missing cache file {}", file.simplified_display());
|
bail!("Missing cache file {}", file.user_display());
|
||||||
}
|
}
|
||||||
fs_err::write(file, "I borken you cache")?;
|
fs_err::write(file, "I borken you cache")?;
|
||||||
}
|
}
|
||||||
|
|
@ -2754,7 +2754,7 @@ fn cache_errors_are_non_fatal() -> Result<()> {
|
||||||
for file in cache_files {
|
for file in cache_files {
|
||||||
let file = context.cache_dir.join(file);
|
let file = context.cache_dir.join(file);
|
||||||
if !file.is_file() {
|
if !file.is_file() {
|
||||||
bail!("Missing cache file {}", file.simplified_display());
|
bail!("Missing cache file {}", file.user_display());
|
||||||
}
|
}
|
||||||
|
|
||||||
fs_err::OpenOptions::new()
|
fs_err::OpenOptions::new()
|
||||||
|
|
@ -3055,7 +3055,7 @@ fn find_links_directory() -> Result<()> {
|
||||||
"})?;
|
"})?;
|
||||||
|
|
||||||
let project_root = fs_err::canonicalize(std::env::current_dir()?.join("..").join(".."))?;
|
let project_root = fs_err::canonicalize(std::env::current_dir()?.join("..").join(".."))?;
|
||||||
let project_root_string = regex::escape(&project_root.simplified_display().to_string());
|
let project_root_string = regex::escape(&project_root.user_display().to_string());
|
||||||
let filters: Vec<_> = [
|
let filters: Vec<_> = [
|
||||||
(project_root_string.as_str(), "[PROJECT_ROOT]"),
|
(project_root_string.as_str(), "[PROJECT_ROOT]"),
|
||||||
// Unify trailing (back)slash between Windows and Unix.
|
// Unify trailing (back)slash between Windows and Unix.
|
||||||
|
|
@ -4209,7 +4209,7 @@ fn editable_invalid_extra() -> Result<()> {
|
||||||
let requirements_in = context.temp_dir.child("requirements.in");
|
let requirements_in = context.temp_dir.child("requirements.in");
|
||||||
requirements_in.write_str("-e ../../scripts/editable-installs/black_editable[empty]")?;
|
requirements_in.write_str("-e ../../scripts/editable-installs/black_editable[empty]")?;
|
||||||
|
|
||||||
let requirements_path = regex::escape(&requirements_in.simplified_display().to_string());
|
let requirements_path = regex::escape(&requirements_in.user_display().to_string());
|
||||||
let filters: Vec<_> = [
|
let filters: Vec<_> = [
|
||||||
(r" file://.*/", " file://[TEMP_DIR]/"),
|
(r" file://.*/", " file://[TEMP_DIR]/"),
|
||||||
(requirements_path.as_str(), "requirements.in"),
|
(requirements_path.as_str(), "requirements.in"),
|
||||||
|
|
@ -4526,8 +4526,8 @@ fn override_editable() -> Result<()> {
|
||||||
let overrides_txt = context.temp_dir.child("overrides.txt");
|
let overrides_txt = context.temp_dir.child("overrides.txt");
|
||||||
overrides_txt.write_str("black==23.10.1")?;
|
overrides_txt.write_str("black==23.10.1")?;
|
||||||
|
|
||||||
let requirements_path = regex::escape(&requirements_in.simplified_display().to_string());
|
let requirements_path = regex::escape(&requirements_in.user_display().to_string());
|
||||||
let overrides_path = regex::escape(&overrides_txt.simplified_display().to_string());
|
let overrides_path = regex::escape(&overrides_txt.user_display().to_string());
|
||||||
let filters: Vec<_> = [
|
let filters: Vec<_> = [
|
||||||
(requirements_path.as_str(), "requirements.in"),
|
(requirements_path.as_str(), "requirements.in"),
|
||||||
(overrides_path.as_str(), "overrides.txt"),
|
(overrides_path.as_str(), "overrides.txt"),
|
||||||
|
|
@ -4874,7 +4874,7 @@ fn editable_direct_dependency() -> Result<()> {
|
||||||
let requirements_in = context.temp_dir.child("requirements.in");
|
let requirements_in = context.temp_dir.child("requirements.in");
|
||||||
requirements_in.write_str("-e ../../scripts/editable-installs/setuptools_editable")?;
|
requirements_in.write_str("-e ../../scripts/editable-installs/setuptools_editable")?;
|
||||||
|
|
||||||
let requirements_path = regex::escape(&requirements_in.simplified_display().to_string());
|
let requirements_path = regex::escape(&requirements_in.user_display().to_string());
|
||||||
let filters: Vec<_> = [
|
let filters: Vec<_> = [
|
||||||
(r" file://.*/", " file://[TEMP_DIR]/"),
|
(r" file://.*/", " file://[TEMP_DIR]/"),
|
||||||
(requirements_path.as_str(), "requirements.in"),
|
(requirements_path.as_str(), "requirements.in"),
|
||||||
|
|
|
||||||
|
|
@ -2205,7 +2205,7 @@ fn sync_editable() -> Result<()> {
|
||||||
current_dir = current_dir.simplified_display(),
|
current_dir = current_dir.simplified_display(),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_txt.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_txt.user_display().to_string());
|
||||||
let filters = INSTA_FILTERS
|
let filters = INSTA_FILTERS
|
||||||
.iter()
|
.iter()
|
||||||
.chain(&[
|
.chain(&[
|
||||||
|
|
@ -2328,7 +2328,7 @@ fn sync_editable_and_registry() -> Result<()> {
|
||||||
"
|
"
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_txt.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_txt.user_display().to_string());
|
||||||
let filters = INSTA_FILTERS
|
let filters = INSTA_FILTERS
|
||||||
.iter()
|
.iter()
|
||||||
.chain(&[
|
.chain(&[
|
||||||
|
|
@ -2367,7 +2367,7 @@ fn sync_editable_and_registry() -> Result<()> {
|
||||||
"
|
"
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_txt.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_txt.user_display().to_string());
|
||||||
let filters = INSTA_FILTERS
|
let filters = INSTA_FILTERS
|
||||||
.iter()
|
.iter()
|
||||||
.chain(&[
|
.chain(&[
|
||||||
|
|
@ -2401,7 +2401,7 @@ fn sync_editable_and_registry() -> Result<()> {
|
||||||
"
|
"
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_txt.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_txt.user_display().to_string());
|
||||||
let filters = INSTA_FILTERS
|
let filters = INSTA_FILTERS
|
||||||
.iter()
|
.iter()
|
||||||
.chain(&[
|
.chain(&[
|
||||||
|
|
@ -2430,7 +2430,7 @@ fn sync_editable_and_registry() -> Result<()> {
|
||||||
"
|
"
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let filter_path = regex::escape(&requirements_txt.simplified_display().to_string());
|
let filter_path = regex::escape(&requirements_txt.user_display().to_string());
|
||||||
let filters = INSTA_FILTERS
|
let filters = INSTA_FILTERS
|
||||||
.iter()
|
.iter()
|
||||||
.chain(&[
|
.chain(&[
|
||||||
|
|
@ -2480,13 +2480,7 @@ fn incompatible_wheel() -> Result<()> {
|
||||||
Url::from_file_path(wheel.path()).unwrap()
|
Url::from_file_path(wheel.path()).unwrap()
|
||||||
))?;
|
))?;
|
||||||
|
|
||||||
let wheel_dir = regex::escape(
|
let wheel_dir = regex::escape(&wheel_dir.path().canonicalize()?.user_display().to_string());
|
||||||
&wheel_dir
|
|
||||||
.path()
|
|
||||||
.canonicalize()?
|
|
||||||
.simplified_display()
|
|
||||||
.to_string(),
|
|
||||||
);
|
|
||||||
let filters: Vec<_> = [(wheel_dir.as_str(), "[TEMP_DIR]")]
|
let filters: Vec<_> = [(wheel_dir.as_str(), "[TEMP_DIR]")]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(INSTA_FILTERS.to_vec())
|
.chain(INSTA_FILTERS.to_vec())
|
||||||
|
|
@ -2573,7 +2567,7 @@ fn find_links() -> Result<()> {
|
||||||
"})?;
|
"})?;
|
||||||
|
|
||||||
let project_root = fs_err::canonicalize(std::env::current_dir()?.join("../.."))?;
|
let project_root = fs_err::canonicalize(std::env::current_dir()?.join("../.."))?;
|
||||||
let project_root_string = regex::escape(&project_root.simplified_display().to_string());
|
let project_root_string = regex::escape(&project_root.user_display().to_string());
|
||||||
let filters: Vec<_> = [(project_root_string.as_str(), "[PROJECT_ROOT]")]
|
let filters: Vec<_> = [(project_root_string.as_str(), "[PROJECT_ROOT]")]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(INSTA_FILTERS.to_vec())
|
.chain(INSTA_FILTERS.to_vec())
|
||||||
|
|
@ -2921,11 +2915,13 @@ fn compile_invalid_pyc_invalidation_mode() -> Result<()> {
|
||||||
.site_packages()
|
.site_packages()
|
||||||
.canonicalize()
|
.canonicalize()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.simplified_display()
|
.user_display()
|
||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
let filters: Vec<_> = [
|
let filters: Vec<_> = [
|
||||||
(site_packages.as_str(), "[SITE-PACKAGES]"),
|
(site_packages.as_str(), "[SITE-PACKAGES]"),
|
||||||
|
(r"\.venv/lib/python3.12/site-packages", "[SITE-PACKAGES]"),
|
||||||
|
(r"\.venv/Lib/site-packages", "[SITE-PACKAGES]"),
|
||||||
(
|
(
|
||||||
r#"\[SITE-PACKAGES\].*.py", received: "#,
|
r#"\[SITE-PACKAGES\].*.py", received: "#,
|
||||||
r#"[SITE-PACKAGES]/[FIRST-FILE]", received: "#,
|
r#"[SITE-PACKAGES]/[FIRST-FILE]", received: "#,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ use assert_fs::prelude::*;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use common::{uv_snapshot, INSTA_FILTERS};
|
use common::{uv_snapshot, INSTA_FILTERS};
|
||||||
use uv_fs::Simplified;
|
|
||||||
|
|
||||||
use crate::common::{get_bin, venv_to_interpreter, TestContext};
|
use crate::common::{get_bin, venv_to_interpreter, TestContext};
|
||||||
|
|
||||||
|
|
@ -352,13 +351,9 @@ fn missing_record() -> Result<()> {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
fs_err::remove_file(dist_info.join("RECORD"))?;
|
fs_err::remove_file(dist_info.join("RECORD"))?;
|
||||||
|
|
||||||
let dist_info_str = regex::escape(&format!(
|
|
||||||
"RECORD file not found at: {}",
|
|
||||||
dist_info.simplified_display()
|
|
||||||
));
|
|
||||||
let filters: Vec<_> = [(
|
let filters: Vec<_> = [(
|
||||||
dist_info_str.as_str(),
|
r"RECORD file not found at: .*",
|
||||||
"RECORD file not found at: [DIST_INFO]",
|
"RECORD file not found at: [RECORD]",
|
||||||
)]
|
)]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(INSTA_FILTERS.to_vec())
|
.chain(INSTA_FILTERS.to_vec())
|
||||||
|
|
@ -371,7 +366,7 @@ fn missing_record() -> Result<()> {
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
error: Cannot uninstall package; RECORD file not found at: [DIST_INFO]/RECORD
|
error: Cannot uninstall package; RECORD file not found at: [RECORD]
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,8 @@ fn create_venv() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -52,8 +49,8 @@ fn create_venv() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -67,11 +64,8 @@ fn create_venv() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -91,8 +85,8 @@ fn create_venv() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -115,7 +109,7 @@ fn create_venv_defaults_to_cwd() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(&filter_venv, ".venv"),
|
||||||
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
|
|
@ -159,11 +153,8 @@ fn seed() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -184,9 +175,9 @@ fn seed() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
+ pip==23.3.1
|
+ pip==23.3.1
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -209,11 +200,8 @@ fn seed_older_python_version() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -234,11 +222,11 @@ fn seed_older_python_version() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
+ pip==23.3.1
|
+ pip==23.3.1
|
||||||
+ setuptools==68.2.2
|
+ setuptools==68.2.2
|
||||||
+ wheel==0.41.3
|
+ wheel==0.41.3
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -311,7 +299,7 @@ fn create_venv_unknown_python_patch() -> Result<()> {
|
||||||
r"No Python 3\.8\.0 found through `py --list-paths` or in `PATH`\. Is Python 3\.8\.0 installed\?",
|
r"No Python 3\.8\.0 found through `py --list-paths` or in `PATH`\. Is Python 3\.8\.0 installed\?",
|
||||||
"No Python 3.8.0 in `PATH`. Is Python 3.8.0 installed?",
|
"No Python 3.8.0 in `PATH`. Is Python 3.8.0 installed?",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(&filter_venv, ".venv"),
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -351,11 +339,8 @@ fn create_venv_python_patch() -> Result<()> {
|
||||||
let filter_prompt = r"Activate with: (?:.*)\\Scripts\\activate";
|
let filter_prompt = r"Activate with: (?:.*)\\Scripts\\activate";
|
||||||
let filters = &[
|
let filters = &[
|
||||||
(r"interpreter at: .+", "interpreter at: [PATH]"),
|
(r"interpreter at: .+", "interpreter at: [PATH]"),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -375,8 +360,8 @@ fn create_venv_python_patch() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python 3.12.1 interpreter at: [PATH]
|
Using Python 3.12.1 interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -401,7 +386,7 @@ fn file_exists() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(&filter_venv, ".venv"),
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -421,11 +406,11 @@ fn file_exists() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
uv::venv::creation
|
uv::venv::creation
|
||||||
|
|
||||||
× Failed to create virtualenv
|
× Failed to create virtualenv
|
||||||
╰─▶ File exists at `/home/ferris/project/.venv`
|
╰─▶ File exists at `.venv`
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -449,11 +434,8 @@ fn empty_dir_exists() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -473,8 +455,8 @@ fn empty_dir_exists() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -500,7 +482,7 @@ fn non_empty_dir_exists() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(&filter_venv, ".venv"),
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -520,11 +502,11 @@ fn non_empty_dir_exists() -> Result<()> {
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
uv::venv::creation
|
uv::venv::creation
|
||||||
|
|
||||||
× Failed to create virtualenv
|
× Failed to create virtualenv
|
||||||
╰─▶ The directory `/home/ferris/project/.venv` exists, but it's not a virtualenv
|
╰─▶ The directory `.venv` exists, but it's not a virtualenv
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -565,11 +547,8 @@ fn windows_shims() -> Result<()> {
|
||||||
r"Using Python 3\.8.\d+ interpreter at: .+",
|
r"Using Python 3\.8.\d+ interpreter at: .+",
|
||||||
"Using Python 3.8.x interpreter at: [PATH]",
|
"Using Python 3.8.x interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(&filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
&filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -588,8 +567,8 @@ fn windows_shims() -> Result<()> {
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
warning: virtualenv's `--clear` has no effect (uv always clears the virtual environment).
|
warning: virtualenv's `--clear` has no effect (uv always clears the virtual environment).
|
||||||
Using Python 3.8.x interpreter at: [PATH]
|
Using Python 3.8.x interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -613,11 +592,8 @@ fn virtualenv_compatibility() -> Result<()> {
|
||||||
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
r"Using Python 3\.\d+\.\d+ interpreter at: .+",
|
||||||
"Using Python [VERSION] interpreter at: [PATH]",
|
"Using Python [VERSION] interpreter at: [PATH]",
|
||||||
),
|
),
|
||||||
(&filter_venv, "/home/ferris/project/.venv"),
|
(filter_prompt, "Activate with: source .venv/bin/activate"),
|
||||||
(
|
(&filter_venv, ".venv"),
|
||||||
filter_prompt,
|
|
||||||
"Activate with: source /home/ferris/project/.venv/bin/activate",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
uv_snapshot!(filters, Command::new(get_bin())
|
uv_snapshot!(filters, Command::new(get_bin())
|
||||||
.arg("venv")
|
.arg("venv")
|
||||||
|
|
@ -638,8 +614,8 @@ fn virtualenv_compatibility() -> Result<()> {
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
warning: virtualenv's `--clear` has no effect (uv always clears the virtual environment).
|
warning: virtualenv's `--clear` has no effect (uv always clears the virtual environment).
|
||||||
Using Python [VERSION] interpreter at: [PATH]
|
Using Python [VERSION] interpreter at: [PATH]
|
||||||
Creating virtualenv at: /home/ferris/project/.venv
|
Creating virtualenv at: .venv
|
||||||
Activate with: source /home/ferris/project/.venv/bin/activate
|
Activate with: source .venv/bin/activate
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue