Skip to content

Commit

Permalink
feat: add everything needed for activation to py-rattler
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Sep 6, 2023
1 parent 563fafb commit 0b258c0
Show file tree
Hide file tree
Showing 13 changed files with 747 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crates/rattler_conda_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use match_spec::parse::ParseMatchSpecError;
pub use match_spec::{MatchSpec, NamelessMatchSpec};
pub use no_arch_type::{NoArchKind, NoArchType};
pub use package_name::{InvalidPackageNameError, PackageName};
pub use platform::{ParsePlatformError, Platform};
pub use platform::{Arch, ParseArchError, ParsePlatformError, Platform};
pub use prefix_record::PrefixRecord;
pub use repo_data::patches::{PackageRecordPatch, PatchInstructions, RepoDataPatch};
pub use repo_data::{ChannelInfo, ConvertSubdirError, PackageRecord, RepoData};
Expand Down
3 changes: 3 additions & 0 deletions crates/rattler_conda_types/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl Ord for Platform {
}

/// Known architectures supported by Conda.
#[allow(missing_docs)]
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum Arch {
X86,
Expand Down Expand Up @@ -356,9 +357,11 @@ impl Arch {
}
}

/// An error that can occur when parsing an arch from a string.
#[derive(Debug, Error, Clone, Eq, PartialEq)]
#[error("'{string}' is not a known arch")]
pub struct ParseArchError {
/// The arch string that could not be parsed.
pub string: String,
}

Expand Down
127 changes: 118 additions & 9 deletions py-rattler/Cargo.lock

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

1 change: 1 addition & 0 deletions py-rattler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ crate-type = ["cdylib"]

[dependencies]
rattler_conda_types = { path = "../crates/rattler_conda_types", default-features = false }
rattler_shell = { path = "../crates/rattler_shell", default-features = false }

pyo3 = { version = "0.19", features = [
"abi3-py38",
Expand Down
3 changes: 3 additions & 0 deletions py-rattler/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ license = "BSD-3-Clause"

[tool.maturin]
features = ["pyo3/extension-module"]

[tool.ruff]
line-length = 120
3 changes: 3 additions & 0 deletions py-rattler/rattler/platform/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from rattler.platform.platform import Platform

__all__ = ["Platform"]
Loading

0 comments on commit 0b258c0

Please sign in to comment.