Skip to content

Commit

Permalink
enforce min py3.9 for setboard. create init.py in board-stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed Jun 23, 2024
1 parent cbd5131 commit 798e38e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ stubs:
@$(PYTHON) tools/board_stubs/build_board_specific_stubs/board_stub_builder.py
@cp -r tools/board_stubs/circuitpython_setboard circuitpython-stubs/circuitpython_setboard
@$(PYTHON) -m build circuitpython-stubs
@touch circuitpython-stubs/board/__init__.py

.PHONY: check-stubs
check-stubs: stubs
Expand Down
4 changes: 4 additions & 0 deletions tools/board_stubs/circuitpython_setboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def header(txt: str) -> str:


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

0 comments on commit 798e38e

Please sign in to comment.