diff --git a/Cargo.lock b/Cargo.lock index b95f307863..d36ee0baec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -10228,7 +10228,6 @@ dependencies = [ "indexmap 2.6.0", "itertools 0.12.1", "num-bigint 0.4.6", - "papyrus_proc_macros", "pretty_assertions", "primitive-types", "rstest", diff --git a/crates/blockifier/src/test_utils/cairo_compile.rs b/crates/blockifier/src/test_utils/cairo_compile.rs index 9d22166540..14c26b0636 100644 --- a/crates/blockifier/src/test_utils/cairo_compile.rs +++ b/crates/blockifier/src/test_utils/cairo_compile.rs @@ -83,7 +83,7 @@ pub fn cairo1_compiler_tag() -> String { /// overridden by the environment variable (otherwise, the default is used). fn local_cairo1_compiler_repo_path() -> PathBuf { // Location of blockifier's Cargo.toml. - let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + let manifest_dir = env!("CARGO_MANIFEST_DIR"); Path::new(&manifest_dir).join( env::var(CAIRO1_REPO_RELATIVE_PATH_OVERRIDE_ENV_VAR) @@ -217,7 +217,7 @@ fn verify_cairo0_compiler_deps() { } else { format!("installed version: {cairo_lang_version}") }, - env::var("CARGO_MANIFEST_DIR").unwrap(), + env!("CARGO_MANIFEST_DIR"), CAIRO0_PIP_REQUIREMENTS_FILE ); } diff --git a/crates/starknet_api/Cargo.toml b/crates/starknet_api/Cargo.toml index cb9b0095f2..e04f457c96 100644 --- a/crates/starknet_api/Cargo.toml +++ b/crates/starknet_api/Cargo.toml @@ -18,7 +18,6 @@ hex.workspace = true indexmap = { workspace = true, features = ["serde"] } itertools.workspace = true num-bigint.workspace = true -papyrus_proc_macros.workspace = true pretty_assertions.workspace = true primitive-types = { workspace = true, features = ["serde"] } semver.workspace = true @@ -35,5 +34,6 @@ thiserror.workspace = true assert_matches.workspace = true rstest.workspace = true + [lints] workspace = true diff --git a/crates/starknet_api/src/test_utils.rs b/crates/starknet_api/src/test_utils.rs index 66a3e9d09b..87ba2be4fd 100644 --- a/crates/starknet_api/src/test_utils.rs +++ b/crates/starknet_api/src/test_utils.rs @@ -2,7 +2,6 @@ use std::collections::HashMap; use std::fs::read_to_string; use std::path::{Path, PathBuf}; -use papyrus_proc_macros::generate_get_package_dir; use serde::{Deserialize, Serialize}; use serde_json::to_string_pretty; use starknet_types_core::felt::Felt; @@ -17,13 +16,11 @@ pub mod deploy_account; pub mod invoke; pub mod l1_handler; -generate_get_package_dir!(); - -/// Returns the path to a file in the resources directory. This assumes the package directory has a -/// `resources` folder. The value for file_path should be the path to the required file in the -/// folder "resources". +/// Returns the path to a file in the resources directory. This assumes the current working +/// directory has a `resources` folder. The value for file_path should be the path to the required +/// file in the folder "resources". pub fn path_in_resources>(file_path: P) -> PathBuf { - PathBuf::from(get_package_dir()).join("resources").join(file_path) + std::env::current_dir().unwrap().join("resources").join(file_path) } /// Reads from the directory containing the manifest at run time, same as current working directory. diff --git a/crates/starknet_sierra_compile/src/build_utils.rs b/crates/starknet_sierra_compile/src/build_utils.rs index 279668e2e4..cb77e5ea80 100644 --- a/crates/starknet_sierra_compile/src/build_utils.rs +++ b/crates/starknet_sierra_compile/src/build_utils.rs @@ -36,5 +36,5 @@ pub fn output_file_path() -> String { #[cfg(feature = "cairo_native")] pub fn repo_root_dir() -> PathBuf { - Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("../..").to_path_buf() + Path::new(env!("CARGO_MANIFEST_DIR")).join("../..").to_path_buf() }