1. Tarek Ziadé
  2. hitchhiker-guide-packaging
  3. Issues
Issue #14 new

How to create a module distribution to gracefully fall-back to pure Python code

Craig McQueen
created an issue

I've created a Python package with a C extension. But I've never used IronPython or Jython or anything besides CPython. So I'm not sure if someone using IronPython could install this package that specifies a C extension using the {{{ext_modules}}} parameter.

I've written the module {{{init.py}}} so that it tries to import the C extension, and if that fails, it imports a pure Python version. So that should work nicely I think. But I'm not sure if my {{{setup.py}}} would successfully deploy on a Python version that cannot compile and install the C extension.

It would be great if the packaging guide could explain this scenario.