-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create documentation compatibility for old apps
Include add_dynamic_args as deprecated placeholder. Some apps were using it to prepare a documentation cli. Include it with a deprecation warning for a more graceful change. It's otherwise a no-op, it's funcationality subsumed by SnakeBidsApp and the underlying bidsapp Expose .parser and .config on SnakeBidsApp Lazily construct app in SnakeBidsApp: Improves compatibility for some tests
- Loading branch information
Showing
3 changed files
with
97 additions
and
24 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from __future__ import annotations | ||
|
||
import argparse | ||
import warnings | ||
from typing import Any, Mapping | ||
|
||
from snakebids.types import InputsConfig | ||
|
||
|
||
def add_dynamic_args( | ||
parser: argparse.ArgumentParser, | ||
parse_args: Mapping[str, Any], | ||
pybids_inputs: InputsConfig, | ||
) -> None: | ||
"""Do nothing. | ||
Originally added --filter-<comp> and --wildcards-<comp> argumets to the CLI. Kept | ||
as a placeholder for apps that relied on it for generating documentation. This | ||
functionality is now native to `SnakeBidsApp`. | ||
""" | ||
warnings.warn( | ||
"add_dynamic_args() is deprecated and no longer has any effect. Its function " | ||
"is now provided natively by `SnakeBidsApp`. It will be removed in an upcoming " | ||
"release", | ||
stacklevel=2, | ||
) |
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