Skip to content

Commit

Permalink
Fix deprecation logs and formatting changes (#194)
Browse files Browse the repository at this point in the history
# Description
Fix typo in deprecation version (2.0.0 -> 5.0.0)
Resolve PEP warnings

# Issues
Fixes typo missed in #190

# Other Notes
<!-- Note any breaking changes, WIP changes, requests for input, etc.
here -->

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored Apr 23, 2024
1 parent 9d4443b commit 79f36d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion neon_speech/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def run(module, package, force_install):
@click.option("--force-install", "-f", default=False, is_flag=True,
help="Force pip installation of configured module")
def install_plugin(module, package, force_install):
log_deprecation("`install-plugin` replaced by `install-dependencies`", "2.0.0")
log_deprecation("`install-plugin` replaced by `install-dependencies`", "5.0.0")
from neon_speech.utils import install_stt_plugin
from ovos_config.config import Configuration
speech_config = Configuration()
Expand All @@ -102,6 +102,7 @@ def install_plugin(module, package, force_install):
if not module:
click.echo("Plugin specified without module")


@neon_speech_cli.command(help="Install neon-speech module dependencies from config & cli")
@click.option("--package", "-p", default=[], multiple=True,
help="Additional package to install (can be repeated)")
Expand All @@ -114,6 +115,7 @@ def install_dependencies(package: List[str]):
LOG.info(f"pip exit code: {result}")
sys.exit(result)


@neon_speech_cli.command(help="Install a STT Plugin")
@click.option("--plugin", "-p", default=None,
help="STT module to init")
Expand Down
4 changes: 3 additions & 1 deletion neon_speech/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ def _plugin_to_package(plugin: str) -> str:
}
return known_plugins.get(plugin) or plugin


def build_extra_dependency_list(config: Union[dict, Configuration], additional: List[str] = []) -> List[str]:
extra_dependencies = config.get("extra_dependencies", {})
dependencies = additional + extra_dependencies.get("global", []) + extra_dependencies.get("voice", [])

return dependencies

@deprecated("Replaced by `neon_utils.packaging_utils.install_packages_from_pip`", "2.0.0")

@deprecated("Replaced by `neon_utils.packaging_utils.install_packages_from_pip`", "5.0.0")
def install_stt_plugin(plugin: str) -> bool:
"""
Install an stt plugin using pip
Expand Down

0 comments on commit 79f36d8

Please sign in to comment.