Skip to content

Commit

Permalink
chore: Check that DafnyRuntimePython version matches project.properti…
Browse files Browse the repository at this point in the history
…es dafnyVersion (#1042)
  • Loading branch information
lucasmcdonald3 authored Dec 17, 2024
1 parent 382edfd commit 983f752
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/check_dafny_runtime_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Checks that DafnyRuntimePython version in StandardLibrary's pyproject.toml
# matches the Dafny version in project.properties.
# .toml is static and cannot load this automatically.
# This must be bumped manually.
name: Check DafnyRuntimePython Version Consistency

on:
pull_request:
push:
branches:
- main

jobs:
check-version-consistency:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Validate DafnyRuntimePython Version Consistency
run: |
# Extract the version from pyproject.toml
dafny_runtime_python_version=$(grep -oP 'DafnyRuntimePython\s*=\s*"\K[^\"]+' StandardLibrary/runtimes/python/pyproject.toml)
# Normalize by removing `.postN` if present
normalized_dafny_runtime_python_version=$(echo "$dafny_runtime_python_version" | sed 's/\.post[0-9]*$//')
# Extract the version from project.properties
dafny_version=$(grep -oP 'dafnyVersion=\K[^\s]+' project.properties)
# Check if the versions match
if [ "$normalized_dafny_runtime_python_version" != "$dafny_version" ]; then
echo "Version mismatch! DafnyRuntimePython ($normalized_dafny_runtime_python_version) does not match dafnyVersion ($dafny_version)."
exit 1
fi
echo "Versions match: $normalized_dafny_runtime_python_version"
2 changes: 1 addition & 1 deletion StandardLibrary/runtimes/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include = [
python = "^3.11.0"
pytz = "^2023.3.post1"
# TODO: Longer-term, write something to pull this in from the project's project.properties file
DafnyRuntimePython = "4.8.1.post1"
DafnyRuntimePython = "4.9.0"

# Package testing

Expand Down

0 comments on commit 983f752

Please sign in to comment.