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

Added programmatic pip list #864

Merged
merged 22 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4ce186a
added programmatic pip list
scap3yvt Apr 30, 2024
f88e7c9
added a verbose option, and cleaned output
scap3yvt May 1, 2024
c48ba1a
ensure test get invoked
scap3yvt May 1, 2024
1b2cb60
lint removed
scap3yvt May 1, 2024
e90dfba
Merge branch 'new-apis_v0.1.0-dev' into new-apis_v0.1.0-dev_more-debu…
sarthakpati May 1, 2024
93c25b4
updated `old_ways` for debug info and updated test
scap3yvt May 1, 2024
565cf8a
fixed imports
scap3yvt May 1, 2024
d4c0ffc
fixed according to comment
scap3yvt May 4, 2024
0d843e5
removed unused import
scap3yvt May 4, 2024
d82879c
removed `metavar`
scap3yvt May 4, 2024
e810dd0
checking if this invokes the test
scap3yvt May 4, 2024
e53f881
ensure both verbose and laconic params are checked
scap3yvt May 5, 2024
f97a17d
checking removal of metavar
scap3yvt May 6, 2024
8b92852
added dummy commit to test code coverage report
sarthakpati May 9, 2024
c2e5ec3
Merge branch 'new-apis_v0.1.0-dev' into new-apis_v0.1.0-dev_more-debu…
sarthakpati May 31, 2024
5d59456
Merge branch 'new-apis_v0.1.0-dev' into new-apis_v0.1.0-dev_more-debu…
sarthakpati Jun 11, 2024
8747225
Merge branch 'new-apis_v0.1.0-dev' into new-apis_v0.1.0-dev_more-debu…
sarthakpati Jun 27, 2024
9e6e32b
Merge branch 'new-apis_v0.1.0-dev' into new-apis_v0.1.0-dev_more-debu…
sarthakpati Jun 30, 2024
828729c
Merge branch 'new-apis_v0.1.0-dev' into new-apis_v0.1.0-dev_more-debu…
sarthakpati Jul 13, 2024
165adb9
Merge branch 'new-apis_v0.1.0-dev' into new-apis_v0.1.0-dev_more-debu…
sarthakpati Jul 24, 2024
67f2eeb
Merge branch 'master' into new-apis_v0.1.0-dev_more-debug-info
sarthakpati Jul 31, 2024
d66a61a
added explicit test
scap3yvt Jul 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions GANDLF/entrypoints/debug_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!usr/bin/env python
# -*- coding: utf-8 -*-
import platform
from pip import main
from deprecated import deprecated
import click

Expand All @@ -9,7 +10,7 @@
from GANDLF.utils import get_git_hash


def _debug_info():
def _debug_info(verbose: bool):
print(f"GANDLF version: {__version__}")
print(f"Git hash: {get_git_hash()}")
print(f"Platform: {platform.platform()}")
Expand All @@ -21,13 +22,22 @@ def _debug_info():
print(f" Implementation: {platform.python_implementation()}")
print(f" Compiler: {platform.python_compiler()}")
print(f" Build: {(' ').join(list(platform.python_build()))}")
if verbose:
print(" Installed packages:")
print(main(["list"]))


@click.command()
@click.option(
"--verbose",
"-v",
is_flag=True,
help="If passed, prints all packages installed as well",
)
@append_copyright_to_help
def new_way():
def new_way(verbose: bool):
"""Displays detailed info about system environment: library versions, settings, etc."""
_debug_info()
_debug_info(verbose=verbose)


# main function
Expand Down
5 changes: 4 additions & 1 deletion testing/entrypoints/test_debug_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
test_file_system = []
test_cases = [
CliCase(
should_succeed=True, new_way_lines=[""], old_way_lines=[""], expected_args={}
should_succeed=True,
new_way_lines=[""],
old_way_lines=[""],
expected_args={"verbose": True},
)
]

Expand Down
Loading