con un clic
compare-cpython-versions
// Compare CPython source code between two Python versions to identify changes in headers and structs. Use this when adding support for a new Python version to understand what changed between versions.
// Compare CPython source code between two Python versions to identify changes in headers and structs. Use this when adding support for a new Python version to understand what changed between versions.
Run targeted linting, formatting, and code quality checks on modified files. Use this to validate code style, type safety, security, and other quality metrics before committing. Supports running all checks or targeting specific checks on specific files for efficient validation.
Validate code changes by intelligently selecting and running the appropriate test suites. Use this when editing code to verify changes work correctly, run tests, validate functionality, or check for regressions. Automatically discovers affected test suites, selects the minimal set of venvs needed for validation, and handles test execution with Docker services as needed.
Diagnose and fix slow base venv build times caused by unnecessary recompilation of native extensions (CMake, Cython, Rust) across riot generate runs. Use when CI base venv builds are slow, when ext_cache isn't saving time, or when investigating warm build regressions.
Run performance benchmarks to measure the impact of code changes. Discovers relevant benchmark scenarios based on changed files, executes them comparing a baseline version against local changes, and summarizes performance results. Use this when touching performance-sensitive code paths or when asked about performance impact.
Review CI results for the current branch, commit, or PR using the Datadog MCP. Use this when CI is failing, to understand what's blocking a PR, or to get actionable fix instructions for failed jobs and tests.
Run circular import detection against ddtrace and propose architectural fixes for any cycles found. Use this when adding or refactoring modules, or when the detect_circular_imports CI job reports new cycles on a PR.
| name | compare-cpython-versions |
| description | Compare CPython source code between two Python versions to identify changes in headers and structs. Use this when adding support for a new Python version to understand what changed between versions. |
| allowed-tools | ["Bash","Read","Grep","WebSearch","TodoWrite"] |
This skill helps compare CPython source code between two Python versions to identify changes in headers, structs, and APIs that affect our codebase.
Use this skill when:
find-cpython-usage skill# Create ~/dd directory if it doesn't exist
mkdir -p ~/dd
# Clone CPython repository if needed (to ~/dd/cpython)
if [ ! -d ~/dd/cpython ]; then
git clone https://github.com/python/cpython.git ~/dd/cpython
cd ~/dd/cpython
git fetch --tags
else
cd ~/dd/cpython
# Update existing repository
git fetch --tags
git fetch origin
fi
Using the list of headers from find-cpython-usage, compare each header between
the old version and new version. Replace OLD_VERSION and NEW_VERSION with the
actual version tags (e.g., v3.13.0, v3.14.0):
# Compare specific headers between versions
git diff OLD_VERSION NEW_VERSION -- Include/internal/pycore_frame.h
git diff OLD_VERSION NEW_VERSION -- Include/frameobject.h
# Compare all internal headers
git diff OLD_VERSION NEW_VERSION -- 'Include/internal/pycore*.h'
# Compare specific struct definitions
git diff OLD_VERSION NEW_VERSION -- Include/internal/pycore_frame.h | grep -A 20 "struct _PyInterpreterFrame"
For each header/struct, look for:
Struct Changes:
API Changes:
Header Changes:
For each change identified:
Understand the change:
Why was it changed? (Check Python's What's New, PEPs, or GitHub issues)
Is it a breaking change or backward compatible?
What's the replacement API?
Find the specific commit(s) that introduced the change:
# Find commits that modified a specific file between versions
git log OLD_VERSION..NEW_VERSION -- Include/internal/pycore_frame.h
# Find commits that mention a specific struct or function
git log OLD_VERSION..NEW_VERSION --all --grep="_PyInterpreterFrame" -- Include/
# Show the commit that introduced a specific change
git log -p OLD_VERSION..NEW_VERSION -S "struct _PyInterpreterFrame" -- Include/
Find related GitHub issues:
gh-123923, #123923)https://github.com/python/cpython/issueshttps://docs.python.org/3/whatsnew/Assess impact:
Document findings:
You can use AI coding assistants to help analyze differences by:
When comparing versions, look for these types of changes (examples):
Struct Field Changes:
Header Moves:
API Deprecations:
After running this skill, you should have: