madscatt / zazmol

Library for defining molecular objects to create simulation and analysis programs To install: python setup.py install dependencies: numpy, mocker
GNU General Public License v3.0
0 stars 2 forks source link

`setup.py` is not using `setuptools` and therefore does not support the `develop` option #2

Closed madscatt closed 8 years ago

madscatt commented 8 years ago

Currently, the setup.py does not support the develop option, allowing one to run edited code without re-installing.

python setup.py develop
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help

error: invalid command 'develop'

I tried using

try: from setuptools import setup except ImportError: pass This led to a new error:

python setup.py develop running develop running egg_info creating sasmol.egg-info writing sasmol.egg-info/PKG-INFO writing top-level names to sasmol.egg-info/top_level.txt writing dependency_links to sasmol.egg-info/dependency_links.txt writing manifest file 'sasmol.egg-info/SOURCES.txt' error: each element of 'ext_modules' option must be an Extension instance or 2-tuple

Well, sasmol & distutils has to be re-addressed, especially with Python 3.X details.

Keep the comments coming, now worries.

madscatt commented 8 years ago

We need setup from numpy due to fortran extensions. You can get the develop option by adding

import setuptools

before the

from numpy.distutils.core import Extension, setup

import

StevenCHowell commented 8 years ago

I just looked at this again and mostly confirmed what you have here. To use the develop option, to avoid reinstalling when changing code, Extensions and setup need to be imported from setuptools rather than from numpy.distutils.core. This breaks the current wrapped Fortran code. In short, it seems a much larger change to make this happen than time currently permits.

There is an open stack overflow questios related to this exact question. The comments point to using Cython to move away from the legacy requirements of numpy's distutils. This is worth looking at eventually.