Packaging legacy FORTRAN in Python. Is it OK to use `setuptools` and `numpy.distutils`? -
i trying make python package distribution popular fortran codes in field. want use standard approach setup.py file. related qustion helpful learning how wrap fortran extensions.
when using approach, noticed confusing behavior when mixing setuptools , numpy.distutils. bad practice mix two? of 2015, seems preferable use setuptools as possible.
however, build fortran extensions in way compatible numpy. import numpy.distutils extension , setup.
i'm using following basic approach:
from setuptools.command.develop import develop numpy.distutils.core import extension, setup ext_modules=[extension("my_package.fortran_mod", sources=['src/fortran_mod.f'])] class mydevelop(develop): def run(self): my_script() develop.run(self) setup( ... ext_modules=ext_modules, cmdclass={'develop':mydevelop}) this seems work have questions.
- is practice mix
setuptools,numpy.distribute? - does order import them matter? should import
setuptoolsfirst? - is there official up-to-date tutorial packaging extensions
numpy? perhaps 1 discussion fortran extensions?
--
some links
https://www.youtube.com/watch?v=r4yb-8tb0j0
http://www.fortran90.org/src/best-practices.html#interfacing-with-python
Comments
Post a Comment