Repository navigation
CI: free disk space before setup-python (fixes molecule GEN_EMAIL failure) - #60
Conversation
…d Python The cleanup removed $AGENT_TOOLSDIRECTORY after setup-python had installed 3.15 into it, so `python` fell back to the image's 3.12 and pip installed over the system packages. The new cryptography (50.x) broke the system pyOpenSSL that boto3 loads via molecule-plugins' ec2 driver: AttributeError: module 'lib' has no attribute 'GEN_EMAIL'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change is a single, correct reordering of an existing CI step with no duplication or YAML issues, matching the stated fix.
0 open findings
What changed in this PR
This PR fixes a recurring Molecule CI failure (AttributeError: module 'lib' has no attribute 'GEN_EMAIL') by reordering the CI workflow so the "Free up disk space" step runs before actions/setup-python. Previously the cleanup ran after setup-python and deleted $AGENT_TOOLSDIRECTORY (the tool cache setup-python populates), causing python to fall back to the image's 3.12 and pip to install over system packages, which broke pyOpenSSL/boto3 via cryptography 50.x.
Changes:
- Moved the "Free up disk space" step to run immediately after checkout and before "Set up Python".
- Added an explanatory comment clarifying why the cleanup must precede
setup-python.
| File | Description |
|---|---|
| .github/workflows/lint-and-test.yml | Relocates the disk-cleanup step ahead of setup-python so the tool cache survives, with a comment explaining the ordering constraint. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Molecule has failed on
mainsince #57/#58 with:The "Free up disk space" step ran after
setup-pythonand doessudo rm -rf "$AGENT_TOOLSDIRECTORY", which is the tool cachesetup-pythoninstalls into. Sopythonfell back to the image's 3.12,pip install -r requirements.txtinstalled into~/.localon top of the system dist-packages, and the freshly resolved cryptography 50.x broke the system pyOpenSSL thatboto3imports through molecule-plugins' ec2 driver.With that fixed, molecule really ran on 3.15 for the first time (#58's bump had never been exercised), and ansible-core 2.21 doesn't import on it:
Change
setup-python.Testing
This PR's own molecule run. Blocks #59.
Follow-up: make the molecule checks required on
main. OnlyAnsible Lintis required today, which is why Renovate's platform automerge merged #57 and #58 with every molecule job red. That also stops a future 3.15 bump from merging red.🤖 Generated with Claude Code