From 0a7a060a9152d2a3138709b79aa1850b8c9790fd Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:06:27 +0000 Subject: [PATCH] deprecate:backend client (#183) * deprecate:backend client * deprecate!:backend client * remove unused keys * packaging * packaging --- ovos_config/models.py | 56 +-------------------------- ovos_config/mycroft.conf | 82 +--------------------------------------- requirements/extras.txt | 1 - requirements/tests.txt | 7 +--- setup.py | 3 -- 5 files changed, 4 insertions(+), 145 deletions(-) delete mode 100644 requirements/extras.txt diff --git a/ovos_config/models.py b/ovos_config/models.py index 6d26b08..a2d9131 100644 --- a/ovos_config/models.py +++ b/ovos_config/models.py @@ -24,33 +24,6 @@ from ovos_config.locations import USER_CONFIG, DISTRIBUTION_CONFIG, SYSTEM_CONFIG, WEB_CONFIG_CACHE, DEFAULT_CONFIG -def is_remote_list(values): - """ DEPRECATED """ - # TODO: Deprecate in 0.1.0 - LOG.warning("This reference will be deprecated in v0.1.0. Import from " - "ovos_backend_client.config directly") - from ovos_backend_client.config import _is_remote_list - return _is_remote_list(values) - - -def translate_remote(config, setting): - """ DEPRECATED """ - # TODO: Deprecate in 0.1.0 - LOG.warning("This reference will be deprecated in v0.1.0. Import from " - "ovos_backend_client.config directly") - from ovos_backend_client.config import _translate_remote - return _translate_remote(config, setting) - - -def translate_list(config, values): - """ DEPRECATED """ - # TODO: Deprecate in 0.1.0 - LOG.warning("This reference will be deprecated in v0.1.0. Import from " - "ovos_backend_client.config directly") - from ovos_backend_client.config import _translate_list - return _translate_list(config, values) - - class LocalConf(dict): """Config dictionary from file.""" allow_overwrite = True @@ -196,37 +169,12 @@ def __init__(self, allow_overwrite=False): class RemoteConf(LocalConf): - """Config dictionary fetched from the backend""" + """Config dictionary fetched from the backend + It's a local file expected to be managed by an external service""" def __init__(self, cache=WEB_CONFIG_CACHE): super(RemoteConf, self).__init__(cache) - def reload(self): - try: - from ovos_backend_client.pairing import is_paired - from ovos_backend_client.config import RemoteConfigManager - - if not is_paired(): - self.load_local(self.path) - return - - remote = RemoteConfigManager() - remote.download() - - changed = [] - for key in remote.config: - if self.get(key) != remote.config[key]: - changed.append(key) - self.__setitem__(key, remote.config[key]) - - if changed: - LOG.debug(f"config key(s) {changed} changed, writing remote config to {self.path}") - self.store(self.path) - - except Exception as e: - LOG.error(f"Exception fetching remote configuration: {e}") - self.load_local(self.path) - class MycroftUserConfig(LocalConf): def __init__(self): diff --git a/ovos_config/mycroft.conf b/ovos_config/mycroft.conf index 7a72cc8..53c11d4 100644 --- a/ovos_config/mycroft.conf +++ b/ovos_config/mycroft.conf @@ -42,9 +42,6 @@ // Date format, either 'MDY' (e.g. "11-29-1978") or 'DMY' (e.g. "29-11-1978") "date_format": "MDY", - // Whether to opt in to data collection - "opt_in": false, - // Play a beep when system begins to listen? "confirm_listening": true, @@ -217,25 +214,6 @@ // relative to "data_dir" "directory": "skills", - // used by selene for marketplace integration in web interface - // NOTE: selene seems to work fine without this data - // no need to advertise installed skills if they dont have settings - // this data was tightly coupled to msm and is now mostly useless for selene - "upload_skill_manifest": false, - - // if "sync_skill_settings" is enabled in "server" section - // should skill settingg changes on device be upload to selene? - // NOTE: this should be true, but it was removed (bug ?) in selene at some point - // old endpoints are however still available so functionality has been restored here - // it is only configurable in case you want to retain "old" mycroft-core behaviour - // or in case selene deprecates the old endpoint - "sync2way": true, - // values in skill settings missing in settingsmeta wont show up in selene - // this flag auto generates settingsmeta on the fly - // TODO - settings this to true may run into permission issues until settingsmeta.json gets XDG support - // it writes to skill base folder - "autogen_meta": false, - // blacklisted skills to not load // NB: This is skill_id of the skill, usually defined in the skills setup.py "blacklisted_skills": [ @@ -326,78 +304,20 @@ // eg. {"a": {"b": True, "c": False}} // to protect "c" you would enter "a:c" in the section below "protected_keys": { - // NOTE: selene backend expects "opt_in" to be changeable in their web ui - // that effectively gives them a means to enable spying without your input - // Mycroft AI can be trusted, but you dont need to anymore! - // The other keys are not currently populated by the remote backend - // they are defined for protection against bugs and for future proofing - // (what if facebook buys mycroft tomorrow?) "remote": [ - "enclosure", - "server", "system", "websocket", "gui_websocket", "network_tests", - "listener:wake_word_upload:disable", // NOTE: selene returns listener settings as part of ww config // they are protected because selene has no clue about your mic setup "listener:channels", - "listener:sample_rate", - "listener:multiplier", - "listener:energy_ratio", - "skills:upload_skill_manifest", - "skills:auto_update", - "skills:priority_skills", - "skills:blacklisted_skills", - // NOTE: selene exposes this in web_ui, this has been disabled - // if you unprotect this key selene can enable opt_in behind your back - "opt_in" + "listener:sample_rate" ], "user": [] } }, - // Address of the REMOTE server - // Needs to be explicitly enabled, also see "protected_keys" under "system" above - // Possible backends - // - https://github.com/OpenVoiceOS/OVOS-local-backend - "server": { - // Valid types: offline, personal - "backend_type": "offline", - // url for self hosted personal backend - "url": "", - "version": "v1", - "update": false, - "metrics": true, - "sync_skill_settings": true - }, - - // This section controls what providers should be used by each 3rd party API - "microservices": { - // auto == backend from "server" section above - // auto / wolfram / personal - "wolfram_provider": "auto", - // auto / owm / personal - "weather_provider": "auto", - // auto / osm / personal - "geolocation_provider": "auto", - - // secret keys for offline usage - "wolfram_key": "", - "owm_key": "", - "email": { - // by default send emails here - "recipient": "", - "smtp": { - "username": "", - "password": "", - "host": "smtp.mailprovider.com", - "port": 465 - } - } - }, - // The ovos-core messagebus websocket "websocket": { "host": "127.0.0.1", diff --git a/requirements/extras.txt b/requirements/extras.txt deleted file mode 100644 index 9fa1940..0000000 --- a/requirements/extras.txt +++ /dev/null @@ -1 +0,0 @@ -ovos-backend-client>=0.1.0,<2.0.0 \ No newline at end of file diff --git a/requirements/tests.txt b/requirements/tests.txt index 74a681e..c51ded5 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -3,9 +3,4 @@ flake8==3.7.9 pytest==8.2.2 pytest-cov==2.8.1 cov-core==1.15.0 -sphinx==2.2.1 -sphinx-rtd-theme==0.4.3 -mock_msm~=0.9.2 -ovos-stt-plugin-vosk>=0.1.3 -python-vlc==1.1.2 -ovos-bus-client~=0.0.8 \ No newline at end of file +ovos-bus-client<2.0.0 \ No newline at end of file diff --git a/setup.py b/setup.py index b35da53..00b781f 100644 --- a/setup.py +++ b/setup.py @@ -80,9 +80,6 @@ def required(requirements_file): package_data={'': package_files('ovos_config')}, include_package_data=True, install_requires=required('requirements/requirements.txt'), - extras_require={ - "extras": required("requirements/extras.txt") - }, entry_points={ 'console_scripts': [ 'ovos-config=ovos_config.__main__:config'