From 62a455f868a24a22b1d1b75fcf77dbbfed41e5e7 Mon Sep 17 00:00:00 2001 From: Keith Battocchi Date: Thu, 26 Oct 2023 18:15:52 -0400 Subject: [PATCH] Update regex to match current file names Signed-off-by: Keith Battocchi --- .github/workflows/generate_lkg.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate_lkg.py b/.github/workflows/generate_lkg.py index 4df4e6583..93e153962 100644 --- a/.github/workflows/generate_lkg.py +++ b/.github/workflows/generate_lkg.py @@ -89,7 +89,8 @@ def get_reqs(metadata: CollectionMetadata): reverse_map[(file_parts.py_version, file_parts.os)].add(pkg_version) # each python version and os maps to a single package version - assert all([len(reverse_map[k]) == 1 for k in reverse_map]) + assert all([len(reverse_map[k]) == 1 for k in reverse_map] + ), f"Multiple package versions for {req}: {reqs[req]}" for pkg_version in reqs[req]: # break down first by python version @@ -125,7 +126,7 @@ def make_req_files(requirements_directory): for line in open(os.path.join(requirements_directory, file), 'r'): # Regex to match requirements file names as stored by ci.yml file_regex = r'''^((tests-(macos|ubuntu|windows)-latest-(3\.\d+)-([^-]+)) # test filename - |(notebooks-(3\.\d+)-(.*)))-requirements.txt$''' # notebook filename + |(notebooks-(.*)-(3\.\d+)))-requirements.txt$''' # notebook filename req_regex = r'^(.*?)==(.*)$' # parses requirements from pip freeze results match = re.search(req_regex, line) file_match = re.search(file_regex, file, flags=re.VERBOSE) @@ -139,8 +140,8 @@ def make_req_files(requirements_directory): test_metadata.reqs[match.group(1)][match.group(2)].add(file_parts) elif file_match.group(6): file_parts = FileParts(os='ubuntu', - py_version=packaging.version.parse(file_match.group(7)), - type=file_match.group(8)) + py_version=packaging.version.parse(file_match.group(8)), + type=file_match.group(7)) notebook_metadata.all_file_parts.add(file_parts) notebook_metadata.all_py_versions.add(file_parts.py_version) notebook_metadata.py_version_oses[file_parts.py_version].add(file_parts.os)