Skip to content

fix: P0 CI unblock + P2 pixel_artist.py split (2004->99 lines)#11

Closed
lulin70 wants to merge 1 commit into
mainfrom
fix/p0-ci-fix-p2-pixel-artist-split
Closed

fix: P0 CI unblock + P2 pixel_artist.py split (2004->99 lines)#11
lulin70 wants to merge 1 commit into
mainfrom
fix/p0-ci-fix-p2-pixel-artist-split

Conversation

@lulin70

@lulin70 lulin70 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

P0 CI unblock + P2 large file split — dual-track fix.

P0: CI Pipeline Unblock (2 jobs were FAILING)

Job 1: Lint & Type Check — FIXED

  • 6 mypy import-not-found errors from ghost/incorrect import paths:
    • commander_ai.py: domain.combat.combat_engagement -> domain.ai.combat_engagement
    • commander_ai.py: domain.difficulty.difficulty_system -> domain.ai.difficulty_system
    • effect_renderer.py + sprite_renderer.py: relative vec2 import -> absolute
    • terrain_rendering_system.py: domain.entities.enhanced_tile -> domain.systems.enhanced_tile
  • Added scipy.*, py7zr, AppKit to mypy ignore_missing_imports
  • Result: mypy errors reduced from 9 -> 1 (union-attr, non-blocking in CI)

Job 2: docker-build — FIXED

PR #6 merged: dependabot actions/checkout v6->v7

P2: pixel_artist.py Split (2004 -> 99 lines, -95%)

New File Content Lines
pixel_canvas.py CCPalette, PaletteSet, PixelCanvas, add_noise, dither_pattern 309
unit_sprite_generator.py UnitSpriteSpec, UnitSpriteGenerator (6 unit draw methods) 332
terrain_tile_generator.py TerrainTileGenerator (20 terrain type generators) 1315
pixel_artist.py (rewritten) Re-exports + 2 factory functions 99

Backward compatibility: All existing imports of create_unit_sprite and create_terrain_tile work unchanged.

Test Results

4298 passed, 25 skipped, ruff All checks passed

Files Changed

  • Modified (9): Dockerfile, pyproject.toml, commander_ai.py, effect_renderer.py, pixel_artist.py, pixvoxel_loader.py, sprite_renderer.py, terrain_rendering_system.py, window_config.py
  • New (3): pixel_canvas.py, unit_sprite_generator.py, terrain_tile_generator.py

P0 CI Fixes (unblocks pipeline):
- Fix 6 mypy import-not-found errors: correct ghost import paths
  (combat_engagement->ai.combat_engagement, difficulty_system->ai.difficulty_system,
   vec2->absolute import, enhanced_tile->systems.enhanced_tile)
- Add scipy/py7zr/AppKit to mypy ignore_missing_imports
- Fix docker-build: reorder COPY before RUN pip install (egg_base=src)
- Merge PR #6: dependabot actions/checkout v6->v7

P2 Large File Split:
- pixel_artist.py: 2004->99 lines (-95%)
  -> pixel_canvas.py (309L): CCPalette, PaletteSet, PixelCanvas, noise/dither
  -> unit_sprite_generator.py (332L): UnitSpriteSpec, UnitSpriteGenerator
  -> terrain_tile_generator.py (1315L): TerrainTileGenerator (20 terrain types)
- Re-export shell preserves backward compat for create_unit_sprite/create_terrain_tile

Test: 4298 passed, ruff clean, mypy 9->1 errors (non-blocking)
@lulin70 lulin70 closed this Jun 24, 2026
@lulin70 lulin70 deleted the fix/p0-ci-fix-p2-pixel-artist-split branch June 24, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant