Skip to content

Commit 5e07b79

Browse files
committed
check vid/pid: find topdir relative to this script
@dhalbert noticed that if a fork was called `micropython`, the existing check could fail during CI because it will be cloned into a directory also called `micropython`. Instead of hardcoding a range of strings that are OK as top directories, find the location of the top directory relative to the script. This will be conflicty after #5069 is merged, but it should be easy to fix.
1 parent 84ddb17 commit 5e07b79

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tools/ci_check_duplicate_usb_vid_pid.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@ def configboard_files():
7272
7373
:returns: A ``pathlib.Path.glob()`` generator object
7474
"""
75-
working_dir = pathlib.Path().resolve()
76-
if not working_dir.name.startswith("circuitpython") and not working_dir.name.startswith(
77-
"micropython"
78-
):
79-
raise RuntimeError(
80-
"Please run USB VID/PID duplicate verification at the " "top-level directory."
81-
)
75+
working_dir = pathlib.Path(__file__).resolve().parent.parent
8276
return working_dir.glob("ports/**/boards/**/mpconfigboard.mk")
8377

8478

0 commit comments

Comments
 (0)