Skip to content

Commit

Permalink
Update lockfile in uv add --script
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Dec 26, 2024
1 parent aeb5159 commit 22478ad
Show file tree
Hide file tree
Showing 7 changed files with 580 additions and 117 deletions.
7 changes: 6 additions & 1 deletion crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3237,7 +3237,12 @@ pub struct AddArgs {
/// a new one will be created and added to the script. When executed via `uv run`,
/// uv will create a temporary environment for the script with all inline
/// dependencies installed.
#[arg(long, conflicts_with = "dev", conflicts_with = "optional")]
#[arg(
long,
conflicts_with = "dev",
conflicts_with = "optional",
conflicts_with = "package"
)]
pub script: Option<PathBuf>,

/// The Python interpreter to use for resolving and syncing.
Expand Down
6 changes: 3 additions & 3 deletions crates/uv-scripts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ impl Pep723Script {
}

/// Replace the existing metadata in the file with new metadata and write the updated content.
pub async fn write(&self, metadata: &str) -> Result<(), Pep723Error> {
pub fn write(&self, metadata: &str) -> Result<(), io::Error> {
let content = format!(
"{}{}{}",
self.prelude,
serialize_metadata(metadata),
self.postlude
);

fs_err::tokio::write(&self.path, content).await?;
fs_err::write(&self.path, content)?;

Ok(())
}
Expand Down Expand Up @@ -307,7 +307,7 @@ impl Pep723Metadata {
}

impl FromStr for Pep723Metadata {
type Err = Pep723Error;
type Err = toml::de::Error;

/// Parse `Pep723Metadata` from a raw TOML string.
fn from_str(raw: &str) -> Result<Self, Self::Err> {
Expand Down
Loading

0 comments on commit 22478ad

Please sign in to comment.