Skip to content

Commit

Permalink
fix: clean up docs a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Sep 26, 2023
1 parent 5c3a101 commit fae7afa
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
4 changes: 1 addition & 3 deletions crates/rattler_installs_packages/benches/html.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
use rattler_installs_packages::html::{
parse_package_names_html, parse_project_info_html,
};
use rattler_installs_packages::html::{parse_package_names_html, parse_project_info_html};
use std::str::FromStr;
use url::Url;

Expand Down
5 changes: 1 addition & 4 deletions crates/rattler_installs_packages/src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.


use std::{borrow::Borrow, default::Default};

use crate::{ArtifactHashes, ArtifactName};
Expand Down Expand Up @@ -42,9 +41,7 @@ pub fn into_artifact_info(base: &Url, tag: &HTMLTag) -> Option<ArtifactInfo> {
// Join with base
let url = base.join(href.as_ref()).ok()?;
let filename = url.path_segments().and_then(|mut s| s.next_back());
let filename: ArtifactName = filename
.map(|s| s.parse())?
.ok()?;
let filename: ArtifactName = filename.map(|s| s.parse())?.ok()?;

// We found a valid link
let hash = url.fragment().and_then(parse_hash);
Expand Down
17 changes: 11 additions & 6 deletions crates/rattler_installs_packages/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod artifact;
pub mod artifact_name;
pub mod core_metadata;
mod artifact_name;
mod core_metadata;
mod extra;
mod file_store;
pub mod html;
Expand All @@ -9,7 +9,7 @@ mod package_database;
mod package_name;
mod project_info;
mod reqparse;
pub mod requirement;
mod requirement;
mod rfc822ish;
mod seek_slice;
mod specifier;
Expand All @@ -19,10 +19,15 @@ pub use file_store::{CacheKey, FileStore};
pub use package_database::PackageDb;

pub use artifact::{Artifact, MetadataArtifact, Wheel};
pub use artifact_name::ArtifactName;
pub use artifact_name::{
ArtifactName, BuildTag, InnerAsArtifactName, ParseArtifactNameError, SDistFormat, SDistName,
WheelName,
};
pub use extra::Extra;
pub use package_name::{NormalizedPackageName, PackageName, ParsePackageNameError};
pub use pep440::Version;
pub use project_info::{ArtifactHashes, ArtifactInfo, DistInfoMetadata, Meta, Yanked};
pub use requirement::PackageRequirement;
pub use project_info::{ArtifactHashes, ArtifactInfo, DistInfoMetadata, Meta, ProjectInfo, Yanked};
pub use requirement::{
marker, PackageRequirement, ParseExtra, PythonRequirement, Requirement, UserRequirement,
};
pub use specifier::{CompareOp, Specifier, Specifiers};
4 changes: 2 additions & 2 deletions crates/rattler_installs_packages/src/package_database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use pep440::Version;
use reqwest::{header::CACHE_CONTROL, Client, StatusCode};
use std::borrow::Borrow;
use std::fmt::Display;
use std::io::{Read};
use std::io::Read;
use std::path::PathBuf;
use url::Url;

Expand Down Expand Up @@ -311,8 +311,8 @@ async fn fetch_simple_api(http: &Http, url: Url) -> miette::Result<Option<Projec
mod test {
use super::*;
use crate::artifact::Wheel;
use tempfile::TempDir;
use crate::PackageName;
use tempfile::TempDir;

#[tokio::test]
async fn test_available_packages() {
Expand Down
2 changes: 1 addition & 1 deletion crates/rip/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use resolvo::{DefaultSolvableDisplay, DependencyProvider, Solver};
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use url::Url;

use rattler_installs_packages::{requirement::Requirement, PackageRequirement};
use rattler_installs_packages::{PackageRequirement, Requirement};
use rip::{
pypi_provider::{PypiDependencyProvider, PypiPackageName},
writer::{global_multi_progress, IndicatifWriter},
Expand Down
4 changes: 2 additions & 2 deletions crates/rip/src/pypi_provider.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rattler_installs_packages::requirement::Requirement;
use rattler_installs_packages::{
CompareOp, Extra, NormalizedPackageName, PackageDb, Specifier, Specifiers, Version, Wheel,
CompareOp, Extra, NormalizedPackageName, PackageDb, Requirement, Specifier, Specifiers,
Version, Wheel,
};
use resolvo::{
Candidates, Dependencies, DependencyProvider, NameId, Pool, SolvableId, SolverCache, VersionSet,
Expand Down
1 change: 1 addition & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.72

0 comments on commit fae7afa

Please sign in to comment.