Skip to content

Commit

Permalink
Use workspace deps
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Oct 25, 2023
1 parent d25193c commit a625806
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 34 deletions.
20 changes: 11 additions & 9 deletions crates/puffin-build-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#![allow(clippy::print_stdout, clippy::print_stderr)]

use std::env;
use std::path::PathBuf;
use std::process::ExitCode;
use std::time::Instant;

use anyhow::{Context, Result};
use clap::Parser;
use colored::Colorize;
use directories::ProjectDirs;
use fs_err as fs;
use platform_host::Platform;
use puffin_build::SourceDistributionBuilder;
use puffin_client::RegistryClientBuilder;
use puffin_dispatch::BuildDispatch;
use puffin_interpreter::PythonExecutable;
use std::env;
use std::path::PathBuf;
use std::process::ExitCode;
use std::time::Instant;
use tracing::debug;
use tracing_subscriber::fmt::format::FmtSpan;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use tracing_subscriber::{fmt, EnvFilter};

use platform_host::Platform;
use puffin_build::SourceDistributionBuilder;
use puffin_client::RegistryClientBuilder;
use puffin_dispatch::BuildDispatch;
use puffin_interpreter::PythonExecutable;

#[derive(Parser)]
struct Args {
/// Base python in a way that can be found with `which`
Expand Down
2 changes: 1 addition & 1 deletion crates/puffin-build-cli/test_sdist_building.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ RUST_LOG=puffin_build=debug cargo run -p puffin-build-cli --bin puffin-build-cli
# Check that pip accepts the wheels. It would be better to do functional checks
virtualenv -p 3.8 -q --clear sdist_building_test_data/.venv
sdist_building_test_data/.venv/bin/pip install -q --no-deps sdist_building_test_data/wheels/geoextract-0.3.1-py3-none-any.whl
sdist_building_test_data/.venv/bin/pip install -q --no-deps sdist_building_test_data/wheels/tqdm-4.66.1-py3-none-any.whl
sdist_building_test_data/.venv/bin/pip install -q --no-deps sdist_building_test_data/wheels/tqdm-4.66.1-py3-none-any.whl
18 changes: 8 additions & 10 deletions crates/puffin-dispatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
name = "puffin-dispatch"
version = "0.1.0"
description = "Avoid cyclic crate dependencies between resolver, installer and builder"
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
documentation.workspace = true
repository.workspace = true
authors.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
edition = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
documentation = { workspace = true }
repository = { workspace = true }
authors = { workspace = true }
license = { workspace = true }

[dependencies]
gourgeist = { path = "../gourgeist" }
Expand All @@ -28,4 +26,4 @@ puffin-traits = { path = "../puffin-traits" }
anyhow = { workspace = true }
itertools = { workspace = true }
tempfile = { workspace = true }
tracing = { workspace = true }
tracing = { workspace = true }
2 changes: 1 addition & 1 deletion crates/puffin-dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::pin::Pin;
use anyhow::Context;
use itertools::Itertools;
use tempfile::tempdir;
use tracing::debug;

use gourgeist::Venv;
use pep508_rs::Requirement;
Expand All @@ -27,6 +26,7 @@ use puffin_installer::{
use puffin_interpreter::PythonExecutable;
use puffin_resolver::{ResolutionMode, Resolver, WheelFinder};
use puffin_traits::BuildContext;
use tracing::debug;

/// The main implementation of [`BuildContext`], used by the CLI, see [`BuildContext`]
/// documentation.
Expand Down
18 changes: 8 additions & 10 deletions crates/puffin-traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
[package]
name = "puffin-traits"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
documentation.workspace = true
repository.workspace = true
authors.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
edition = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
documentation = { workspace = true }
repository = { workspace = true }
authors = { workspace = true }
license = { workspace = true }

[dependencies]
gourgeist = { path = "../gourgeist" }
pep508_rs = { path = "../pep508-rs" }
puffin-interpreter = { path = "../puffin-interpreter" }

anyhow = "1.0.75"
anyhow = { workspace = true }
7 changes: 4 additions & 3 deletions crates/puffin-traits/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//! Avoid cyclic crate dependencies between resolver, installer and builder.
use gourgeist::Venv;
use pep508_rs::Requirement;
use puffin_interpreter::PythonExecutable;
use std::future::Future;
use std::path::Path;
use std::pin::Pin;

use gourgeist::Venv;
use pep508_rs::Requirement;
use puffin_interpreter::PythonExecutable;

/// Avoid cyclic crate dependencies between resolver, installer and builder.
///
/// To resolve the dependencies of a packages, we may need to build one or more source
Expand Down

0 comments on commit a625806

Please sign in to comment.