forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add healthcheck for checking whether the environment is listed on env…
…ironments.txt (conda#13000) Co-authored-by: Ken Odegard <[email protected]>
- Loading branch information
1 parent
c76f5aa
commit e658798
Showing
5 changed files
with
106 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Copyright (C) 2012 Anaconda, Inc | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
from .doctor import cli as doctor | ||
from . import doctor | ||
|
||
plugins = [doctor] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,51 @@ | ||
# Copyright (C) 2012 Anaconda, Inc | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
"""Provide 'conda doctor' environment check feature.""" | ||
# This file is here for packaging, not for importing submodules. | ||
"""Implementation for `conda doctor` subcommand. | ||
Adds various environment and package checks to detect issues or possible environment | ||
corruption. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import argparse | ||
|
||
from ....base.context import context | ||
from ....cli.conda_argparse import ( | ||
ArgumentParser, | ||
add_parser_help, | ||
add_parser_prefix, | ||
add_parser_verbose, | ||
) | ||
from ....deprecations import deprecated | ||
from ... import CondaSubcommand, hookimpl | ||
|
||
|
||
@deprecated( | ||
"24.3", "24.9", addendum="Use `conda.base.context.context.target_prefix` instead." | ||
) | ||
def get_prefix(args: argparse.Namespace) -> str: | ||
context.__init__(argparse_args=args) | ||
return context.target_prefix | ||
|
||
|
||
def configure_parser(parser: ArgumentParser): | ||
add_parser_verbose(parser) | ||
add_parser_help(parser) | ||
add_parser_prefix(parser) | ||
|
||
|
||
def execute(args: argparse.Namespace) -> None: | ||
"""Run conda doctor subcommand.""" | ||
from .health_checks import display_health_checks | ||
|
||
display_health_checks(context.target_prefix, verbose=context.verbose) | ||
|
||
|
||
@hookimpl | ||
def conda_subcommands(): | ||
yield CondaSubcommand( | ||
name="doctor", | ||
summary="Display a health report for your environment.", | ||
action=execute, | ||
configure_parser=configure_parser, | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters