fix: drop the deprecated setup_locale call - #975
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe startup paths no longer call ChangesLocale startup removal
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change removes deprecated startup locale rewrites while preserving configuration-driven language updates and bus behavior. The change is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Hello! The automated checks have been performed. 👋I've aggregated the results of the automated checks for this PR below. 📋 Repo HealthI've checked the repo's eyesight (aka observability). 👓 ✅ All required files present. Latest Version: ✅ 📡 Channel Compat — stableI've double-checked the data for any anomalies. 🔍 🚧 Channel unresolvable with this checkout — the repo's dependency floors exceed what the channel pins (fleet finding; see the install log). Constraints: https://raw.githubusercontent.com/OpenVoiceOS/OpenVoiceOS/main/constraints-stable.txt 📚 DocsEnsuring the quality bar remains high. 📈 ✅ All required documentation files present. ✅ 📡 Channel Compat — testingJust keeping you informed on the state of things. ℹ️ 🚧 Channel unresolvable with this checkout — the repo's dependency floors exceed what the channel pins (fleet finding; see the install log). Constraints: https://raw.githubusercontent.com/OpenVoiceOS/OpenVoiceOS/main/constraints-testing.txt 🏷️ Release PreviewPredicting the ripple effect of this release. 🌊 Current:
✅ PR title follows conventional commit format. 🚀 Release Channel Compatibility Predicted next version:
🔌 Plugin DetectionEnsuring the plugin is 'future-proof'. 🔮 ❌ Plugin Status: ERRORS (1) Plugin Info:
OPM Detection:
Entry Point Validation:
⊘ No Issues:
📊 CoverageCalculating the density of our test suite. 🧮 Files below 80% coverage (10 files)
Full report: download the 🌍 Locale BuildA quick update on the status of your PR. 🔔 ✅ Locale properly configured (65 files, 18 languages) Locale directories found:
Localization coverage:
pyproject.toml: ✅
Build manifest: ✅ 32 locale files included in package 🔒 Security (pip-audit)Checking for any potential security breaches. 🔓 ✅ No known vulnerabilities found (113 packages scanned). 🔌 Skill Tests (ovoscope)I've verified the skill's 'tone of voice' is consistent. 🎙️ ✅ 18/42 passed ✅ TestActiveHandlersOnlyIsNotPolled — 1/1 ❌ **TestAdaptIntent** — 0/4
❌ **TestCancelIntentMidSentence** — 0/1
❌ **TestConverse** — 0/1
❌ **TestDeactivate** — 2/3
❌ **TestFallback** — 0/1
❌ **TestIntentPipelineRouting** — 0/4
❌ **TestLangDisambiguation** — 0/4
❌ **TestLegacyIntentIdBackCompat** — 0/2
❌ **TestNoSkills** — 0/2
❌ **TestPadatiousIntent** — 0/4
🚌 Bus CoverageCalculating the signal margins of your changes. 📐 🔴 Coverage Summary
📊 Per-Skill Breakdown
🔍 Detailed Message Type Breakdown
|
| Python | Build | Install | Tests |
|---|---|---|---|
| 3.10 | ✅ | ✅ | ✅ |
| 3.11 | ✅ | ✅ | ✅ |
| 3.12 | ✅ | ✅ | ✅ |
| 3.13 | ✅ | ✅ | ✅ |
| 3.14 | ✅ | ✅ | ✅ |
⚖️ License Check
Ensuring our licenses allow for commercial use. 🏢
✅ No license violations found.
Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.
🔎 Type Check
Analysis complete! Check out the details below. 📊
❌ mypy: 367 error(s) found
test/unittests/test_main.py:13:1: error: Skipping analyzing "ovos_bus_client": module is installed, but missing library stubs or py.typed marker [import-untyped]
Errors (showing first 10/367)
test/unittests/test_skill/__init__.py:15:1: error: Skipping analyzing "ovos_workshop.skills.ovos": module is installed, but missing library stubs or py.typed marker [import-untyped]
test/end2end/conftest.py:10:1: error: Cannot find implementation or library stub for module named "pytest" [import-not-found]
ovos_core/transformers.py:3:1: error: Skipping analyzing "ovos_config": module is installed, but missing library stubs or py.typed marker [import-untyped]
ovos_core/transformers.py:4:1: error: Skipping analyzing "ovos_plugin_manager.intent_transformers": module is installed, but missing library stubs or py.typed marker [import-untyped]
ovos_core/transformers.py:5:1: error: Skipping analyzing "ovos_plugin_manager.metadata_transformers": module is installed, but missing library stubs or py.typed marker [import-untyped]
ovos_core/transformers.py:6:1: error: Skipping analyzing "ovos_plugin_manager.templates.transformers": module is installed, but missing library stubs or py.typed marker [import-untyped]
ovos_core/transformers.py:7:1: error: Skipping analyzing "ovos_plugin_manager.text_transformers": module is installed, but missing library stubs or py.typed marker [import-untyped]
ovos_core/transformers.py:8:1: error: Skipping analyzing "ovos_plugin_manager.transformer_services": module is installed, but missing library stubs or py.typed marker [import-untyped]
ovos_core/transformers.py:13:1: error: Skipping analyzing "ovos_plugin_manager.typed_slots_transformers": module is installed, but missing library stubs or py.typed marker [import-untyped]
ovos_core/transformers.py:14:1: error: Skipping analyzing "ovos_utils.log": module is installed, but missing library stubs or py.typed marker [import-untyped]
The automation engine never sleeps. 🚂
Replace no-argument setup_locale() no-op calls with a direct Configuration write where an explicit language value is required, and remove the now-unused import. Co-Authored-By: Claude <noreply@anthropic.com>
7280754 to
273f247
Compare
Three conflicts, all resolved in upstream's favour where they disagree about behaviour: setup_locale is gone. OpenVoiceOS#975 dropped it as deprecated, so the call in main() and the import in the standalone intent-service entry point go with it; only the metrics server start remains where they sat. The lifecycle stamp contract changed. Upstream now says the entry stamp REPLACES any value already present rather than never overwriting one, so that comment and its semantics are kept verbatim and simply moved inside the preprocess measurement. The transformers import gained TypedSlotsTransformersService, which is kept alongside the metrics imports. 657 unit tests pass, including the 20 runtime-metrics tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Removes the two
setup_locale()calls and their imports. Five deleted lines plus onestale mock in a test.
What the call did
ovos_config.locale.setup_localeis deprecated. On ovos-config dev its whole body is:Both call sites pass no arguments, so
lang_codeis read straight out ofConfiguration()and written straight back.set_default_tzignores its argument andthrows away the value it computes. The result is an identity write and a discarded read.
Why the write is not quite nothing, and why it is safe here
Configuration.__setitem__is not a plain store. It writes the runtime patch layer,invalidates the cache, and emits
configuration.patchto every connected processwhenever
Configuration.busis set. Measured: an identical-value writestill emits,
{'config': {'lang': 'en-US'}}.Neither call site reaches that branch.
__main__.pycalls it beforeMessageBusClient()exists, and
launch_standaloneinservice.pydoes the same.Configuration.busisunset both times, so no frame was ever produced here and nothing is removed from the wire.
The one real difference is precedence. The write promoted
langinto the patch layer,which outranks config files, so a later config reload could not change
langfor thelife of the process. Without it a reload is followed. The value is the same either way
unless the configuration changes
langmid-run, where following it is the betterbehaviour.
Test change
test_main.pypatchedovos_core.__main__.setup_locale. With the import gone thatpatch target does not exist and
mock.patchraisesAttributeError. The decorator andits argument go with it.
Verification
test_main.py2 passedA matching change for ovos-workshop is held. Its call site sits inside
SkillContainer.__init__, whereConfiguration.buscan already be set, so deleting itthere can remove a real
configuration.patchframe from the bus. That is a wire-surfacechange and is being decided separately.
Summary by CodeRabbit
Bug Fixes
Tests