Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed freeze script github yaml parsing and unfroze the ci versions #1726

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: OpenTimelineIO
# for configuring which build will be a C++ coverage build / coverage report
env:
GH_COV_PY: "3.10"
GH_COV_OS: ubuntu-22.04
GH_COV_OS: ubuntu-latest
GH_DEPENDABOT: dependabot

on:
Expand All @@ -24,17 +24,17 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
# Unfortunately the CMake test target is OS dependent so we set it as
# a variable here.
include:
- os: ubuntu-22.04
- os: ubuntu-latest
OTIO_TEST_TARGET: test
- os: windows-2022
- os: windows-latest
OTIO_TEST_TARGET: RUN_TESTS
- os: macos-12
- os: macos-latest
OTIO_TEST_TARGET: test
- os: macos-14
- os: macos-13
OTIO_TEST_TARGET: test

env:
Expand Down Expand Up @@ -94,18 +94,18 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
include:
- { os: ubuntu-22.04, shell: bash }
- { os: macos-12, shell: bash }
- { os: macos-14, shell: bash }
- { os: windows-2022, shell: pwsh }
- { os: windows-2022, shell: msys2, python-version: 'mingw64' }
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }
- { os: macos-13, shell: bash }
- { os: windows-latest, shell: pwsh }
- { os: windows-latest, shell: msys2, python-version: 'mingw64' }
exclude:
- { os: macos-14, python-version: 3.7 }
- { os: macos-14, python-version: 3.8 }
- { os: macos-14, python-version: 3.9 }
- { os: macos-latest, python-version: 3.7 }
- { os: macos-latest, python-version: 3.8 }
- { os: macos-latest, python-version: 3.9 }

defaults:
run:
Expand Down Expand Up @@ -175,10 +175,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
python-build: ['cp37*', 'cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*']
exclude:
- { os: macos-14, python-build: 'cp37*' }
- { os: macos-latest, python-build: 'cp37*' }
steps:
- uses: actions/checkout@v4

Expand All @@ -199,7 +199,7 @@ jobs:

package_sdist:
needs: py_build_test
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand Down
71 changes: 58 additions & 13 deletions maintainers/freeze_ci_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,69 @@ def _parsed_args():
return parser.parse_args()


def main():
args = _parsed_args()

def _fetch_plat_map():
# HACK: pull the image version corresponding to -latest out of the
# README.md for the github repo where they are stored
request = urllib.request.Request(GITHUB_README_URL)
response = urllib.request.urlopen(request).read().decode('utf-8')

# HACK: pull the image version corresponding to -latest out of the
# README.md for the github repo where they are stored
def md_row_fields(md_row):
# Split on |, discard the empty entries from leading and trailing |
return [
col.strip() for col in md_row.split("|")[1:-1]
]

# First, just strip the readme down the platform image table
lines = response.split("\n")
plat_map = {}
for plat in PLATFORMS:
plat_latest = plat + "-latest"
for ln in lines:
if plat_latest not in ln:
continue
plat_map[plat] = (
re.match(".*(" + plat + "-.*)`.*", ln).groups(0)[0]
table_lines = []
in_images_section = False
for line in lines:
if not in_images_section and line.startswith("## Available Images"):
in_images_section = True
continue
elif in_images_section and line.startswith("#"):
break
elif not in_images_section:
continue

if line.startswith("|"):
table_lines.append(line.strip())

# Extract the table column labels
plat_col_labels = md_row_fields(table_lines[0])

platform_name_re = re.compile(r"`([^`]*)`")
entries = {}
for line in table_lines[2:]:
col_data = md_row_fields(line)
plat_entry = dict(zip(plat_col_labels, col_data))
raw_labels = plat_entry["YAML Label"]
available_labels = platform_name_re.findall(raw_labels)
try:
next(
label for label in available_labels
if label.split("-")[-1] == "latest"
)
except StopIteration:
# not a latest label
continue

label = next(
label for label in available_labels
if label.split("-")[-1] not in {"xl", "xlarge", "latest"}
)
platform = label.split("-")[0]
if platform not in PLATFORMS:
continue
entries[platform] = label

return entries


def main():
args = _parsed_args()

plat_map = _fetch_plat_map()

if args.freeze:
freeze_ci(plat_map, args.dryrun)
Expand Down
Loading