Skip to content

Commit

Permalink
Remove conda.cli.main_env.configure_parser(sub_parsers=None) (conda…
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard authored Feb 21, 2025
1 parent ff80d1c commit 79f1fd7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
24 changes: 6 additions & 18 deletions conda/cli/main_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@

from __future__ import annotations

from argparse import ArgumentParser
from typing import TYPE_CHECKING

from ..deprecations import deprecated
from . import main_export

if TYPE_CHECKING:
from argparse import Namespace, _SubParsersAction
from argparse import ArgumentParser, Namespace, _SubParsersAction


def configure_parser(sub_parsers: _SubParsersAction | None, **kwargs) -> ArgumentParser:
def configure_parser(sub_parsers: _SubParsersAction, **kwargs) -> ArgumentParser:
from . import (
main_env_config,
main_env_create,
Expand All @@ -23,20 +21,10 @@ def configure_parser(sub_parsers: _SubParsersAction | None, **kwargs) -> Argumen
main_env_update,
)

# This is a backport for the deprecated `conda_env`, see `conda_env.cli.main`
if sub_parsers is None:
deprecated.topic(
"24.9",
"25.3",
topic="'conda_env'",
)
p = ArgumentParser()

else:
p = sub_parsers.add_parser(
"env",
**kwargs,
)
p = sub_parsers.add_parser(
"env",
**kwargs,
)

env_parsers = p.add_subparsers(
metavar="command",
Expand Down
19 changes: 19 additions & 0 deletions news/14600-remove-configure_parser-None
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* Remove `conda.cli.main_env.configure_parser(sub_parsers=None)`. (#14600)

### Docs

* <news item>

### Other

* <news item>

0 comments on commit 79f1fd7

Please sign in to comment.