Skip to content
Open
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
31 changes: 29 additions & 2 deletions .github/workflows/check_dafny_runtime_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,33 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# TODO: Remove this entire step when dafnyRuntimePythonVersion is deleted from project.properties
- name: Enforce dafnyVersion review (PR only)
if: github.event_name == 'pull_request'
run: |
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"

# Check if dafnyVersion was changed
if git diff "$BASE_SHA" "$HEAD_SHA" -- project.properties | grep -q "^[+-]dafnyVersion="; then
# Check if dafnyRuntimePythonVersion was also changed
if ! git diff "$BASE_SHA" "$HEAD_SHA" -- project.properties | grep -q "^[+-]dafnyRuntimePythonVersion="; then
echo "ERROR: dafnyVersion was changed but dafnyRuntimePythonVersion was not reviewed."
echo ""
echo "Required action (choose one):"
echo "1. PREFERRED: Delete the dafnyRuntimePythonVersion line entirely if the new Dafny version is compatible"
echo "2. Update dafnyRuntimePythonVersion to a compatible version"
echo "3. Keep the same value but add a comment explaining why (e.g., '# Keeping 4.11.0 due to compatibility issues')"
echo ""
echo "This ensures conscious review of the temporary Python runtime workaround."
echo "NOTE: When dafnyRuntimePythonVersion is removed, also remove this enforcement step."
exit 1
fi
fi

- name: Validate DafnyRuntimePython Version Consistency
run: |
# Extract the version from pyproject.toml
Expand All @@ -24,8 +51,8 @@ jobs:
# 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)
# Extract the Dafny Runtime Python Version from project.properties
dafny_version=$(grep -oP 'dafnyRuntimePythonVersion=\K[^\s]+' project.properties)

# Check if the versions match
if [ "$normalized_dafny_runtime_python_version" != "$dafny_version" ]; then
Expand Down
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, <2026.0.0"
# TODO: Longer-term, write something to pull this in from the project's project.properties file
DafnyRuntimePython = "4.9.0"
DafnyRuntimePython = "4.11.0"

# Package testing

Expand Down
4 changes: 4 additions & 0 deletions project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
# And the Dotnet projects include and parse this file.
dafnyVersion=4.9.0
dafnyVerifyVersion=4.9.1
# TEMPORARY WORKAROUND: When updating dafnyVersion, try to REMOVE this property first.
# Only keep if the new Dafny version has Python runtime compatibility issues.
# GitHub workflow will enforce this review. Goal: remove this entirely.
dafnyRuntimePythonVersion=4.11.0
dafnyRustVersion=4.10.0
mplVersion=1.11.1-SNAPSHOT
Loading