mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-17 18:57:30 +00:00
Make repeated uv add operations simpler (#5922)
## Summary Closes #5913.
This commit is contained in:
parent
2789830ac2
commit
dc3f498f58
4 changed files with 102 additions and 13 deletions
|
|
@ -30,7 +30,7 @@ pub struct PyProjectToml {
|
|||
pub tool: Option<Tool>,
|
||||
/// The raw unserialized document.
|
||||
#[serde(skip)]
|
||||
pub(crate) raw: String,
|
||||
pub raw: String,
|
||||
}
|
||||
|
||||
impl PyProjectToml {
|
||||
|
|
|
|||
|
|
@ -55,11 +55,6 @@ impl PyProjectTomlMut {
|
|||
})
|
||||
}
|
||||
|
||||
/// Initialize a [`PyProjectToml`] from a [`PyProjectTomlMut`].
|
||||
pub fn to_toml(&self) -> Result<PyProjectToml, Error> {
|
||||
Ok(toml::from_str(&self.doc.to_string()).map_err(Box::new)?)
|
||||
}
|
||||
|
||||
/// Adds a project to the workspace.
|
||||
pub fn add_workspace(&mut self, path: impl AsRef<Path>) -> Result<(), Error> {
|
||||
// Get or create `tool.uv.workspace.members`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue