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.

  1. is practice mix setuptools , numpy.distribute?
  2. does order import them matter? should import setuptools first?
  3. 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

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -