Repository navigation
test(tools): create hard links with os.link for Python 3.9 - #4545
Conversation
Path.hardlink_to was added in Python 3.10, so import_audit and stubgen errored on Python 3.9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested with Python 3.9.25, with 4feeef6 applied onto main 5d50886:
For reference, |
|
Windows test: head AI-assisted (Claude Code). |
|
Checked: |
What
import_auditandstubgenerror on Python 3.9 before reaching their assertions:Path.hardlink_towas added in Python 3.10. Python 3.9.6 is thepython3that the Xcode command-line tools install on macOS, which is the toolchain BUILD.md names for the relinker-only build there, andtools/progress.pytargets Python 3.9+ (#11). The two tests now create the hard link withos.link(target, link), which does the same on every Python 3 version and on Windows. Only the two test files change.pr_overlap_encodingalso fails on Python 3.9 (subprocess._text_encoding). That is a different cause, and #4361 changes that file, so it is left out here.Overlap: #4425 also adds
import osat the same place intools/tests/test_import_audit.py. As agreed on #4425, it goes first; I will then rebase this one, keeping a singleimport os.Tested
macOS 27 (Apple Silicon), AppleClang 21, relinker-only build of
main(d592d54) with-DBUILD_TESTING=ON:import_auditandstubgenfail with the error above; 121/124 pass.import_auditandstubgenpass; 123/124 pass, withpr_overlap_encodingthe only failure.test_import_audit.py(37 tests) andtest_stubgen.py(11 tests) pass.python3 tools/check_conventions.py --base origin/mainpasses.Not tested on Linux or Windows.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code