Skip to content

Commit

Permalink
fix: index to seperate crate and ci issues
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Sep 26, 2023
1 parent fae7afa commit b0f24d0
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/rust-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
CARGO_TERM_COLOR: always
DEFAULT_FEATURES:

jobs:
check-rustdoc-links:
Expand Down Expand Up @@ -105,7 +104,6 @@ jobs:
run: >
cargo build
--all-targets
--features ${{ env.DEFAULT_FEATURES }}
${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS}}
- name: Disable testing the tools crate if cross compiling
Expand All @@ -119,7 +117,6 @@ jobs:
run: >
cargo test
--workspace
--features ${{ env.DEFAULT_FEATURES }}
${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS}}
${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
--
Expand Down
20 changes: 20 additions & 0 deletions Cargo.lock

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

32 changes: 32 additions & 0 deletions crates/index/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "index"
authors = ["Tim de Jager <[email protected]>"]
version.workspace = true
categories.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
edition.workspace = true
readme.workspace = true
rust-version.workspace = true

[dependencies]
clap = { version = "4.3.23", features = ["derive"] }
dirs = "5.0.1"
indexmap = "2.0.0"
indicatif = "0.17.6"
miette = { version = "5.10.0", features = ["fancy"] }
rand = "0.8.4"
rattler_installs_packages = { path = "../rattler_installs_packages" }
rip = { path = "../rip" }
rusqlite = { version = "0.29.0", features = ["bundled"] }
serde_json = "1.0.107"
tokio = { version = "1.29.1", features = ["rt", "macros", "rt-multi-thread"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
url = "2.4.0"


[package.metadata.release]
# Dont publish the binary
release = false
6 changes: 3 additions & 3 deletions crates/rip/src/bin/index.rs → crates/index/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub async fn index(index_url: Url) -> Result<(), miette::Error> {
&[normalize_index_url(index_url)],

Check warning on line 51 in crates/index/src/main.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/rattler_installs_packages/rattler_installs_packages/crates/index/src/main.rs
cache_dir.clone(),
)
.into_diagnostic()?;
.into_diagnostic()?;

let mut names = package_db.get_package_names().await?;
names.shuffle(&mut rand::thread_rng());
Expand All @@ -65,7 +65,7 @@ pub async fn index(index_url: Url) -> Result<(), miette::Error> {
"CREATE UNIQUE INDEX IF NOT EXISTS idx_name_version ON `metadata` (`name`, `version`)",

Check warning on line 65 in crates/index/src/main.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/rattler_installs_packages/rattler_installs_packages/crates/index/src/main.rs
(),
)
.into_diagnostic()?;
.into_diagnostic()?;

let mut insert_stmt = conn.prepare("INSERT INTO metadata (name, version, requires_dist, requires_python, extras) VALUES (?, ?, ?, ?, ?)").into_diagnostic()?;
let mut request = conn
Expand Down Expand Up @@ -180,7 +180,7 @@ pub fn query_extras() -> Result<(), miette::Error> {
let requires_dist = serde_json::from_str::<Vec<PackageRequirement>>(

Check warning on line 180 in crates/index/src/main.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/rattler_installs_packages/rattler_installs_packages/crates/index/src/main.rs
requirement.into_diagnostic()?.as_str(),
)
.into_diagnostic()?;
.into_diagnostic()?;
total += requires_dist.len();
for req in requires_dist {
if !req.extras.is_empty() {
Expand Down
9 changes: 4 additions & 5 deletions crates/rattler_installs_packages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,19 @@ serde_with = "3.0.0"
smallvec = { version = "1.11.0", features = ["const_generics", "const_new"] }
tempfile = "3.6.0"
thiserror = "1.0.43"
tl = "0.7.7"
tokio = { version = "1.29.1" }
tokio-util = { version = "0.7.8", features = ["compat"] }
tracing = { version = "0.1.37", default-features = false, features = ["attributes"] }
url = { version = "2.4.0", features = ["serde"] }
zip = "0.6.6"
tl = "0.7.7"


[dev-dependencies]
tokio = { version = "1.29.1", features = ["rt", "macros"] }
miette = { version = "5.9.0", features = ["fancy"] }
criterion = "0.3"
insta = { version = "1.30.0", features = ["ron"] }
miette = { version = "5.9.0", features = ["fancy"] }
once_cell = "1.18.0"
criterion = "0.3"
tokio = { version = "1.29.1", features = ["rt", "macros"] }

[[bench]]
name = "html"
Expand Down
19 changes: 7 additions & 12 deletions crates/rip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ license.workspace = true
readme.workspace = true
default-run = "rip"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
name = "index"

[dependencies]
clap = { version = "4.3.23", features = ["derive"] }
console = { version = "0.15.7", features = ["windows-console-colors"] }
Expand All @@ -24,19 +19,19 @@ indexmap = "2.0.0"
indicatif = "0.17.6"
itertools = "0.11.0"
miette = { version = "5.10.0", features = ["fancy"] }
rand = "0.8.4"
rattler_installs_packages = { path = "../rattler_installs_packages" }
resolvo = "0.1.0"
reqwest = "0.11.19"
resolvo = "0.1.0"
rusqlite = { version = "0.29.0", features = ["bundled"] }
serde = "1.0.188"
serde_json = "1.0.107"
serde_with = "3.0.0"
tabwriter = { version = "1.2.1", features = ["ansi_formatting"] }
tokio = { version = "1.29.1", features = ["rt", "macros", "rt-multi-thread"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"]}
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
url = "2.4.0"
rand = "0.8.4"
serde = "1.0.188"
serde_with = "3.0.0"
serde_json = "1.0.107"
rusqlite = { version = "0.29.0", features = ["bundled"] }

[package.metadata.release]
# Dont publish the binary
Expand Down

0 comments on commit b0f24d0

Please sign in to comment.