From 5e07b7959f882b5e2da694d8d8fbff38a10e09aa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 27 Jul 2021 08:39:21 -0500 Subject: [PATCH] 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. --- tools/ci_check_duplicate_usb_vid_pid.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index 3994e9fe36..9703553415 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -72,13 +72,7 @@ def configboard_files(): :returns: A ``pathlib.Path.glob()`` generator object """ - working_dir = pathlib.Path().resolve() - if not working_dir.name.startswith("circuitpython") and not working_dir.name.startswith( - "micropython" - ): - raise RuntimeError( - "Please run USB VID/PID duplicate verification at the " "top-level directory." - ) + working_dir = pathlib.Path(__file__).resolve().parent.parent return working_dir.glob("ports/**/boards/**/mpconfigboard.mk")