Skip to content

fix(install-env): patch PyFoam vendored six.py for Python 3.12+#827

Open
yehudarav wants to merge 1 commit into
masterfrom
fix/pyfoam-six-py312
Open

fix(install-env): patch PyFoam vendored six.py for Python 3.12+#827
yehudarav wants to merge 1 commit into
masterfrom
fix/pyfoam-six-py312

Conversation

@yehudarav
Copy link
Copy Markdown
Collaborator

Summary

  • PyFoam 2023.7 ships a 2016-era six.py (v1.10) whose _SixMetaPathImporter trick breaks on Python 3.12+, so from PyFoam.ThirdParty.six.moves import configparser fails.
  • After pip install, set_hera_environment.sh now overwrites PyFoam's vendored six.py with the venv's modern six (v1.17+), restoring the import.
  • The patch is idempotent and is a no-op if either six or PyFoam.ThirdParty is missing, so older Python versions and partial installs are unaffected.

Test plan

  • Fresh install on Ubuntu 24.04 (Python 3.12) via source set_hera_environment.sh — verify python -c "from PyFoam.ThirdParty.six.moves import configparser" succeeds.
  • Re-run the script on an existing install — verify the patch step is skipped cleanly.
  • Smoke-test a hera command that exercises PyFoam (e.g. the OpenFOAM preprocess path).

🤖 Generated with Claude Code

PyFoam 2023.7 ships six.py v1.10 (2016), whose _SixMetaPathImporter
trick no longer works under Python 3.12's tightened import machinery,
breaking `from PyFoam.ThirdParty.six.moves import configparser`.

Overwrite the vendored copy with the venv's modern six during install
so the fix is reproducible across clean environments.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant