Repository navigation
scoreboards: require core 3.7.0; use its celebration, fetch and card-wrapper mixins (stage 3) - #574
Merged
Merged
Conversation
…xins; drop the copies (stage 3) Core 3.7.0 ships three modules holding code the scoreboards carried as identical copies. Each plugin now inherits the mixin and deletes its copy; imports are plain (the next commit floors every plugin on 3.7.0). - sports.py, all nine: SportsCore inherits SportsFetchMixin (src.common.sports_fetch) and loses _fetch_season_directly, _background_fetches_espn_ranges, _needs_previous_day, _wants_live_odds, _LOOKBACK_CUTOFF_HOUR and _LIVE_ODDS_LOOKAHEAD. - sports.py, afl/football/hockey/nrl/soccer: SportsLive inherits SportsCelebrationMixin (src.common.sports_celebration) and loses the celebration drawing (_draw_celebration_layout, _celebration_palette, _celebration_backdrop, _draw_celebration_motif, _celebration_confetti, _draw_celebration_confetti, _celebration_crests, _fit_font and four class constants); the module loses the colour helpers and _PALETTE_* constants and the colorsys/math/random imports only they used. Arming a celebration (_start_celebration, _check_for_goal/_check_for_score, _check_for_win) and display() stay per plugin; hockey adopts the drawing too. - game_renderer.py, all eight: GameRenderer inherits SportsCardWrappersMixin (src.common.sports_card_wrappers) and loses its 17 sports_card delegations. football keeps _format_game_date and _upcoming_center_mode (they follow the switch-mode settings), which override the mixin's. Tests: the three celebration tests patched `sports.time`, which the drawing no longer reads; they patch time.time on the time module instead, and football's palette tests take the helpers from src.common.sports_celebration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
afl 1.34.0, baseball 1.53.0, basketball 1.40.0, football 3.17.0, hockey 1.39.0, lacrosse 1.35.0, nrl 1.33.0, soccer 2.38.0, ufc 1.18.0. versions[0].ledmatrix_min_version and compatible_versions rise to 3.7.0, the first release that ships src.common.sports_fetch, src.common.sports_celebration and src.common.sports_card_wrappers, which the previous commit imports plainly. A floor raise is a minor bump, as for the 3.2.0-3.6.1 raises before it. The versions[] notes and CHANGELOG entries name what each plugin dropped. plugins.json regenerated with update_registry.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o entries scripts/test_stage3_mixin_copies.py, in the shape of test_espn_dates_copies.py and the timezone guard: for every plugin adopting src.common.sports_fetch (all nine), src.common.sports_celebration (afl, football, hockey, nrl, soccer) or src.common.sports_card_wrappers (the eight with a game renderer), no runtime file may define a moved name again -- a module-level helper or constant, or a method or class constant on any class -- except football's own _format_game_date and _upcoming_center_mode (KEEP). The mixin must be imported plainly and be a base of SportsCore / SportsLive / GameRenderer. With a core checkout the lists are compared with what core's modules define, both ways. A self-check plants a copy, a guarded import and a missing base. Mutation-checked: a helper restored in soccer's sports.py, a wrapper in hockey's renderer, a class constant on nrl's SportsLive, a method on soccer's SoccerLiveManager, afl's import wrapped in try, ufc's base dropped and a name dropped from the list each fail it. sports_drift_baseline.json: _format_game_date and _upcoming_center_mode in game_renderer.py were recorded as divergent because football's differ; football is now the only plugin defining them, so check_sports_drift reports them back in sync. Only those two removals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ons from core 3.7.0 docs 08: the sports.py and game_renderer.py rows say which parts are now core's; hockey is no longer described as having no celebration code (it has goal and win celebrations, drawn by core's mixin like the other four); the convergence list gains "Converged at 3.7.0" naming the three modules, what each plugin inherits, football's kept overrides, the guard script, and the identical methods deliberately left in the plugins. CLAUDE.md non-negotiable #7: floor 3.7.0 and the three modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 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 |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -44 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last step of sports consolidation stage 3. Core v3.7.0 (LEDMatrix#672) ships
SportsCelebrationMixin,SportsFetchMixinandSportsCardWrappersMixin. The scoreboards now require 3.7.0, inherit these mixins and delete their identical copies. Nothing on the display changes.Changes
SportsFetchMixin: all nineSportsCoreclasses inherit it.SportsCelebrationMixin: theSportsLiveclasses in afl, football, hockey, nrl and soccer inherit it. Hockey adopts the shared drawing but keeps its own triggers, as the owner decided. Every plugin still decides when to celebrate and what to say.SportsCardWrappersMixin: all eightGameRendererclasses inherit it. Football keeps its own_format_game_dateand_upcoming_center_mode, which follow its switch-mode settings.time.timeinstead ofsports.time, and football's palette tests import the colour helpers from core.versions[]entries (minimum core 3.7.0),compatible_versions≥3.7.0, a CHANGELOG entry per plugin, andplugins.json. New versions: afl 1.34.0, baseball 1.53.0, basketball 1.40.0, football 3.17.0, hockey 1.39.0, lacrosse 1.35.0, nrl 1.33.0, soccer 2.38.0, ufc 1.18.0.scripts/test_stage3_mixin_copies.py:try, if the mixin base is missing, or if the name lists drift from core v3.7.0.Net: 43 files, +625 / −5,187.
Verification
Compared against origin/main, both on core v3.7.0.
run_plugin_tests.pygives the same result per test, 320 passed. The 2 failures happen on main too:test_odds_placement, and the interactivetest_football_plugin.scripts/test_*.pyand 13 check scripts pass. That includescheck_version_bumpnaming all nine ids,update_registry --checkand the drift check.test_sports_stage3_parity.pypasses withLEDMATRIX_PLUGINSpointed at this branch.update()timing out at startup. That's a known startup-time limit: all plugins share one short budget at boot, and it isn't a code error.src.common.*.🤖 Generated with Claude Code