Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PEP 723 lockfile in uv add --script #10145

Open
wants to merge 1 commit into
base: charlie/script-run
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading