From 85a173b72ca62ef543085e747a7038fcd1eee35f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 15 Jul 2026 05:14:32 +0000 Subject: [PATCH 1/2] Fix material_design palette on MicroPython and CircuitPython Replace zip(..., strict=True) with an explicit length check. MicroPython does not support the strict keyword on zip, which broke get_palette when name is material_design (e.g. calc_graphics, palettes_demo). --- src/palettes/material_design.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/palettes/material_design.py b/src/palettes/material_design.py index 6ee10a3..0be329f 100644 --- a/src/palettes/material_design.py +++ b/src/palettes/material_design.py @@ -59,7 +59,9 @@ def _define_named_colors(self): # The colors are already available as pal[0], pal[1], etc. # Now we want to add pal.BLACK = pal[0], pal.WHITE = pal[1], etc. color_index = 0 - for name, length in zip(FAMILIES, LENGTHS, strict=True): + if len(FAMILIES) != len(LENGTHS): + raise ValueError("FAMILIES and LENGTHS must have the same length") + for name, length in zip(FAMILIES, LENGTHS): if length == 1: # black or white setattr(self, name.upper(), self[color_index]) color_index += 1 From 422b23c3a8a68e9096874633fb8a86f2e6c08565 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 15 Jul 2026 05:19:08 +0000 Subject: [PATCH 2/2] Use enumerate loop to satisfy ruff B905 without zip(strict=) --- src/palettes/material_design.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/palettes/material_design.py b/src/palettes/material_design.py index 0be329f..5c0d1ed 100644 --- a/src/palettes/material_design.py +++ b/src/palettes/material_design.py @@ -61,7 +61,8 @@ def _define_named_colors(self): color_index = 0 if len(FAMILIES) != len(LENGTHS): raise ValueError("FAMILIES and LENGTHS must have the same length") - for name, length in zip(FAMILIES, LENGTHS): + for i, name in enumerate(FAMILIES): + length = LENGTHS[i] if length == 1: # black or white setattr(self, name.upper(), self[color_index]) color_index += 1