Skip to content

Bundled package into sdist so you can directly install via pip install pyofm#15

Merged
friedenhe merged 1 commit intomdolab:mainfrom
OpenOrion:main
Sep 16, 2025
Merged

Bundled package into sdist so you can directly install via pip install pyofm#15
friedenhe merged 1 commit intomdolab:mainfrom
OpenOrion:main

Conversation

@afshawnlotfi
Copy link
Copy Markdown
Contributor

@afshawnlotfi afshawnlotfi commented Sep 10, 2025

🚀 Transform pyOFM into Modern PyPI Package with Automatic Build System

https://pypi.org/project/pyofm/

Overview

This PR transforms pyOFM from requiring manual make steps into a fully automatic PyPI package that seamlessly compiles Cython extensions during pip install.

✨ Key Changes

🏗️ Automatic Build System

  • Enhanced setup.py: Added build_cython_extension() that:
    • Auto-detects OpenFOAM environment (FOAM_SRC, FOAM_LIBBIN)
    • Compiles Cython extensions using OpenFOAM's proven wmake system
    • Works in both repository and PyPI sdist contexts
    • Gracefully falls back to pure Python when OpenFOAM unavailable

📦 Modern Python Packaging

  • pyproject.toml: Modern build system configuration
  • MANIFEST.in: Proper source file inclusion for sdist
  • Enhanced Makefile: Added packaging targets (dist, wheel, sdist, upload-pypi)
  • Updated README.md: Comprehensive installation instructions

🎯 User Experience Transformation

Before:

source /path/to/openfoam/etc/bashrc
make
pip install .

After:

source /path/to/openfoam/etc/bashrc
pip install pyofm  # ONE COMMAND - AUTOMATIC COMPILATION!

Verified Functionality

  • ✅ Local repository installation with automatic compilation
  • ✅ Source distribution (sdist) creation and installation
  • ✅ Real-world mesh loading performance (32.5M points, 96.2M faces)
  • ✅ Cross-platform compatibility (ARM64/x86_64)

🚀 PyPI Deployment Ready

Package is now ready for PyPI publication with seamless user experience.


📋 PyPI Ownership Transfer

I can transfer PyPI package ownership to you through these steps:

  1. Package Publication: I'll publish the initial version to PyPI under a temporary account
  2. Add You as Owner: Add your PyPI username as package owner/maintainer
  3. Transfer Ownership: Transfer full ownership to your account
  4. Remove Temporary Access: Clean up temporary access

@afshawnlotfi afshawnlotfi requested a review from a team as a code owner September 10, 2025 19:30
… files

- Introduced a GitHub Actions workflow for publishing the Python package to PyPI.
- Updated README with features, requirements, and installation instructions.
- Enhanced MANIFEST.in to include additional source files and test data.
- Modified setup.py to support Cython extensions and OpenFOAM integration.
- Updated version to 1.2.4 in __init__.py.
@friedenhe friedenhe merged commit e84788d into mdolab:main Sep 16, 2025
0 of 2 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