Skip to content

Commit

Permalink
Add huak-pyproject-toml
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpryer committed Nov 18, 2023
1 parent 0fa05cb commit b9d59cc
Show file tree
Hide file tree
Showing 6 changed files with 709 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/huak-package-manager/src/ops/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn add_project_dependencies(
let mut metadata = workspace.current_local_metadata()?;

// Collect all dependencies that need to be added to the metadata file.
let mut deps: Vec<Dependency> = dependency_iter(dependencies)
let mut deps = dependency_iter(dependencies)
.filter(|dep| !metadata.metadata().contains_dependency(dep))
.collect::<Vec<_>>();

Expand Down
1 change: 1 addition & 0 deletions crates/huak-pyproject-toml/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
17 changes: 17 additions & 0 deletions crates/huak-pyproject-toml/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "huak-pyproject-toml"
version = "0.0.0"
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true

[dependencies]
thiserror.workspace = true
toml_edit.workspace = true

[lints]
workspace = true

[dev-dependencies]
tempfile.workspace = true
12 changes: 12 additions & 0 deletions crates/huak-pyproject-toml/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use thiserror::Error as ThisError;

#[allow(clippy::enum_variant_names)]
#[derive(ThisError, Debug)]
pub enum Error {
#[error("{0}")]
IOError(#[from] std::io::Error),
#[error("{0}")]
TOMLEditError(#[from] toml_edit::TomlError),
#[error("a problem with utf-8 parsing occurred: {0}")]
Utf8Error(#[from] std::str::Utf8Error),
}
Loading

0 comments on commit b9d59cc

Please sign in to comment.