Skip to content

Commit

Permalink
Add huak-toolchain (789)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpryer committed Nov 6, 2023
1 parent dce3350 commit 8d1f21f
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 181 deletions.
2 changes: 1 addition & 1 deletion 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-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "huak"
version = "0.0.19"
version = "0.0.19-alpha1"
description = "A Python package manager written in Rust and inspired by Cargo."
repository = "https://github.com/cnpryer/huak.git"
homepage = "https://github.com/cnpryer/huak.git"
Expand Down
3 changes: 2 additions & 1 deletion crates/huak-cli/tests/snapshots/r#mod__tests__help.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
source: crates/huak_cli/tests/mod.rs
source: crates/huak-cli/tests/mod.rs
info:
program: huak
args:
Expand Down Expand Up @@ -29,6 +29,7 @@ Commands:
remove Remove dependencies from the project
run Run a command within the project's environment context
test Test the project's Python code
toolchain Manage toolchains
update Update the project's dependencies
version Display the version of the project
help Print this message or the help of the given subcommand(s)
Expand Down
4 changes: 2 additions & 2 deletions crates/huak-package-manager/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pub enum Error {
#[error("a problem occurred resolving huak's home directory")]
HuakHomeNotFound,
#[error("a toolchain cannot be found")]
HuakToolchainNotFound,
ToolchainNotFound,
#[error("{0}")] // See TODO note above.
HuakToolchainError(#[from] huak_toolchain::Error),
ToolchainError(#[from] huak_toolchain::Error),
#[error("a toolchain already exists: {0}")]
LocalToolchainExists(PathBuf),
#[error("a problem with huak's internals occurred: {0}")]
Expand Down
2 changes: 1 addition & 1 deletion crates/huak-package-manager/src/ops/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ fn install(path: PathBuf, channel: Channel, config: &Config) -> HuakResult<()> {
.is_err()
{
if let Err(e) = toolchain.register_tool_from_path(&path, "python", true) {
return Err(Error::HuakToolchainError(e));
return Err(Error::ToolchainError(e));
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/huak-package-manager/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Workspace {
/// 3. ~/.huak/settings.toml configuration
pub fn resolve_local_toolchain(&self, channel: Option<&Channel>) -> HuakResult<LocalToolchain> {
let Some(it) = resolve_local_toolchain(self, channel) else {
return Err(Error::HuakToolchainNotFound);
return Err(Error::ToolchainNotFound);
};

Ok(it)
Expand Down
2 changes: 1 addition & 1 deletion crates/huak-python-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
//! ```
pub use crate::error::Error;
pub use crate::install::install_with_target;
pub use crate::resolve::{
release_options_from_requested_version, resolve_release, ReleaseArchitecture,
ReleaseBuildConfiguration, ReleaseKind, ReleaseOption, ReleaseOptions, ReleaseOs,
RequestedVersion, Strategy,
};
pub use crate::version::Version;
use install::download_release;
pub use install::install_with_target;
pub use releases::Release;
use std::path::Path;
use tar::Archive;
Expand Down
170 changes: 0 additions & 170 deletions crates/huak-toolchain/src/install.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/huak-toolchain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
pub use channel::{Channel, DescriptorParts};
pub use error::Error;
pub use install::install_toolchain_with_target;
use path::name_from_path;
pub use resolve::{Entry, LocalToolchainResolver};
#[cfg(unix)]
Expand All @@ -86,7 +85,6 @@ pub use tools::LocalTool;

mod channel;
mod error;
mod install;
mod path;
mod resolve;
mod tools;
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "huak"
version = "0.0.19"
version = "0.0.19a1"
description = "A Python package manager written in Rust and inspired by Cargo."
authors = [
{email = "[email protected]"},
Expand Down

0 comments on commit 8d1f21f

Please sign in to comment.