Skip to content

CI: free disk space before setup-python (fixes molecule GEN_EMAIL failure) - #60

Merged
compscidr merged 2 commits into
mainfrom
fix/molecule-python-toolcache
Oct 13, 2026
Merged

compscidr merged 2 commits into
mainfrom
fix/molecule-python-toolcache

Conversation

@compscidr

@compscidr compscidr commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

Molecule has failed on main since #57/#58 with:

AttributeError: module 'lib' has no attribute 'GEN_EMAIL'

The "Free up disk space" step ran after setup-python and does sudo rm -rf "$AGENT_TOOLSDIRECTORY", which is the tool cache setup-python installs into. So python fell back to the image's 3.12, pip install -r requirements.txt installed into ~/.local on top of the system dist-packages, and the freshly resolved cryptography 50.x broke the system pyOpenSSL that boto3 imports 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:

AttributeError: module 'dataclasses' has no attribute '_is_type'

Change

Testing

This PR's own molecule run. Blocks #59.

Follow-up: make the molecule checks required on main. Only Ansible Lint is 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

…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>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 16:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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>
@compscidr
compscidr merged commit bafad91 into main Oct 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants