Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
800500a
test pypy311 CI issue
kshitij-microsoft May 15, 2026
a9084e4
Merge branch 'main' into kchawla/pypy311Fix
kshitij-microsoft May 15, 2026
6d7d29f
probe: enable PYTHONFAULTHANDLER in dispatch_checks subprocesses to c…
kshitij-microsoft May 15, 2026
81d2397
probe: invoke pytest via python -X faulthandler -X dev to capture C-l…
kshitij-microsoft May 15, 2026
c8ef29e
probe: add -X importtime -u + PYTHONUNBUFFERED to identify crashing i…
kshitij-microsoft May 15, 2026
a1f4e55
cleanup: untrack unrelated files committed by mistake
kshitij-microsoft May 15, 2026
74df78a
probe: wrap pytest in bash to tee stderr to file and cat after, ensur…
kshitij-microsoft May 15, 2026
6dcc3ab
probe: incremental import bisect to find which import triggers PyPy S…
kshitij-microsoft May 15, 2026
5f71a64
ci(pypy): pin PyPy 3.11 to v7.3.22 to work around RPython AssertionEr…
kshitij-microsoft May 15, 2026
fe36d80
ci(pypy): bootstrap pip via ensurepip after overlaying PyPy 7.3.22 ta…
kshitij-microsoft May 15, 2026
d0dbd35
ci(pypy): gate PyPy 7.3.22 overlay behind OverridePyPyVersion variabl…
kshitij-microsoft May 17, 2026
09a71ae
ci(pypy): make PyPy override step matrix-driven via PyPyBuildVersion …
kshitij-microsoft May 17, 2026
114da00
cleanup: revert seed README change and remove pypy reproducer file
kshitij-microsoft May 18, 2026
41e8843
Merge branch 'main' into kchawla/pypy311Fix
kshitij-microsoft May 18, 2026
e9d1a43
limit blast radius. this is going to hit issues with CFSClean most li…
scbedd May 20, 2026
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
54 changes: 54 additions & 0 deletions eng/pipelines/templates/steps/use-python-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,60 @@ steps:
}
displayName: 'Use Public Feed'

# Optional override for the hosted toolcache PyPy build. Activated when the
# matrix entry sets:
# OverridePyPyVersion: "true"
# PyPyBuildVersion: "v7.3.22" (or any release from downloads.python.org/pypy)
# PyPyLangVersion: "3.11.15" (the Python language version directory in the toolcache)
# Rationale: PyPy 7.3.21 (currently in the hosted toolcache for Python 3.11.15)
# crashes with `Fatal RPython error: AssertionError` from
# `PythonCodeMaker_duplicate_exits_without_lineno` while compiling
# `azure.ai.ml`. PyPy 7.3.22+ does not exhibit this bug.
- bash: |
set -euo pipefail
Copy link
Copy Markdown
Member

@scbedd scbedd May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty solid. It's basically exactly what I was looking for. HOWEVER. I don't think I would want all builds to pay this toll by default. Which is what will happen here.

EDIT: I pushed updates make this local to ml only for now.

PYPY_BUILD="${PYPY_BUILD_VERSION:?PyPyBuildVersion must be set in the matrix when OverridePyPyVersion=true}"
PY_LANG="${PYPY_LANG_VERSION:?PyPyLangVersion must be set in the matrix when OverridePyPyVersion=true}"
TARGET="/opt/hostedtoolcache/PyPy/${PY_LANG}/x64"
WANT_MICRO="${PYPY_BUILD#v}"
if [ -x "${TARGET}/bin/python3" ]; then
CURRENT=$("${TARGET}/bin/python3" -c 'import sys; v=sys.pypy_version_info; print(f"{v.major}.{v.minor}.{v.micro}")') || CURRENT="unknown"
echo "Existing toolcache PyPy: ${CURRENT}"
if [ "$CURRENT" = "$WANT_MICRO" ]; then
echo "PyPy ${WANT_MICRO} already installed; nothing to do."
exit 0
fi
fi
echo "Installing PyPy ${PYPY_BUILD} for Python ${PY_LANG} into ${TARGET}..."
TARBALL="pypy3.11-${PYPY_BUILD}-linux64.tar.bz2"
cd /tmp
curl -sSLO "https://downloads.python.org/pypy/${TARBALL}"
Comment thread
danieljurek marked this conversation as resolved.
tar xjf "${TARBALL}"
sudo rm -rf "${TARGET}"
sudo mkdir -p "$(dirname "${TARGET}")"
sudo mv "pypy3.11-${PYPY_BUILD}-linux64" "${TARGET}"
# Recreate the python3/python symlinks that the upstream toolcache layout provides.
if [ ! -e "${TARGET}/bin/python3" ]; then
sudo ln -sf "${TARGET}/bin/pypy3.11" "${TARGET}/bin/python3"
fi
if [ ! -e "${TARGET}/bin/python" ]; then
sudo ln -sf "${TARGET}/bin/pypy3.11" "${TARGET}/bin/python"
fi
sudo touch "${TARGET}.complete"
"${TARGET}/bin/python3" --version
# The plain pypy tarball does not include pip; the Azure hosted
# toolcache build does. Bootstrap pip via ensurepip so downstream
# steps (e.g. `python -m pip install uv`) keep working.
if ! "${TARGET}/bin/python3" -c "import pip" >/dev/null 2>&1; then
echo "Bootstrapping pip via ensurepip..."
sudo "${TARGET}/bin/python3" -m ensurepip --upgrade
fi
"${TARGET}/bin/python3" -m pip --version
env:
PYPY_BUILD_VERSION: $(PyPyBuildVersion)
PYPY_LANG_VERSION: $(PyPyLangVersion)
displayName: 'Override hosted toolcache PyPy build'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['OverridePyPyVersion'], 'true'))

- task: UsePythonVersion@0
displayName: "Use Python ${{ parameters.versionSpec }}"
inputs:
Expand Down
5 changes: 5 additions & 0 deletions sdk/ml/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ extends:
ServiceDirectory: ml
TestTimeoutInMinutes: 75
TestProxy: true
MatrixConfigs:
- Name: Python_ml_ci_matrix
Path: sdk/ml/platform-matrix.json
Selection: sparse
GenerateVMJobs: true
# This is a short term solution to create API review for python azure-ml package only when running pipeline manually
# Long term solution should be to have different versions on main branch and release branch for python package so APIView can have different revisions for each version.
# Tracking issue: https://github.com/Azure/azure-sdk-for-python/issues/29196
Expand Down
76 changes: 76 additions & 0 deletions sdk/ml/platform-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"displayNames": {
"--disablecov": "",
"false": "",
"true": ""
},
"matrix": {
"Agent": {
"ubuntu-24.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" },
"windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" }
},
"PythonVersion": [ "3.10", "3.12" ],
"CoverageArg": "--disablecov",
"TestSamples": "false"
},
"include": [
{
"MacTestConfig": {
"macos311": {
"OSVmImage": "env:MACVMIMAGE",
"Pool": "env:MACPOOL",
"PythonVersion": "3.11",
"CoverageArg": "--disablecov",
"TestSamples": "false"
}
}
},
{
"PyPyConfig": {
"ubuntu2404_pypy311": {
"OSVmImage": "env:LINUXVMIMAGE",
"Pool": "env:LINUXPOOL",
"PythonVersion": "pypy3.11",
"CoverageArg": "--disablecov",
"TestSamples": "false",
"OverridePyPyVersion": "true",
"PyPyBuildVersion": "v7.3.22",
"PyPyLangVersion": "3.11.15"
}
}
},
{
"CoverageConfig": {
"ubuntu2404_310_coverage": {
"OSVmImage": "env:LINUXVMIMAGE",
"Pool": "env:LINUXPOOL",
"PythonVersion": "3.10",
"CoverageArg": "",
"TestSamples": "false"
}
}
},
{
"Config": {
"Ubuntu2404_313": {
"OSVmImage": "env:LINUXVMIMAGE",
"Pool": "env:LINUXPOOL",
"PythonVersion": "3.13",
"CoverageArg": "--disablecov",
"TestSamples": "false"
}
}
},
{
"Config": {
"Ubuntu2404_314": {
"OSVmImage": "env:LINUXVMIMAGE",
"Pool": "env:LINUXPOOL",
"PythonVersion": "3.14",
"CoverageArg": "--disablecov",
"TestSamples": "false"
}
}
}
]
}