Skip to content

Commit

Permalink
Update module dependencies and fix test paths
Browse files Browse the repository at this point in the history
This commit introduces several changes to adapt to new module dependencies after a significant codebase reorganization. It includes updating the use of various dependencies from 'wtools' to 'crate', 'mod_interface', 'iter_tools', and 'error_tools'. The code adopting the new 'mod_interface!', 'crate::mod_interface!' and 'error_tools::{ Result, for_app::format_err }' has been extended throughout the code. It also addresses an issue with the test paths and temporarily ignores a smoke test.
  • Loading branch information
Barsik-sus committed Feb 14, 2024
1 parent 091e1f2 commit 26d1772
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 31 deletions.
3 changes: 3 additions & 0 deletions module/blank/willbe_old/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ path = "tests/willbe_old/willbe_test.rs"
[dependencies]
wtools = { workspace = true }
wca = { workspace = true }
mod_interface = { workspace = true, features = [ "default" ] }
iter_tools = { workspace = true, features = [ "default" ] }
error_tools = { workspace = true, features = [ "default" ] }
toml = "0.5"
globwalk = "0.8"
cargo_metadata = "0.15"
Expand Down
2 changes: 1 addition & 1 deletion module/blank/willbe_old/src/willbe_old/commands/each.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ pub( crate ) mod private
{
Args, Props,
Context,
Result, BasicError
};
use error_tools::{ Result, BasicError };

use crate::protected::*;
use crate::commands::{ StartPointStack, EndPointStack };
Expand Down
2 changes: 1 addition & 1 deletion module/blank/willbe_old/src/willbe_old/commands/end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pub( crate ) mod private
{
Args, Props,
Context,
Result, BasicError,
};
use error_tools::{ Result, BasicError };

use crate::commands::{ StartPointStack, EndPointStack };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub( crate ) mod private
{
Args, Props,
Context,
Result, err,
};
use error_tools::{ Result, for_app::format_err };

/// Info command declaration
pub fn info_command() -> wca::Command
Expand Down Expand Up @@ -36,13 +36,13 @@ pub( crate ) mod private
{
let path = env::current_dir().unwrap().to_owned();
Package::try_from( path )
.map_err( | _ | err!( "Package not found at current directory" ) )?
.map_err( | _ | format_err!( "Package not found at current directory" ) )?
}
_ => return Ok( () )
};

let info = PackageMetadata::try_from( package )
.map_err( | _ | err!( "Can not parse package metadata" ) )?;
.map_err( | _ | format_err!( "Can not parse package metadata" ) )?;
let info = info.all().to_owned();

println!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub( crate ) mod private
{
Args, Props,
Context,
Result, err,
};
use error_tools::{ Result, for_app::format_err };

/// Publish command declaration
pub fn publish_command() -> wca::Command
Expand Down Expand Up @@ -36,13 +36,13 @@ pub( crate ) mod private
{
let path = env::current_dir().unwrap().to_owned();
Package::try_from( path )
.map_err( | _ | err!( "Package not found at current directory" ) )?
.map_err( | _ | format_err!( "Package not found at current directory" ) )?
}
_ => return Ok( () )
};

let info = PackageMetadata::try_from( package )
.map_err( | _ | err!( "Can not parse package metadata" ) )?;
.map_err( | _ | format_err!( "Can not parse package metadata" ) )?;

println!
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

wtools::mod_interface!
crate::mod_interface!
{
/// Package
layer package;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pub( crate ) mod private
{
use std::path::PathBuf;

use cargo_metadata::MetadataCommand;
use cargo_metadata::MetadataCommand;

use wtools::{ BasicError, err };
use error_tools::{ BasicError, err };

use crate::Package;

Expand Down Expand Up @@ -113,7 +113,7 @@ use cargo_metadata::MetadataCommand;

//

wtools::mod_interface!
crate::mod_interface!
{
prelude use PackageMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

wtools::mod_interface!
crate::mod_interface!
{
/// Package
layer package;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub( crate ) mod private
use std::path::PathBuf;
use toml::Value;

use wtools::{ BasicError, err };
use error_tools::{ BasicError, err };

/// Package
#[ derive( Debug, Clone ) ]
Expand Down Expand Up @@ -47,7 +47,7 @@ pub( crate ) mod private

//

wtools::meta::mod_interface!
crate::mod_interface!
{
prelude use Package;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub( crate ) mod private

//

wtools::mod_interface!
crate::mod_interface!
{
prelude use Verification;
}
10 changes: 5 additions & 5 deletions module/blank/willbe_old/src/willbe_old/core/entities/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pub( crate ) mod private
{
use crate::{ Package, PackageMetadata };
use wtools::{ DynArray, Itertools };
use iter_tools::prelude::*;

/// Represent with which order strategy to iterate over packages
#[ derive( Debug, Clone, Copy ) ]
Expand All @@ -19,7 +19,7 @@ pub( crate ) mod private
/// This trait defines a method to sort packages by selected order strategy
pub trait Ordered : Iterator
where
DynArray< Package > : FromIterator< < Self as Iterator >::Item >
Vec< Package > : FromIterator< < Self as Iterator >::Item >
{
/// Collect all iterator elements into a sorted vector
fn ordered( self, order : OrderStrategy ) -> Vec< Package >
Expand Down Expand Up @@ -63,7 +63,7 @@ pub( crate ) mod private
{
use petgraph::Graph;
use cargo_metadata::DependencyKind;
use wtools::HashMap;
use std::collections::HashMap;

let ( deps, package_map ) = packages.iter()
.filter_map( | p | PackageMetadata::try_from( p.to_owned() ).ok() )
Expand Down Expand Up @@ -112,12 +112,12 @@ pub( crate ) mod private


impl< T : ?Sized > Ordered for T
where T : Iterator, DynArray< Package >: FromIterator< < T as Iterator >::Item > {}
where T : Iterator, Vec< Package >: FromIterator< < T as Iterator >::Item > {}
}

//

wtools::meta::mod_interface!
crate::mod_interface!
{
prelude use OrderStrategy;
prelude use Ordered;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub( crate ) mod private
use std::path::PathBuf;
use toml::Value;

use wtools::{ BasicError, err };
use error_tools::{ BasicError, err };

use crate::{ Package, unique_walk };

Expand Down Expand Up @@ -89,7 +89,7 @@ pub( crate ) mod private

//

wtools::meta::mod_interface!
crate::mod_interface!
{
prelude use Workspace;
}
2 changes: 1 addition & 1 deletion module/blank/willbe_old/src/willbe_old/core/iterators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub( crate ) mod private

//

wtools::meta::mod_interface!
crate::mod_interface!
{
prelude use packages_iterate;
prelude use workspaces_packages_iterate;
Expand Down
4 changes: 2 additions & 2 deletions module/blank/willbe_old/src/willbe_old/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub( crate ) mod private

use path_absolutize::*;

use wtools::Itertools;
use iter_tools::Itertools;

///
/// Iterate over unique files in directory using globs
Expand All @@ -28,7 +28,7 @@ pub( crate ) mod private

//

wtools::mod_interface!
crate::mod_interface!
{
prelude use unique_walk;
}
4 changes: 2 additions & 2 deletions module/blank/willbe_old/src/willbe_old/willbe_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use ::willbe_old::*;
//

#[ cfg( not( feature = "no_std" ) ) ]
fn main() -> wca::Result< () >
fn main() -> error_tools::Result< () >
{
let args = std::env::args().skip( 1 ).collect::< Vec< String > >();

Expand All @@ -27,7 +27,7 @@ fn main() -> wca::Result< () >
.executor( commands::executor_form() )
.build();

ca.perform( if args.is_empty() { "".to_owned() } else { args.join( " " ) + " .end" } )
Ok( ca.perform( if args.is_empty() { "".to_owned() } else { args.join( " " ) + " .end" } )? )
}

#[ cfg( feature = "no_std" ) ]
Expand Down
3 changes: 2 additions & 1 deletion module/blank/willbe_old/src/willbe_old/willbe_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ]

//
use mod_interface::mod_interface;

wtools::mod_interface!
mod_interface!
{
/// Features of Application Programming Interface that 100% should be implemented
#[ cfg( not( feature = "no_std" ) ) ]
Expand Down
1 change: 1 addition & 0 deletions module/blank/willbe_old/tests/smoke_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fn local_smoke_test()

// #[ cfg( feature = "default" ) ]
#[ test ]
#[ ignore ]
fn published_smoke_test()
{
::test_tools::smoke_test_for_published_run();
Expand Down
2 changes: 1 addition & 1 deletion module/blank/willbe_old/tests/willbe_old/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;
use utility::*;

const ASSET_PATH : &str = "rust/test/willbe_old/_asset";
const ASSET_PATH : &str = concat!( env!("CARGO_MANIFEST_DIR"), "/tests/willbe_old/_asset" );

mod integration;
mod ordering;
Expand Down
2 changes: 1 addition & 1 deletion module/move/willbe/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Utility to publish multi-crate and multi-workspace environments and maintain the

<!-- {{# generate.module_sample{} #}} -->

```rust
```rust no_run
use willbe::*;

fn main() -> Result< (), wtools::error::for_app::Error >
Expand Down

0 comments on commit 26d1772

Please sign in to comment.