Skip to content
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

[Bug]: "Neither powershell nor pwsh is installed." always printed when code_utils imported #1747

Closed
jackgerrits opened this issue Feb 21, 2024 · 5 comments · Fixed by #1758
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jackgerrits
Copy link
Member

This print is noisy. It should be sent to the logger instead of just printed.

print("Neither powershell nor pwsh is installed.")

For example

logger.info(...)

Introduced in #1710

@jackgerrits jackgerrits added bug Something isn't working good first issue Good for newcomers labels Feb 21, 2024
@BeibinLi
Copy link
Collaborator

@abhaymathur21
@ekzhu

Any ideas how to fix this?

@jackgerrits
Copy link
Member Author

Can replace print with logging.info or something similar

@abhaymathur21
Copy link
Contributor

abhaymathur21 commented Feb 22, 2024

@jackgerrits Can you check if my PR #1758 solves this isue?

@jackgerrits
Copy link
Member Author

Thanks so much I love the fix!

@abhaymathur21
Copy link
Contributor

No problem!

github-merge-queue bot pushed a commit that referenced this issue Feb 23, 2024
* Update code_utils.py

Updated the powershell command to pwsh

* Update code_utils.py

added a split to handle powershell in the first condition as well

* Update local_commandline_code_executor.py

added "pwsh" as a command option in lang variable

* Update autogen/coding/local_commandline_code_executor.py

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>

* Update code_utils.py

* Update code_utils.py

fixed formatting

* Update code_utils.py

defined a function to detect whether 'powershell' or 'pwsh' works and accordingly use the one that works

* Update code_utils.py

fixed formatting

* Update and rename test_code.py to test_code_utils.py

added a unit test for get_powershell_command function in code_utils.py

* Update test_code_utils.py

fixed formatting

* Update test_code_utils.py

fixed formatting

* Update autogen/code_utils.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* solved issue #1747

* updated unit test

* fixed formatting

* fixed formatting

* fixed formatting

* fixed a bug

* removed extra return None and removed redundant comments

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
whiskyboy pushed a commit to whiskyboy/autogen that referenced this issue Apr 17, 2024
* Update code_utils.py

Updated the powershell command to pwsh

* Update code_utils.py

added a split to handle powershell in the first condition as well

* Update local_commandline_code_executor.py

added "pwsh" as a command option in lang variable

* Update autogen/coding/local_commandline_code_executor.py

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>

* Update code_utils.py

* Update code_utils.py

fixed formatting

* Update code_utils.py

defined a function to detect whether 'powershell' or 'pwsh' works and accordingly use the one that works

* Update code_utils.py

fixed formatting

* Update and rename test_code.py to test_code_utils.py

added a unit test for get_powershell_command function in code_utils.py

* Update test_code_utils.py

fixed formatting

* Update test_code_utils.py

fixed formatting

* Update autogen/code_utils.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* solved issue microsoft#1747

* updated unit test

* fixed formatting

* fixed formatting

* fixed formatting

* fixed a bug

* removed extra return None and removed redundant comments

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants