Skip to content

Commit 798e38e

Browse files
committed
enforce min py3.9 for setboard. create init.py in board-stubs
1 parent cbd5131 commit 798e38e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ stubs:
274274
@$(PYTHON) tools/board_stubs/build_board_specific_stubs/board_stub_builder.py
275275
@cp -r tools/board_stubs/circuitpython_setboard circuitpython-stubs/circuitpython_setboard
276276
@$(PYTHON) -m build circuitpython-stubs
277+
@touch circuitpython-stubs/board/__init__.py
277278

278279
.PHONY: check-stubs
279280
check-stubs: stubs

tools/board_stubs/circuitpython_setboard/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def header(txt: str) -> str:
3535

3636

3737
def set_board():
38+
version_info = sys.version_info
39+
if version_info.major < 3 or (version_info.major == 3 and version_info.minor < 9):
40+
sys.stdout.write("Python 3.9 is the minimum supported version for board specific stubs.\n")
41+
sys.exit(0)
3842
parser = argparse.ArgumentParser(
3943
prog=__name__,
4044
usage="Install CircuitPython board-specific stubs",

0 commit comments

Comments
 (0)