dsacre/mididings

mididings should use setuptools

Closed this issue · 4 comments

So that python setup.py develop and other extensions, which make development easier, are supported.

Changing:

from distutils.core import setup, Extension

in setup.py to:

try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension

should be enough.

Pull request #4

Looks good to me.

BTW, I don't really use setup.py during development at all. The reason is that distutils/setuptools doesn't handle dependencies between C++ source files. It rebuilds everything when a single .cc file changes, but doesn't rebuild anything when only headers change.
Instead I usually build with SCons (scons -C src) and set PYTHONPATH=src:. to run mididings from the source directory.

What about Python 3? AFAIK, Scons doesn't support it yet. If I build mididings with the system wide Scons in a virtualenv (with Python 3.4), it will build it for Python 2.7 !?

SCons itself uses Python 2, but that doesn't prevent it from building mididings for Python 3. You just need to set LIBS, CPPPATH and possibly LIBPATH manually (instead of getting the latter two from sysconfig, which will return the Python 2 paths).
For example, in my local copy of SConstruct I have LIBS = ['boost_python-py34', 'boost_thread'] and CPPPATH = ['/usr/include/python3.4m'], and the result is a perfectly fine Python 3 extension module.