Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* moved configuration from setup.py to setup.py.in and force Makefile to create setup.py * removed hardcoding from setup and put it in Makedoc * check for NumPy before building extensions that require it * updated Makedoc to generate long description and packages * only import peppy.* if wx is around -- there are things that don't require wx svn-revision: r295
- Loading branch information
1 parent
0512b84
commit 88ce9bb
Showing
5 changed files
with
183 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/usr/bin/env python | ||
|
||
# Relatively generic setup.py that should be easily tailorable to | ||
# other python modules. It gets most of the parameters from the | ||
# packaged module itself, so this file shouldn't have to be changed | ||
# much. | ||
|
||
import os,sys,distutils, glob | ||
from distutils.core import setup, Extension | ||
|
||
if sys.version < '2.3': | ||
raise SystemExit('Sorry, peppy requires at least Python 2.3 because wxPython does.') | ||
|
||
# ignore a warning about large int constants in Python 2.3.* | ||
if sys.version >= '2.3' and sys.version < '2.4': | ||
import warnings | ||
warnings.filterwarnings('ignore', "hex/oct constants", FutureWarning) | ||
|
||
|
||
# use windows batch files if we're on windows | ||
scripts = ['scripts/peppy'] | ||
from distutils import util | ||
if util.get_platform()[:3] == 'win': | ||
scripts = [script + '.bat' for script in scripts] | ||
|
||
# set up extension modules | ||
ext_modules = [] | ||
include_dirs = [] | ||
|
||
# check NumPy support for building the hsi extension module | ||
HAVE_NUMPY=False | ||
try: | ||
import numpy | ||
HAVE_NUMPY=True | ||
|
||
# Function to find numpy's include directory | ||
def get_numpy_include(): | ||
for directory in sys.path: | ||
d = os.walk(directory) | ||
for i in d: | ||
if 'numpy' in i[0]: | ||
if 'core' in i[0]: | ||
if 'include' in i[0]: | ||
return i[0] | ||
return '.' | ||
|
||
numpy_include = get_numpy_include() | ||
print 'numpy include = %s' % numpy_include | ||
if numpy_include =='.': | ||
print "numpy headers were not found! Fast array support will not be enabled." | ||
HAVE_NUMPY=False | ||
else: | ||
include_dirs.append(numpy_include) | ||
numarray_compat = os.path.join(os.path.dirname(os.path.dirname(numpy_include)),'numarray','numpy') | ||
include_dirs.append(numarray_compat) | ||
except ImportError: | ||
pass | ||
|
||
if HAVE_NUMPY: | ||
ext_modules.append(Extension('peppy.hsi._utils', | ||
sources = ['peppy/hsi/_utils.c'], | ||
include_dirs = include_dirs, | ||
)) | ||
|
||
setup(name = '$prog', | ||
version = '$version', | ||
description = '$description', | ||
long_description = '$long_description', | ||
keywords = '$keywords', | ||
license = '$license', | ||
author = '$author', | ||
author_email = '$author_email', | ||
url = '$url', | ||
download_url = '$download_url', | ||
platforms='any', | ||
scripts=scripts, | ||
packages = $packages, | ||
package_data={'peppy': ['icons/*'], | ||
}, | ||
ext_modules = ext_modules, | ||
|
||
classifiers=['Development Status :: 3 - Alpha', | ||
'Environment :: MacOS X', | ||
'Environment :: Win32 (MS Windows)', | ||
'Environment :: X11 Applications', | ||
'Intended Audience :: Developers', | ||
'Framework :: Trac', | ||
'License :: OSI Approved :: GNU General Public License (GPL)', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Operating System :: Microsoft :: Windows', | ||
'Operating System :: POSIX', | ||
'Operating System :: POSIX :: Linux', | ||
'Operating System :: Unix', | ||
'Programming Language :: Python', | ||
'Topic :: Software Development :: Documentation', | ||
'Topic :: Text Editors', | ||
'Topic :: Text Editors :: Documentation', | ||
] | ||
) |