-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "deps check all" command #388
Changes from 1 commit
d42df24
3306bc1
fca22c9
45375a9
57cace9
11f0f0d
1ece80a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,7 +253,24 @@ def is_installed(self, tag: str) -> bool: | |
logger.info(f"which twiggy: {which_twiggy}") | ||
|
||
dependencies = [which_rustc, which_cargo, which_sc_meta, which_wasm_opt, which_twiggy] | ||
return all(dependency is not None for dependency in dependencies) | ||
installed = all(dependency is not None for dependency in dependencies) | ||
|
||
if installed: | ||
actual_version_installed = self._get_actual_installed_version() | ||
|
||
if tag in actual_version_installed: | ||
logger.info(f"[{self.key} {tag}] is installed.") | ||
elif "Command 'rustup' not found" in actual_version_installed: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error message might look differently on MacOS. E.g.
Thus, we can check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. Now the |
||
show_warning("You have installed Rust without using `rustup`.") | ||
else: | ||
show_warning(f"The Rust version you have installed does not match the recommended version.\nInstalled [{actual_version_installed}], expected [{tag}].") | ||
|
||
return installed | ||
|
||
def _get_actual_installed_version(self) -> str: | ||
args = ["rustup", "default"] | ||
output = myprocess.run_process(args, dump_to_stdout=False) | ||
return output.strip() | ||
|
||
def install(self, overwrite: bool) -> None: | ||
self._check_install_env(apply_correction=overwrite) | ||
|
@@ -321,7 +338,7 @@ def _install_sc_meta(self): | |
tag = config.get_dependency_tag("sc-meta") | ||
args = ["cargo", "install", "multiversx-sc-meta", "--locked"] | ||
|
||
if tag != "": | ||
if tag: | ||
args.extend(["--version", tag]) | ||
|
||
myprocess.run_process(args) | ||
|
@@ -337,7 +354,7 @@ def _install_twiggy(self): | |
tag = config.get_dependency_tag("twiggy") | ||
args = ["cargo", "install", "twiggy"] | ||
|
||
if tag != "": | ||
if tag: | ||
args.extend(["--version", tag]) | ||
|
||
myprocess.run_process(args) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Rust, we don't display this log info? Or without this
if
the message will be duplicated by the one frommodules.py
? I think better to have it duplicated on the CLI than to have this customif
here (e.g. in the future we will forget its reason).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the
if
statement the message will be duplicated by the one inmodules.py
. Why I added it it's because if you have a different Rust version other than the recommended one, you'll see a warning that the versions don't match but the log will show that the correct version is installed since it takes the tag from the config.A problem that could occur with the other dependencies as well, now that I think about it, but is less common.