diff --git a/README.md b/README.md index f7d7ba44b9..7b76179191 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ You can [join our discord server via this link][chat-url]. Rattler consists of several crates that provide different functionalities. -* **rattler_conda_types**: foundational types for all datastructures used withing the conda eco-system. +* **rattler_conda_types**: foundational types for all datastructures used within the conda eco-system. * **rattler_package_streaming**: provides functionality to download, extract and create conda package archives. * **rattler_repodata_gateway**: downloads, reads and processes information about existing conda packages from an index. * **rattler_shell**: code to activate an existing environment and run programs in it. diff --git a/crates/file_url/src/lib.rs b/crates/file_url/src/lib.rs index 462cf3d259..a9c73c6dda 100644 --- a/crates/file_url/src/lib.rs +++ b/crates/file_url/src/lib.rs @@ -51,7 +51,7 @@ pub fn url_to_path(url: &Url) -> Option { Some(host) => Some(host), }; - let (mut path, seperator) = if let Some(host) = host { + let (mut path, separator) = if let Some(host) = host { // A host is only present for Windows UNC paths (format!("\\\\{host}\\"), "\\") } else { @@ -69,7 +69,7 @@ pub fn url_to_path(url: &Url) -> Option { for (idx, segment) in segments.enumerate() { if idx > 0 { - path.push_str(seperator); + path.push_str(separator); } match String::from_utf8(percent_decode(segment.as_bytes()).collect()) { Ok(s) => path.push_str(&s), diff --git a/crates/rattler-bin/src/commands/create.rs b/crates/rattler-bin/src/commands/create.rs index 1511ab1910..94536f8df4 100644 --- a/crates/rattler-bin/src/commands/create.rs +++ b/crates/rattler-bin/src/commands/create.rs @@ -176,7 +176,7 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> { ); // Determine virtual packages of the system. These packages define the capabilities of the - // system. Some packages depend on these virtual packages to indiciate compability with the + // system. Some packages depend on these virtual packages to indicate compatibility with the // hardware of the system. let virtual_packages = wrap_in_progress("determining virtual packages", move || { if let Some(virtual_packages) = opt.virtual_package { diff --git a/crates/rattler/src/cli/auth.rs b/crates/rattler/src/cli/auth.rs index 990ca0adf5..0873e87417 100644 --- a/crates/rattler/src/cli/auth.rs +++ b/crates/rattler/src/cli/auth.rs @@ -50,7 +50,7 @@ pub struct Args { /// Authentication errors that can be returned by the `AuthenticationCLIError` #[derive(thiserror::Error, Debug)] pub enum AuthenticationCLIError { - /// An error occured when the input repository URL is parsed + /// An error occurred when the input repository URL is parsed #[error("Failed to parse the URL")] ParseUrlError(#[from] url::ParseError), diff --git a/crates/rattler/src/install/driver.rs b/crates/rattler/src/install/driver.rs index 7ae9d404c6..73be08f689 100644 --- a/crates/rattler/src/install/driver.rs +++ b/crates/rattler/src/install/driver.rs @@ -169,7 +169,7 @@ impl InstallDriver { Ok(None) } - /// Runs a blocking task that will execute on a seperate thread. The task is + /// Runs a blocking task that will execute on a separate thread. The task is /// not started until an IO permit is acquired. This is used to make /// sure that the system doesn't try to acquire more IO resources than /// the system has available. diff --git a/crates/rattler/src/install/installer/error.rs b/crates/rattler/src/install/installer/error.rs index e20a22f131..f56d8995e2 100644 --- a/crates/rattler/src/install/installer/error.rs +++ b/crates/rattler/src/install/installer/error.rs @@ -31,7 +31,7 @@ pub enum InstallerError { #[error("failed to unlink {0}")] UnlinkError(String, #[source] UnlinkError), - /// A generic IO error occured + /// A generic IO error occurred #[error("{0}")] IoError(String, #[source] std::io::Error), @@ -43,7 +43,7 @@ pub enum InstallerError { #[error("post-processing failed")] PostProcessingFailed(#[source] PrePostLinkError), - /// A clobbering error occured + /// A clobbering error occurred #[error("failed to unclobber clobbered files")] ClobberError(#[from] ClobberError), diff --git a/crates/rattler/src/install/installer/reporter.rs b/crates/rattler/src/install/installer/reporter.rs index 95324f781b..93ff633f3b 100644 --- a/crates/rattler/src/install/installer/reporter.rs +++ b/crates/rattler/src/install/installer/reporter.rs @@ -83,7 +83,7 @@ pub trait Reporter: Send + Sync { /// to `on_transaction_start`. fn on_link_start(&self, operation: usize, record: &RepoDataRecord) -> usize; - /// Called when linking of a package compelted. + /// Called when linking of a package completed. /// /// The `index` is the value return by `on_link_start` for the corresponding /// package. diff --git a/crates/rattler/src/install/mod.rs b/crates/rattler/src/install/mod.rs index 1f5b7e20f9..76ea48f538 100644 --- a/crates/rattler/src/install/mod.rs +++ b/crates/rattler/src/install/mod.rs @@ -178,7 +178,7 @@ pub struct InstallOptions { /// Whether or not to use symbolic links where possible. If this is set to /// `Some(false)` symlinks are disabled, if set to `Some(true)` symbolic - /// links are alwas used when specified in the [`info/paths.json`] file + /// links are always used when specified in the [`info/paths.json`] file /// even if this is not supported. If the value is set to `None` /// symbolic links are only used if they are supported. /// diff --git a/crates/rattler/src/lib.rs b/crates/rattler/src/lib.rs index 8fc40c1996..938cc7d622 100644 --- a/crates/rattler/src/lib.rs +++ b/crates/rattler/src/lib.rs @@ -8,7 +8,7 @@ //! first conceived. Rattler is an attempt at reimplementing a lot of the //! machinery supporting Conda but making it available to a wider range of //! languages. The goal is to be able to integrate the Conda ecosystem in a wide -//! variaty of tools that do not rely on Python. Rust has excellent support for +//! variety of tools that do not rely on Python. Rust has excellent support for //! interfacing with many other languages (WASM, Javascript, Python, C, etc) and //! is therefore a good candidate for a reimplementation. #![deny(missing_docs)] diff --git a/crates/rattler/src/range.rs b/crates/rattler/src/range.rs index 41187f4ee1..bdf7ef2fe3 100644 --- a/crates/rattler/src/range.rs +++ b/crates/rattler/src/range.rs @@ -621,12 +621,12 @@ mod tests { } #[test] - fn intesection_of_complements_is_none(range in strategy()) { + fn intersection_of_complements_is_none(range in strategy()) { assert_eq!(range.negate().intersection(&range), Range::none()); } #[test] - fn intesection_contains_both(r1 in strategy(), r2 in strategy(), version in version_strat()) { + fn intersection_contains_both(r1 in strategy(), r2 in strategy(), version in version_strat()) { assert_eq!(r1.intersection(&r2).contains(&version), r1.contains(&version) && r2.contains(&version)); } diff --git a/crates/rattler_cache/src/package_cache/mod.rs b/crates/rattler_cache/src/package_cache/mod.rs index b9b3547ab0..24e423c995 100644 --- a/crates/rattler_cache/src/package_cache/mod.rs +++ b/crates/rattler_cache/src/package_cache/mod.rs @@ -62,7 +62,7 @@ pub enum PackageCacheError { #[error(transparent)] FetchError(#[from] Arc), - /// A locking error occured + /// A locking error occurred #[error("{0}")] LockError(String, #[source] std::io::Error), diff --git a/crates/rattler_conda_types/CHANGELOG.md b/crates/rattler_conda_types/CHANGELOG.md index 708f48b506..f024f24955 100644 --- a/crates/rattler_conda_types/CHANGELOG.md +++ b/crates/rattler_conda_types/CHANGELOG.md @@ -164,7 +164,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.20.4](https://github.com/conda/rattler/compare/rattler_conda_types-v0.20.3...rattler_conda_types-v0.20.4) - 2024-03-30 ### Fixed -- matchspec empty namespace and channel cannonical name ([#582](https://github.com/conda/rattler/pull/582)) +- matchspec empty namespace and channel canonical name ([#582](https://github.com/conda/rattler/pull/582)) ## [0.20.3](https://github.com/conda/rattler/compare/rattler_conda_types-v0.20.2...rattler_conda_types-v0.20.3) - 2024-03-21 diff --git a/crates/rattler_conda_types/src/channel_data.rs b/crates/rattler_conda_types/src/channel_data.rs index 96035f3b27..1c574b2f83 100644 --- a/crates/rattler_conda_types/src/channel_data.rs +++ b/crates/rattler_conda_types/src/channel_data.rs @@ -28,7 +28,7 @@ pub struct ChannelData { /// A mapping of all packages in the channel pub packages: HashMap, - /// The availalble subdirs for this channel + /// The available subdirs for this channel #[serde(default)] pub subdirs: Vec, } diff --git a/crates/rattler_conda_types/src/match_spec/parse.rs b/crates/rattler_conda_types/src/match_spec/parse.rs index aedf86ab64..d0e84edaf7 100644 --- a/crates/rattler_conda_types/src/match_spec/parse.rs +++ b/crates/rattler_conda_types/src/match_spec/parse.rs @@ -359,7 +359,7 @@ fn split_version_and_build( ))(input) } - fn parse_version_and_build_seperator<'a, E: ParseError<&'a str> + ContextError<&'a str>>( + fn parse_version_and_build_separator<'a, E: ParseError<&'a str> + ContextError<&'a str>>( strictness: ParseStrictness, ) -> impl FnMut(&'a str) -> IResult<&'a str, &'a str, E> { move |input: &'a str| { @@ -374,7 +374,7 @@ fn split_version_and_build( } } - match parse_version_and_build_seperator(strictness)(input).finish() { + match parse_version_and_build_separator(strictness)(input).finish() { Ok((rest, version)) => { let build_string = rest.trim(); diff --git a/crates/rattler_conda_types/src/version/mod.rs b/crates/rattler_conda_types/src/version/mod.rs index 451ed958cd..52ab8daa8d 100644 --- a/crates/rattler_conda_types/src/version/mod.rs +++ b/crates/rattler_conda_types/src/version/mod.rs @@ -423,7 +423,7 @@ impl Version { } /// Returns the number of segments in the version. Segments are the part of the version - /// seperated by dots or dashes. + /// separated by dots or dashes. pub fn segment_count(&self) -> usize { if let Some(local_index) = self.local_segment_index() { local_index diff --git a/crates/rattler_conda_types/src/version/parse.rs b/crates/rattler_conda_types/src/version/parse.rs index 4a933db5e1..b226351340 100644 --- a/crates/rattler_conda_types/src/version/parse.rs +++ b/crates/rattler_conda_types/src/version/parse.rs @@ -77,11 +77,11 @@ pub enum ParseVersionErrorKind { /// Expected a version component #[error("expected a version component e.g. `2` or `rc`")] ExpectedComponent, - /// Expected a segment seperator + /// Expected a segment separator #[error("expected a '.', '-', or '_'")] ExpectedSegmentSeparator, /// Cannot mix and match dashes and underscores - #[error("cannot use both underscores and dashes as version segment seperators")] + #[error("cannot use both underscores and dashes as version segment separators")] CannotMixAndMatchDashesAndUnderscores, /// Expected the end of the string #[error("encountered more characters but expected none")] diff --git a/crates/rattler_conda_types/src/version/snapshots/rattler_conda_types__version__parse__test__parse.snap b/crates/rattler_conda_types/src/version/snapshots/rattler_conda_types__version__parse__test__parse.snap index 526f09251e..8fd0f7aaad 100644 --- a/crates/rattler_conda_types/src/version/snapshots/rattler_conda_types__version__parse__test__parse.snap +++ b/crates/rattler_conda_types/src/version/snapshots/rattler_conda_types__version__parse__test__parse.snap @@ -43,13 +43,13 @@ expression: index_map }, ), "1-2-3_": Error( - "cannot use both underscores and dashes as version segment seperators", + "cannot use both underscores and dashes as version segment separators", ), "1-2_3": Error( - "cannot use both underscores and dashes as version segment seperators", + "cannot use both underscores and dashes as version segment separators", ), "1-_": Error( - "cannot use both underscores and dashes as version segment seperators", + "cannot use both underscores and dashes as version segment separators", ), "1.0.1-": Version( Version { @@ -79,7 +79,7 @@ expression: index_map }, ), "1_-": Error( - "cannot use both underscores and dashes as version segment seperators", + "cannot use both underscores and dashes as version segment separators", ), "1_2_3": Version( Version { diff --git a/crates/rattler_conda_types/src/version_spec/mod.rs b/crates/rattler_conda_types/src/version_spec/mod.rs index 93aa213b5d..067ef0e670 100644 --- a/crates/rattler_conda_types/src/version_spec/mod.rs +++ b/crates/rattler_conda_types/src/version_spec/mod.rs @@ -95,7 +95,7 @@ pub enum VersionOperators { Exact(EqualityOperator), } -/// Logical operator used two compare groups of version comparisions. E.g. +/// Logical operator used two compare groups of version comparisons. E.g. /// `>=3.4,<4.0` or `>=3.4|<4.0`, #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Ord, PartialOrd, Serialize, Deserialize)] pub enum LogicalOperator { diff --git a/crates/rattler_conda_types/src/version_spec/parse.rs b/crates/rattler_conda_types/src/version_spec/parse.rs index 62a829bdca..9c88f6d3f4 100644 --- a/crates/rattler_conda_types/src/version_spec/parse.rs +++ b/crates/rattler_conda_types/src/version_spec/parse.rs @@ -165,7 +165,7 @@ fn logical_constraint_parser( // sense (e.g. ``>=*``) but they do exist in the wild. This code here // tries to map it to something that at least makes some sort of sense. // But this is not the case for everything, for instance what - // what is ment with `!=*` or `<*`? + // what is meant with `!=*` or `<*`? // See: https://github.com/AnacondaRecipes/repodata-hotfixes/issues/220 if version_str == "*" { let op = op.expect( diff --git a/crates/rattler_conda_types/src/version_spec/version_tree.rs b/crates/rattler_conda_types/src/version_spec/version_tree.rs index f6b3892427..c5b2b5e5e1 100644 --- a/crates/rattler_conda_types/src/version_spec/version_tree.rs +++ b/crates/rattler_conda_types/src/version_spec/version_tree.rs @@ -194,7 +194,7 @@ impl<'a> TryFrom<&'a str> for VersionTree<'a> { } } - /// Parses a group of version constraints seperated by ,s + /// Parses a group of version constraints separated by ,s fn parse_and_group<'a, E: ParseError<&'a str> + ContextError<&'a str>>( input: &'a str, ) -> Result<(&'a str, VersionTree<'_>), nom::Err> { diff --git a/crates/rattler_lock/src/builder.rs b/crates/rattler_lock/src/builder.rs index 152c4dc7d0..9bedd32aa7 100644 --- a/crates/rattler_lock/src/builder.rs +++ b/crates/rattler_lock/src/builder.rs @@ -239,7 +239,7 @@ impl LockFileBuilder { version: FileFormatVersion::LATEST, conda_packages: self.conda_packages.into_iter().collect(), pypi_packages: self.pypi_packages.into_iter().collect(), - pypi_environment_package_datas: self + pypi_environment_package_data: self .pypi_runtime_configurations .into_iter() .map(Into::into) diff --git a/crates/rattler_lock/src/lib.rs b/crates/rattler_lock/src/lib.rs index 1e9169a8d6..29348ba746 100644 --- a/crates/rattler_lock/src/lib.rs +++ b/crates/rattler_lock/src/lib.rs @@ -137,7 +137,7 @@ struct LockFileInner { environments: Vec, conda_packages: Vec, pypi_packages: Vec, - pypi_environment_package_datas: Vec, + pypi_environment_package_data: Vec, environment_lookup: FxHashMap, } @@ -319,7 +319,7 @@ impl Environment { EnvironmentPackageData::Conda(_) => None, EnvironmentPackageData::Pypi(pkg_data_idx, env_data_idx) => Some(( self.inner.pypi_packages[*pkg_data_idx].clone(), - self.inner.pypi_environment_package_datas[*env_data_idx].clone(), + self.inner.pypi_environment_package_data[*env_data_idx].clone(), )), }) .collect(); @@ -392,7 +392,7 @@ impl Environment { EnvironmentPackageData::Conda(_) => None, EnvironmentPackageData::Pypi(package_idx, env_idx) => Some(( self.inner.pypi_packages[*package_idx].clone(), - self.inner.pypi_environment_package_datas[*env_idx].clone(), + self.inner.pypi_environment_package_data[*env_idx].clone(), )), }) .collect(), @@ -597,7 +597,7 @@ impl PypiPackage { /// Returns the runtime data from the internal data structure. fn environment_data(&self) -> &PypiPackageEnvironmentData { - &self.inner.pypi_environment_package_datas[self.runtime_index] + &self.inner.pypi_environment_package_data[self.runtime_index] } /// Returns the package data from the internal data structure. diff --git a/crates/rattler_lock/src/parse/deserialize.rs b/crates/rattler_lock/src/parse/deserialize.rs index 4e1ef2cf75..9cceef729d 100644 --- a/crates/rattler_lock/src/parse/deserialize.rs +++ b/crates/rattler_lock/src/parse/deserialize.rs @@ -156,7 +156,7 @@ pub fn parse_from_document( environment_lookup, conda_packages, pypi_packages, - pypi_environment_package_datas: pypi_runtime_lookup + pypi_environment_package_data: pypi_runtime_lookup .into_iter() .map(Into::into) .collect(), diff --git a/crates/rattler_lock/src/parse/serialize.rs b/crates/rattler_lock/src/parse/serialize.rs index c32ec4ccce..7812370dc8 100644 --- a/crates/rattler_lock/src/parse/serialize.rs +++ b/crates/rattler_lock/src/parse/serialize.rs @@ -247,7 +247,7 @@ impl Serialize for LockFile { ) => { let pypi_package = &inner.pypi_packages[pypi_index]; let pypi_runtime = &inner - .pypi_environment_package_datas + .pypi_environment_package_data [pypi_runtime_index]; SerializablePackageSelector::Pypi { pypi: &pypi_package.url_or_path, diff --git a/crates/rattler_lock/src/parse/v3.rs b/crates/rattler_lock/src/parse/v3.rs index 1d28b08227..1f0c47b926 100644 --- a/crates/rattler_lock/src/parse/v3.rs +++ b/crates/rattler_lock/src/parse/v3.rs @@ -216,7 +216,7 @@ pub fn parse_v3_or_lower( version, conda_packages: conda_packages.into_iter().collect(), pypi_packages: pypi_packages.into_iter().collect(), - pypi_environment_package_datas: pypi_runtime_configs + pypi_environment_package_data: pypi_runtime_configs .into_iter() .map(Into::into) .collect(), diff --git a/crates/rattler_package_streaming/src/read.rs b/crates/rattler_package_streaming/src/read.rs index c76b929a01..f39c221965 100644 --- a/crates/rattler_package_streaming/src/read.rs +++ b/crates/rattler_package_streaming/src/read.rs @@ -30,7 +30,7 @@ pub fn extract_tar_bz2( ) -> Result { std::fs::create_dir_all(destination).map_err(ExtractError::CouldNotCreateDestination)?; - // Wrap the reading in aditional readers that will compute the hashes of the file while its + // Wrap the reading in additional readers that will compute the hashes of the file while its // being read. let sha256_reader = rattler_digest::HashingReader::<_, rattler_digest::Sha256>::new(reader); let mut md5_reader = @@ -54,7 +54,7 @@ pub fn extract_conda_via_streaming( // Construct the destination path if it doesnt exist yet std::fs::create_dir_all(destination).map_err(ExtractError::CouldNotCreateDestination)?; - // Wrap the reading in aditional readers that will compute the hashes of the file while its + // Wrap the reading in additional readers that will compute the hashes of the file while its // being read. let sha256_reader = rattler_digest::HashingReader::<_, rattler_digest::Sha256>::new(reader); let mut md5_reader = diff --git a/crates/rattler_repodata_gateway/src/fetch/cache/cache_headers.rs b/crates/rattler_repodata_gateway/src/fetch/cache/cache_headers.rs index 8a7f96fc57..58f5658505 100644 --- a/crates/rattler_repodata_gateway/src/fetch/cache/cache_headers.rs +++ b/crates/rattler_repodata_gateway/src/fetch/cache/cache_headers.rs @@ -72,7 +72,7 @@ impl CacheHeaders { if let Some(last_modified) = self .last_modified .as_deref() - .and_then(|last_modifed| HeaderValue::from_str(last_modifed).ok()) + .and_then(|last_modified| HeaderValue::from_str(last_modified).ok()) { headers.insert(header::IF_MODIFIED_SINCE, last_modified); } diff --git a/crates/rattler_repodata_gateway/src/fetch/mod.rs b/crates/rattler_repodata_gateway/src/fetch/mod.rs index d91f55b048..6f57246877 100644 --- a/crates/rattler_repodata_gateway/src/fetch/mod.rs +++ b/crates/rattler_repodata_gateway/src/fetch/mod.rs @@ -889,7 +889,7 @@ fn validate_cached_state( return ValidatedCacheState::InvalidOrMissing; } Err(e) => { - // An error occured while reading the cached state. + // An error occurred while reading the cached state. tracing::warn!( "invalid repodata cache state '{}': {e}. Ignoring cached files...", cache_state_path.display() diff --git a/crates/rattler_repodata_gateway/src/gateway/mod.rs b/crates/rattler_repodata_gateway/src/gateway/mod.rs index cf04560687..7ff263e223 100644 --- a/crates/rattler_repodata_gateway/src/gateway/mod.rs +++ b/crates/rattler_repodata_gateway/src/gateway/mod.rs @@ -582,7 +582,7 @@ mod test { } #[tokio::test] - async fn test_flter_with_specs() { + async fn test_filter_with_specs() { let gateway = Gateway::new(); let index = local_conda_forge().await; diff --git a/crates/rattler_repodata_gateway/src/sparse/mod.rs b/crates/rattler_repodata_gateway/src/sparse/mod.rs index 9e192ce92f..a9d90ed0e0 100644 --- a/crates/rattler_repodata_gateway/src/sparse/mod.rs +++ b/crates/rattler_repodata_gateway/src/sparse/mod.rs @@ -487,7 +487,7 @@ mod test { Path::new(env!("CARGO_MANIFEST_DIR")).join("../../test-data") } - async fn default_repo_datas() -> Vec<(Channel, &'static str, PathBuf)> { + async fn default_repo_data() -> Vec<(Channel, &'static str, PathBuf)> { tokio::try_join!(fetch_repo_data("linux-64"), fetch_repo_data("noarch")).unwrap(); let channel_config = ChannelConfig::default_with_root_dir(std::env::current_dir().unwrap()); @@ -506,7 +506,7 @@ mod test { } async fn default_repo_data_bytes() -> Vec<(Channel, &'static str, Bytes)> { - default_repo_datas() + default_repo_data() .await .into_iter() .map(|(channel, subdir, path)| { @@ -517,10 +517,10 @@ mod test { } fn load_sparse_from_bytes( - repo_datas: &[(Channel, &'static str, Bytes)], + repo_data: &[(Channel, &'static str, Bytes)], package_names: impl IntoIterator>, ) -> Vec> { - let sparse: Vec<_> = repo_datas + let sparse: Vec<_> = repo_data .iter() .map(|(channel, subdir, bytes)| { SparseRepoData::from_bytes(channel.clone(), *subdir, bytes.clone(), None).unwrap() @@ -542,7 +542,7 @@ mod test { //"noarch-sha=05e0c4ce7be29f36949c33cce782f21aecfbdd41f9e3423839670fb38fc5d691" load_repo_data_recursively( - default_repo_datas().await, + default_repo_data().await, package_names .into_iter() .map(|name| PackageName::try_from(name.as_ref()).unwrap()), @@ -641,8 +641,8 @@ mod test { assert_eq!(total_records, 16065); // Bytes - let repo_datas = default_repo_data_bytes().await; - let sparse_empty_data = load_sparse_from_bytes(&repo_datas, package_names); + let repo_data = default_repo_data_bytes().await; + let sparse_empty_data = load_sparse_from_bytes(&repo_data, package_names); let total_records = sparse_empty_data.iter().map(Vec::len).sum::(); diff --git a/crates/rattler_shell/src/activation.rs b/crates/rattler_shell/src/activation.rs index fef51f2075..cc12d0b960 100644 --- a/crates/rattler_shell/src/activation.rs +++ b/crates/rattler_shell/src/activation.rs @@ -16,7 +16,7 @@ use rattler_conda_types::Platform; use crate::shell::{Shell, ShellScript}; -const ENV_START_SEPERATOR: &str = "____RATTLER_ENV_START____"; +const ENV_START_SEPARATOR: &str = "____RATTLER_ENV_START____"; /// Type of modification done to the `PATH` variable #[derive(Default, Clone)] @@ -135,7 +135,7 @@ pub enum ActivationError { #[error("Invalid json for environment vars: {0} in file {1:?}")] InvalidEnvVarFileJson(serde_json::Error, PathBuf), - /// An error that can occur wiht malformed JSON when parsing files in the + /// An error that can occur with malformed JSON when parsing files in the /// `env_vars.d` directory #[error("Malformed JSON: not a plain JSON object in file {file:?}")] InvalidEnvVarFileJsonNoObject { @@ -419,10 +419,10 @@ impl Activator { ShellScript::new(self.shell_type.clone(), self.platform); activation_detection_script .print_env()? - .echo(ENV_START_SEPERATOR)?; + .echo(ENV_START_SEPARATOR)?; activation_detection_script.append_script(&activation_script); activation_detection_script - .echo(ENV_START_SEPERATOR)? + .echo(ENV_START_SEPARATOR)? .print_env()?; // Create a temporary file that we can execute with our shell. @@ -460,9 +460,9 @@ impl Activator { let stdout = String::from_utf8_lossy(&activation_result.stdout); let (before_env, rest) = stdout - .split_once(ENV_START_SEPERATOR) + .split_once(ENV_START_SEPARATOR) .unwrap_or(("", stdout.as_ref())); - let (_, after_env) = rest.rsplit_once(ENV_START_SEPERATOR).unwrap_or(("", "")); + let (_, after_env) = rest.rsplit_once(ENV_START_SEPARATOR).unwrap_or(("", "")); // Parse both environments and find the difference let before_env = self.shell_type.parse_env(before_env); diff --git a/crates/rattler_shell/src/shell/mod.rs b/crates/rattler_shell/src/shell/mod.rs index b170045dc2..0c722d2cf9 100644 --- a/crates/rattler_shell/src/shell/mod.rs +++ b/crates/rattler_shell/src/shell/mod.rs @@ -91,7 +91,7 @@ pub trait Shell { PathModificationBehavior::Prepend => paths_vec.push(self.format_env_var(path_var)), } // Create the shell specific list of paths. - let paths_string = paths_vec.join(self.path_seperator(platform)); + let paths_string = paths_vec.join(self.path_separator(platform)); self.set_env_var(f, self.path_var(platform), paths_string.as_str()) } @@ -106,8 +106,8 @@ pub trait Shell { /// shell. fn create_run_script_command(&self, path: &Path) -> Command; - /// Path seperator - fn path_seperator(&self, platform: &Platform) -> &str { + /// Path separator + fn path_separator(&self, platform: &Platform) -> &str { if platform.is_unix() { ":" } else { @@ -249,7 +249,7 @@ impl Shell for Bash { PathModificationBehavior::Append => paths_vec.insert(0, self.format_env_var(path_var)), } // Create the shell specific list of paths. - let paths_string = paths_vec.join(self.path_seperator(platform)); + let paths_string = paths_vec.join(self.path_separator(platform)); self.set_env_var(f, self.path_var(platform), paths_string.as_str()) } @@ -918,7 +918,7 @@ mod tests { } #[test] - fn test_path_seperator() { + fn test_path_separator() { let mut script = ShellScript::new(Bash, Platform::Linux64); script .set_path( diff --git a/crates/rattler_solve/benches/bench.rs b/crates/rattler_solve/benches/bench.rs index 0101a547c2..824336ecf1 100644 --- a/crates/rattler_solve/benches/bench.rs +++ b/crates/rattler_solve/benches/bench.rs @@ -49,14 +49,14 @@ fn bench_solve_environment(c: &mut Criterion, specs: Vec<&str>) { let json_file = conda_json_path(); let json_file_noarch = conda_json_path_noarch(); - let sparse_repo_datas = vec![ + let sparse_repo_data = vec![ read_sparse_repodata(&json_file), read_sparse_repodata(&json_file_noarch), ]; let names = specs.iter().map(|s| s.name.clone().unwrap()); let available_packages = - SparseRepoData::load_records_recursive(&sparse_repo_datas, names, None).unwrap(); + SparseRepoData::load_records_recursive(&sparse_repo_data, names, None).unwrap(); #[cfg(feature = "libsolv_c")] group.bench_function("libsolv_c", |b| { diff --git a/crates/rattler_solve/src/libsolv_c/input.rs b/crates/rattler_solve/src/libsolv_c/input.rs index 0fb09c31f8..4a02db2674 100644 --- a/crates/rattler_solve/src/libsolv_c/input.rs +++ b/crates/rattler_solve/src/libsolv_c/input.rs @@ -53,7 +53,7 @@ pub fn add_solv_file(pool: &Pool, repo: &Repo<'_>, solv_bytes: &LibcByteSlice) { pub fn add_repodata_records<'a>( pool: &Pool, repo: &Repo<'_>, - repo_datas: impl IntoIterator, + repo_data: impl IntoIterator, exclude_newer: Option<&DateTime>, ) -> Result, SolveError> { // Sanity check @@ -84,7 +84,7 @@ pub fn add_repodata_records<'a>( let data = repo.add_repodata(); let mut solvable_ids = Vec::new(); - for (repo_data_index, repo_data) in repo_datas.into_iter().enumerate() { + for (repo_data_index, repo_data) in repo_data.into_iter().enumerate() { // Skip packages that are newer than the specified timestamp match (exclude_newer, repo_data.package_record.timestamp.as_ref()) { (Some(exclude_newer), Some(timestamp)) if *timestamp > *exclude_newer => continue, diff --git a/crates/rattler_solve/src/libsolv_c/wrapper/solve_problem.rs b/crates/rattler_solve/src/libsolv_c/wrapper/solve_problem.rs index ed0b40a924..cfdad1f5dc 100644 --- a/crates/rattler_solve/src/libsolv_c/wrapper/solve_problem.rs +++ b/crates/rattler_solve/src/libsolv_c/wrapper/solve_problem.rs @@ -30,7 +30,7 @@ pub enum SolveProblem { Pkg { dep: String }, /// Looking for a valid solution to the installation satisfiability expand to /// two solvables of same package that cannot be installed together. This is - /// a partial exaplanation of why one of the solvables (could be any of the + /// a partial explanation of why one of the solvables (could be any of the /// parent) cannot be installed. PkgConflicts { source: SolvableId, @@ -47,7 +47,7 @@ pub enum SolveProblem { }, /// A package dependency does not exist. /// Could be a wrong name or missing channel. - /// This is a partial exaplanation of why a specific solvable (could be any + /// This is a partial explanation of why a specific solvable (could be any /// of the parent) cannot be installed. PkgNothingProvidesDep { source: SolvableId, dep: String }, /// Express a dependency on source that is involved in explaining the @@ -61,7 +61,7 @@ pub enum SolveProblem { source: SolvableId, target: SolvableId, }, - /// Encounterd in the problems list from libsolv but unknown. + /// Encountered in the problems list from libsolv but unknown. /// Explicitly ignored until we do something with it. Update, } diff --git a/crates/rattler_solve/src/resolvo/mod.rs b/crates/rattler_solve/src/resolvo/mod.rs index e5fb193c7a..5daaf632c1 100644 --- a/crates/rattler_solve/src/resolvo/mod.rs +++ b/crates/rattler_solve/src/resolvo/mod.rs @@ -219,7 +219,7 @@ impl<'a> CondaDependencyProvider<'a> { let mut package_name_found_in_channel = HashMap::::new(); // Add additional records - for repo_datas in repodata { + for repo_data in repodata { // Iterate over all records and dedup records that refer to the same package // data but with different archive types. This can happen if you // have two variants of the same package but with different @@ -229,13 +229,13 @@ impl<'a> CondaDependencyProvider<'a> { // presented to this function to ensure that each solve is // deterministic. Iterating over HashMaps is not deterministic at // runtime so instead we store the values in a Vec as we iterate over the - // records. This guarentees that the order of records remains the same over + // records. This guarantees that the order of records remains the same over // runs. - let mut ordered_repodata = Vec::with_capacity(repo_datas.records.len()); + let mut ordered_repodata = Vec::with_capacity(repo_data.records.len()); let mut package_to_type: HashMap<&str, (ArchiveType, usize, bool)> = - HashMap::with_capacity(repo_datas.records.len()); + HashMap::with_capacity(repo_data.records.len()); - for record in repo_datas.records { + for record in repo_data.records { // Determine if this record will be excluded. let excluded = matches!((&exclude_newer, &record.package_record.timestamp), (Some(exclude_newer), Some(record_timestamp)) diff --git a/crates/rattler_solve/tests/backends.rs b/crates/rattler_solve/tests/backends.rs index 92372a4b49..3a903824f3 100644 --- a/crates/rattler_solve/tests/backends.rs +++ b/crates/rattler_solve/tests/backends.rs @@ -119,11 +119,11 @@ fn solve_real_world(specs: Vec<&str>) -> Vec { .map(|s| MatchSpec::from_str(s, ParseStrictness::Lenient).unwrap()) .collect::>(); - let sparse_repo_datas = read_real_world_repo_data(); + let sparse_repo_data = read_real_world_repo_data(); let names = specs.iter().filter_map(|s| s.name.as_ref().cloned()); let available_packages = - SparseRepoData::load_records_recursive(sparse_repo_datas, names, None).unwrap(); + SparseRepoData::load_records_recursive(sparse_repo_data, names, None).unwrap(); let solver_task = SolverTask { specs: specs.clone(), @@ -982,11 +982,11 @@ fn compare_solve(task: CompareTask<'_>) { .map(|s| MatchSpec::from_str(s, ParseStrictness::Lenient).unwrap()) .collect::>(); - let sparse_repo_datas = read_real_world_repo_data(); + let sparse_repo_data = read_real_world_repo_data(); let names = specs.iter().filter_map(|s| s.name.as_ref().cloned()); let available_packages = - SparseRepoData::load_records_recursive(sparse_repo_datas, names, None).unwrap(); + SparseRepoData::load_records_recursive(sparse_repo_data, names, None).unwrap(); let extract_pkgs = |records: Vec| { let mut pkgs = records diff --git a/crates/rattler_virtual_packages/src/lib.rs b/crates/rattler_virtual_packages/src/lib.rs index 7afd72fe98..f63913c8c8 100644 --- a/crates/rattler_virtual_packages/src/lib.rs +++ b/crates/rattler_virtual_packages/src/lib.rs @@ -106,7 +106,7 @@ pub trait EnvOverride: Sized { /// package. const DEFAULT_ENV_NAME: &'static str; - /// Detect the virutal package for the current system. + /// Detect the virtual package for the current system. /// This method is here so that `::current` always /// returns the same error type. `current` may return different types of /// errors depending on the virtual package. This one always returns @@ -227,7 +227,7 @@ pub enum DetectVirtualPackageError { /// Configure the overrides used in this crate. /// /// The default value is `None` for all overrides which means that by default -/// none of the virtual packages are overriden. +/// none of the virtual packages are overridden. /// /// Use `VirtualPackageOverrides::from_env()` to create an instance of this /// struct with all overrides set to the default environment variables. diff --git a/crates/tools/src/test_files.rs b/crates/tools/src/test_files.rs index a803444887..b93a9cc338 100644 --- a/crates/tools/src/test_files.rs +++ b/crates/tools/src/test_files.rs @@ -83,7 +83,7 @@ pub fn download_and_cache_file(url: Url, expected_sha256: &str) -> Result None: @classmethod def _from_ffi_object(cls, client: PyAuthenticatedClient) -> AuthenticatedClient: """ - Construct py-rattler AuthenticatedClient from PyAutheticatedClient FFI object. + Construct py-rattler AuthenticatedClient from PyAuthenticatedClient FFI object. """ authenticated_client = cls.__new__(cls) authenticated_client._client = client diff --git a/py-rattler/rattler/repo_data/gateway.py b/py-rattler/rattler/repo_data/gateway.py index 33721b152c..99bc2bc9ee 100644 --- a/py-rattler/rattler/repo_data/gateway.py +++ b/py-rattler/rattler/repo_data/gateway.py @@ -70,8 +70,8 @@ class Gateway: The gateway can also easily be used concurrently, as it is designed to be thread-safe. When two threads are querying the same channel at the same time, - their requests are coallesced into a single request. This is done to reduce the - number of requests made to the remote server and reduce the overal memory usage. + their requests are coalesced into a single request. This is done to reduce the + number of requests made to the remote server and reduce the overall memory usage. The gateway caches the repodata internally, so if the same channel is queried multiple times the records will only be fetched once. However, the conversion diff --git a/py-rattler/src/generic_virtual_package.rs b/py-rattler/src/generic_virtual_package.rs index 2b6593594b..9fc15fc211 100644 --- a/py-rattler/src/generic_virtual_package.rs +++ b/py-rattler/src/generic_virtual_package.rs @@ -45,7 +45,7 @@ impl PyGenericVirtualPackage { } } - /// Contructs a string representation. + /// Constructs a string representation. pub fn as_str(&self) -> String { format!("{}", self.inner) } diff --git a/py-rattler/src/record.rs b/py-rattler/src/record.rs index 66b8d5ee22..ab3b260fc9 100644 --- a/py-rattler/src/record.rs +++ b/py-rattler/src/record.rs @@ -305,10 +305,10 @@ impl TryFrom for PrefixRecord { match value.inner { RecordInner::Prefix(r) => Ok(r), RecordInner::RepoData(_) => Err(PyTypeError::new_err( - "connot use object of type 'RepoDataRecord' as 'PrefixRecord'", + "cannot use object of type 'RepoDataRecord' as 'PrefixRecord'", )), RecordInner::Package(_) => Err(PyTypeError::new_err( - "connot use object of type 'PackageRecord' as 'PrefixRecord'", + "cannot use object of type 'PackageRecord' as 'PrefixRecord'", )), } } @@ -346,7 +346,7 @@ impl TryFrom for RepoDataRecord { RecordInner::Prefix(r) => Ok(r.repodata_record), RecordInner::RepoData(r) => Ok(r), RecordInner::Package(_) => Err(PyTypeError::new_err( - "connot use object of type 'PackageRecord' as 'RepoDataRecord'", + "cannot use object of type 'PackageRecord' as 'RepoDataRecord'", )), } } diff --git a/py-rattler/src/virtual_package.rs b/py-rattler/src/virtual_package.rs index 31e83b1f2e..06c639ce42 100644 --- a/py-rattler/src/virtual_package.rs +++ b/py-rattler/src/virtual_package.rs @@ -141,7 +141,7 @@ impl From for VirtualPackage { impl PyVirtualPackage { /// Returns virtual packages detected for the current system or an error if the versions could /// not be properly detected. - // marking this as depreacted causes a warning when building the code, + // marking this as deprecated causes a warning when building the code, // we just warn directly from python. #[staticmethod] pub fn current() -> PyResult> {