contextlib2/dev/sync_from_cpython.sh
Nick Coghlan c223508344 Sync with CPython 3.12.3
Also adds some helper scripts for the sync process

Closes #43
2024-05-23 16:55:15 +10:00

19 lines
594 B
Bash
Executable file

#!/bin/sh
git_root="$(git rev-parse --show-toplevel)"
cpython_dir="${1:-$git_root/../cpython}" # Folder with relevant CPython version
function sync_file()
{
cp -fv "$cpython_dir/$1" "$git_root/$2"
}
sync_file "Doc/library/contextlib.rst" "docs/contextlib2.rst"
sync_file "Lib/contextlib.py" "contextlib2/__init__.py"
sync_file "Lib/test/test_contextlib.py" "test/test_contextlib.py"
sync_file "Lib/test/test_contextlib_async.py" "test/test_contextlib_async.py"
echo
echo "Note: Update the 'contextlib2/__init__.pyi' stub as described in the file"
echo