2005-12-15 17:06:02 +00:00
|
|
|
#!/usr/bin/env python
|
2014-01-05 08:57:27 -10:00
|
|
|
from setuptools import setup, Extension
|
2009-09-21 11:12:00 +00:00
|
|
|
import os,sys,shutil
|
2014-01-05 08:57:27 -10:00
|
|
|
import subprocess
|
|
|
|
|
import sys
|
2005-11-18 00:53:15 +00:00
|
|
|
|
2006-04-19 15:37:47 +00:00
|
|
|
about = """The Open Babel package provides a Python wrapper
|
Merged revisions 3091-3094,3097-3100 via svnmerge from
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/branches/openbabel-2-2-x
........
r3091 | ghutchis | 2009-06-22 00:24:46 +0200 (Mon, 22 Jun 2009) | 5 lines
* src/chains.cpp (OpenBabel): Fix for PR#2691618. When writing
hydrogen atoms without chain names, make sure there are never
spaces.
........
r3092 | ghutchis | 2009-06-22 15:24:47 +0200 (Mon, 22 Jun 2009) | 4 lines
* src/generic.cpp: Fix unit cell when setting possibly zero
translation vectors ( e.g. PR#1961604).
........
r3093 | timvdm | 2009-06-22 22:54:24 +0200 (Mon, 22 Jun 2009) | 2 lines
Fix phmodel.txt rules to match both free & polymerized amino acids.
........
r3094 | ghutchis | 2009-06-24 00:06:49 +0200 (Wed, 24 Jun 2009) | 2 lines
Updated from Tim's recent change.
........
r3097 | ghutchis | 2009-06-24 21:26:55 +0200 (Wed, 24 Jun 2009) | 2 lines
Added Craig's changes for randomized SMILES order.
........
r3098 | ghutchis | 2009-06-25 05:36:47 +0200 (Thu, 25 Jun 2009) | 4 lines
* src/generic.cpp (OBUnitCell): Make sure to set the space group
to P1 by default and after FillUnitCell.
........
r3099 | ghutchis | 2009-06-25 05:36:56 +0200 (Thu, 25 Jun 2009) | 6 lines
* src/formats/mopacformat.cpp: Read and write translation vectors,
if available.
* src/formats/gaussformat.cpp: Ditto
........
r3100 | ghutchis | 2009-06-25 20:14:18 +0200 (Thu, 25 Jun 2009) | 2 lines
Fix PR#2784880 -- compiling with OPENBABEL_INSTALL set fails (e.g., on MacPorts).
........
2009-07-18 09:55:34 +00:00
|
|
|
to the Open Babel C++ chemistry library. Open Babel is a chemical
|
|
|
|
|
toolbox designed to speak the many languages of chemical data. It's an
|
|
|
|
|
open, collaborative project allowing anyone to search, convert,
|
|
|
|
|
analyze, or store data from molecular modeling, chemistry, solid-state
|
|
|
|
|
materials, biochemistry, or related areas. It provides a broad base of
|
|
|
|
|
chemical functionality for custom development.
|
2006-04-19 15:37:47 +00:00
|
|
|
"""
|
2014-01-05 08:57:27 -10:00
|
|
|
version = "1.8"
|
|
|
|
|
try:
|
|
|
|
|
subprocess.check_output("pkg-config --exists openbabel-2.0".split())
|
|
|
|
|
except:
|
|
|
|
|
print ("pkg-config could not find an openbabel instal. Please install openbabel and rerun setup.py.")
|
|
|
|
|
sys.exit(1)
|
2006-04-19 15:37:47 +00:00
|
|
|
|
2014-01-05 08:57:27 -10:00
|
|
|
|
|
|
|
|
babel_version = subprocess.Popen("pkg-config --modversion openbabel-2.0".split(),
|
|
|
|
|
stdout=subprocess.PIPE).stdout.readline().decode("utf-8")
|
|
|
|
|
|
|
|
|
|
include_dirs = subprocess.Popen("pkg-config --variable=pkgincludedir openbabel-2.0".split(),
|
|
|
|
|
stdout=subprocess.PIPE).stdout.readline().decode("utf-8").split()
|
|
|
|
|
|
|
|
|
|
lib_dirs = subprocess.Popen("pkg-config --variable=libdir openbabel-2.0".split(),
|
|
|
|
|
stdout=subprocess.PIPE).stdout.readline().decode("utf-8").split()
|
|
|
|
|
|
|
|
|
|
#Code should be added here to ensure these directories exist, and that this version of babel is compatible
|
|
|
|
|
#with this python package.
|
|
|
|
|
|
|
|
|
|
swig_opts = ["-c++", "-small", "-O", "-templatereduce", "-naturalvar"]
|
|
|
|
|
swig_opts += ["-I%s" % i for i in include_dirs]
|
2005-11-18 00:53:15 +00:00
|
|
|
|
2010-05-09 19:45:42 +00:00
|
|
|
obExtension = Extension('_openbabel',
|
2014-01-05 08:57:27 -10:00
|
|
|
["openbabel-python.i"],
|
|
|
|
|
include_dirs=include_dirs,
|
|
|
|
|
library_dirs=lib_dirs,
|
|
|
|
|
swig_opts=swig_opts,
|
|
|
|
|
libraries=["openbabel"]
|
2010-03-13 11:57:35 +00:00
|
|
|
)
|
2005-12-15 17:06:02 +00:00
|
|
|
|
2005-11-18 00:53:15 +00:00
|
|
|
setup(name='openbabel',
|
2014-01-05 08:57:27 -10:00
|
|
|
zip_safe=True,
|
|
|
|
|
version=version,
|
2007-09-03 20:53:06 +00:00
|
|
|
author='Noel O\'Boyle',
|
2005-11-18 00:53:15 +00:00
|
|
|
author_email='openbabel-scripting@lists.sourceforge.net',
|
Merged revisions 3091-3094,3097-3100 via svnmerge from
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/branches/openbabel-2-2-x
........
r3091 | ghutchis | 2009-06-22 00:24:46 +0200 (Mon, 22 Jun 2009) | 5 lines
* src/chains.cpp (OpenBabel): Fix for PR#2691618. When writing
hydrogen atoms without chain names, make sure there are never
spaces.
........
r3092 | ghutchis | 2009-06-22 15:24:47 +0200 (Mon, 22 Jun 2009) | 4 lines
* src/generic.cpp: Fix unit cell when setting possibly zero
translation vectors ( e.g. PR#1961604).
........
r3093 | timvdm | 2009-06-22 22:54:24 +0200 (Mon, 22 Jun 2009) | 2 lines
Fix phmodel.txt rules to match both free & polymerized amino acids.
........
r3094 | ghutchis | 2009-06-24 00:06:49 +0200 (Wed, 24 Jun 2009) | 2 lines
Updated from Tim's recent change.
........
r3097 | ghutchis | 2009-06-24 21:26:55 +0200 (Wed, 24 Jun 2009) | 2 lines
Added Craig's changes for randomized SMILES order.
........
r3098 | ghutchis | 2009-06-25 05:36:47 +0200 (Thu, 25 Jun 2009) | 4 lines
* src/generic.cpp (OBUnitCell): Make sure to set the space group
to P1 by default and after FillUnitCell.
........
r3099 | ghutchis | 2009-06-25 05:36:56 +0200 (Thu, 25 Jun 2009) | 6 lines
* src/formats/mopacformat.cpp: Read and write translation vectors,
if available.
* src/formats/gaussformat.cpp: Ditto
........
r3100 | ghutchis | 2009-06-25 20:14:18 +0200 (Thu, 25 Jun 2009) | 2 lines
Fix PR#2784880 -- compiling with OPENBABEL_INSTALL set fails (e.g., on MacPorts).
........
2009-07-18 09:55:34 +00:00
|
|
|
url='http://openbabel.org/',
|
2006-04-19 15:37:47 +00:00
|
|
|
license='http://www.gnu.org/copyleft/gpl.html',
|
2006-11-18 13:31:04 +00:00
|
|
|
py_modules=['openbabel','pybel'],
|
2008-06-17 19:03:50 +00:00
|
|
|
ext_modules=[obExtension],
|
2006-04-19 15:37:47 +00:00
|
|
|
description = 'openbabel: Python interface to the Open Babel chemistry library',
|
|
|
|
|
classifiers=[
|
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
|
'Environment :: Console',
|
|
|
|
|
'Environment :: Other Environment',
|
|
|
|
|
'Intended Audience :: Education',
|
|
|
|
|
'Intended Audience :: Science/Research',
|
|
|
|
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
|
|
|
|
'Natural Language :: English',
|
|
|
|
|
'Operating System :: MacOS :: MacOS X',
|
|
|
|
|
'Operating System :: Microsoft :: Windows',
|
|
|
|
|
'Operating System :: OS Independent',
|
|
|
|
|
'Operating System :: POSIX',
|
|
|
|
|
'Operating System :: POSIX :: Linux',
|
|
|
|
|
'Operating System :: Unix',
|
|
|
|
|
'Programming Language :: C++',
|
|
|
|
|
'Programming Language :: Python',
|
|
|
|
|
'Topic :: Scientific/Engineering :: Bio-Informatics',
|
|
|
|
|
'Topic :: Scientific/Engineering :: Chemistry',
|
|
|
|
|
'Topic :: Software Development :: Libraries',
|
|
|
|
|
],
|
|
|
|
|
long_description = about,
|
|
|
|
|
)
|