Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 578 lines (509 sloc) 18.142 kb
22df84e Updated setup.py for GenBank
chapmanb authored
1 """Distutils based setup script for Biopython.
2
3 This uses Distutils (http://python.org/sigs/distutils-sig/) the standard
4 python mechanism for installing packages. For the easiest installation
5 just type the command:
6
7 python setup.py install
8
9 For more in-depth instructions, see the installation section of the
10 biopython manual, linked to from:
11
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
12 http://www.biopython.org/documentation/
22df84e Updated setup.py for GenBank
chapmanb authored
13
14 Or for more details about the options available from distutils, look at
15 the 'Installing Python Modules' distutils documentation, available from:
16
17 http://python.org/sigs/distutils-sig/doc/
18
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
19 Or, if all else fails, feel free to write to the biopython list at
20 biopython@biopython.org and ask for help.
21 """
f726249 merged Andrew's Seq package with the tree
jchang authored
22 import sys
96a6095 Upgrade setup.py for SubsMat
chapmanb authored
23 import os
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
24
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
25 # Make sure I have the right Python version.
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
26 if sys.version_info[:2] < (2, 3):
27 print "Biopython requires Python 2.3 or better. Python %d.%d detected" % \
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
28 sys.version_info[:2]
29 sys.exit(-1)
30
31 from distutils.core import setup
32 from distutils.core import Command
33 from distutils.command.install import install
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
34 from distutils.command.install_data import install_data
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
35 from distutils.command.build_py import build_py
a8ae40f now installs Martel and doesn't complain about it
jchang authored
36 from distutils.command.build_ext import build_ext
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
37 from distutils.extension import Extension
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
38 from distutils import sysconfig
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
39
40 def get_yes_or_no(question, default):
41 if default:
42 option_str = "(Y/n)"
43 default_str = 'y'
44 else:
45 option_str = "(y/N)"
46 default_str = 'n'
47
48 while 1:
49 print "%s %s " % (question, option_str),
50 response = raw_input().lower()
51 if not response:
52 response = default_str
53 if response[0] in ['y', 'n']:
54 break
55 print "Please answer y or n."
56 return response[0] == 'y'
57
a8ae40f now installs Martel and doesn't complain about it
jchang authored
58 _CHECKED = None
59 def check_dependencies_once():
60 # Call check_dependencies, but cache the result for subsequent
61 # calls.
62 global _CHECKED
63 if _CHECKED is None:
64 _CHECKED = check_dependencies()
65 return _CHECKED
66
67 def check_dependencies():
68 """Return whether the installation should continue."""
69 # There should be some way for the user to tell specify not to
70 # check dependencies. For example, it probably should not if
71 # the user specified "-q". However, I'm not sure where
72 # distutils stores that information. Also, install has a
73 # --force option that gets saved in self.user_options. It
74 # means overwrite previous installations. If the user has
75 # forced an installation, should we also ignore dependencies?
1003c5c @peterjc Make mxTextTools optional (like ReportLab and Numeric), so that Biopy…
peterjc authored
76
77 #This is a list of tuples, containing:
78 # - package name, string
79 # - is packaged installed, boolean
80 # - is packaged required, boolean
81 # - package website, string
a8ae40f now installs Martel and doesn't complain about it
jchang authored
82 dependencies = [
1003c5c @peterjc Make mxTextTools optional (like ReportLab and Numeric), so that Biopy…
peterjc authored
83 ("mxTextTools", is_mxTextTools_installed, 0,
31236fa Fixed bad link for mxTextTools kindly pointed out by Marc Colosimo
chapmanb authored
84 "http://www.egenix.com/files/python/eGenix-mx-Extensions.html"),
a8ae40f now installs Martel and doesn't complain about it
jchang authored
85 ("Numerical Python", is_Numpy_installed, 0,
86 "http://numpy.sourceforge.net/"),
87 ]
88
89 for name, is_installed_fn, is_required, url in dependencies:
90 if is_installed_fn():
91 continue
92
93 print "*** %s *** is either not installed or out of date." % name
94 if is_required:
95
96 print """
97 This package is required for many Biopython features. Please install
98 it before you install Biopython."""
99 default = 0
100 else:
101 print """
102 This package is optional, which means it is only used in a few
b6580cd Fixed spelling error "is you are unsure" ==> "if you are unsure"
mdehoon authored
103 specialized modules in Biopython. You probably don't need this if you
a8ae40f now installs Martel and doesn't complain about it
jchang authored
104 are unsure. You can ignore this requirement, and install it later if
105 you see ImportErrors."""
106 default = 1
107 print "You can find %s at %s." % (name, url)
108 print
5c9fef2 Modified setup.py to try and fix Martel/mxTextTools issues from bug 1…
chapmanb authored
109 # exit automatically if required packages not installed
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
110 if not(default):
111 sys.exit(-1)
a8ae40f now installs Martel and doesn't complain about it
jchang authored
112
113 if not get_yes_or_no(
114 "Do you want to continue this installation?", default):
115 return 0
5a0a5b6 Patch from K. Arun on the mailing list. Ask the user if KDTree (C++) …
mdehoon authored
116
117
118 # Compile KDTree ? Not compiled by default
119 print "\n*** Bio.KDTree *** NOT built by default "
120 kdtree_msg = """
121 The Bio.PDB.NeighborSearch module depends on the Bio.KDTree module,
122 which in turn, depends on C++ code that does not compile cleanly on
123 all platforms. Hence, Bio.KDTree is not built by default.
124
125 Would you like to build Bio.KDTree ?"""
126
127 if get_yes_or_no (kdtree_msg, 0):
128 NUMPY_PACKAGES.append("Bio.KDTree")
129 NUMPY_EXTENSIONS.append(
130 CplusplusExtension('Bio.KDTree._CKDTree',
131 ["Bio/KDTree/KDTree.cpp",
132 "Bio/KDTree/KDTree.swig.cpp"],
133 libraries=["stdc++"],
134 language="c++"))
135
136
a8ae40f now installs Martel and doesn't complain about it
jchang authored
137 return 1
138
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
139 class install_biopython(install):
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
140 """Override the standard install to check for dependencies.
141
142 This will just run the normal install, and then print warning messages
143 if packages are missing.
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
144
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
145 """
146 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
147 if check_dependencies_once():
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
148 # Run the normal install.
149 install.run(self)
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
150
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
151 class build_py_biopython(build_py):
152 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
153 if not check_dependencies_once():
154 return
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
155 # Check to see if Martel is installed. If not, then install
156 # it automatically.
157 if not is_Martel_installed():
158 self.packages.append("Martel")
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
159 # Add software that requires Numpy to be installed.
a8ae40f now installs Martel and doesn't complain about it
jchang authored
160 if is_Numpy_installed():
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
161 self.packages.extend(NUMPY_PACKAGES)
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
162 build_py.run(self)
fc90717 Whew, final thing to add! Added code for displaying pretty pictures u…
chapmanb authored
163
94b412a See bug #2375. Copy data files to the build directory, so the tests run
mdehoon authored
164 # In addition to installing the data files, we also need to make
165 # sure that they are copied to the build directory. Otherwise,
166 # the unit tests will fail because they cannot find the data files
167 # in the build directory.
168 # This is taken care of automatically in Python 2.4 or higher by
169 # using package_data.
170
171 import glob
172 data_files = self.distribution.data_files
173 for entry in data_files:
174 if type(entry) is not type(""):
175 raise ValueError, "data_files must be strings"
176 # Unix- to platform-convention conversion
177 entry = os.sep.join(entry.split("/"))
178 filenames = glob.glob(entry)
179 for filename in filenames:
180 dst = os.path.join(self.build_lib, filename)
181 dstdir = os.path.split(dst)[0]
182 self.mkpath(dstdir)
183 self.copy_file(filename, dst)
184
185
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
186 class CplusplusExtension(Extension):
187 """Hack-y wrapper around Extension to support C++ and Python2.2.
188
189 Python2.3 defines an extension attribute, which can be used in
190 'build_extension' to work around problems Python has with always
191 using the C++ compiler to compile C++ code.
ccd3b4d @peterjc Fixes a Martel install problem when mxTextTools is missing (bug 2511)
peterjc authored
192
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
193 This should be able to be removed once we move to requiring Python 2.3 or
194 better.
195 """
196 def __init__(self, *args, **kw):
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
197 # fix the language -- 2.2 doesn't have languages
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
198 if sys.version_info[1] < 3:
199 try:
200 self.language = kw['language']
201 del kw['language']
202 except KeyError:
203 pass
204 Extension.__init__(self, *args, **kw)
205
a8ae40f now installs Martel and doesn't complain about it
jchang authored
206 class build_ext_biopython(build_ext):
207 def run(self):
208 if not check_dependencies_once():
209 return
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
210 # add software that requires NumPy to install
a8ae40f now installs Martel and doesn't complain about it
jchang authored
211 if is_Numpy_installed():
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
212 self.extensions.extend(NUMPY_EXTENSIONS)
a8ae40f now installs Martel and doesn't complain about it
jchang authored
213 build_ext.run(self)
214
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
215 def build_extensions(self):
dac04da Fix to try and make things work on Microsoft Visual C++
chapmanb authored
216 # Unix C compiler plus others
217 if hasattr(self.compiler, "compiler_so"):
218 self._original_compiler_so = self.compiler.compiler_so
219 # MSVC -- others?
220 else:
221 self._original_compiler_so = self.compiler.cc
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
222
223 build_ext.build_extensions(self)
224
225 def build_extension(self, ext):
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
226 """Work around distutils bug which uses the C compiler for C++ code.
227 """
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right …
chapmanb authored
228 # build this extension by default
229 build = 1
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
230 if hasattr(ext, "language") and ext.language == "c++":
1a4e813 Mingw can now build C++ code for the Windows installer.
mdehoon authored
231 # C++ didn't build in the past with msvc
232 # mingw32 seems fine now
233 if self.compiler.compiler_type=="msvc":
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right …
chapmanb authored
234 build = 0
235 # fix for distutils where C++ is not handled well. This includes
236 # Python 2.2.x -- need to find the C++ compiler
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
237 cxx = None
c6c0628 Hopefully final fix to skip compilation of C++ for mingw32 and msvc
chapmanb authored
238 if (sys.version_info[1] < 3) and build: # Python 2.2
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
239 cxx = sysconfig.get_config_vars("CXX")
240 if os.environ.has_key("CXX"):
241 cxx = os.environ["CXX"]
242 # set the C++ compiler if it doesn't exist in distutils
243 if cxx:
244 self.compiler.set_executable("compiler", cxx)
245 self.compiler.set_executable("compiler_so", cxx)
23b62a9 A few more fixes for 2.2 versions -- now make sure to set the linker_…
chapmanb authored
246 self.compiler.set_executable("linker_so",
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
247 cxx + ["-shared"])
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
248 else:
249 self.compiler.compiler_so = self._original_compiler_so
250
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right …
chapmanb authored
251 # C++ extensions just plain won't build on some platforms
252 if build:
253 build_ext.build_extension(self, ext)
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
254
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
255 class test_biopython(Command):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
256 """Run all of the tests for the package.
257
258 This is a automatic test run class to make distutils kind of act like
259 perl. With this you can do:
260
261 python setup.py build
262 python setup.py install
263 python setup.py test
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
264
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
265 """
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
266 description = "Automatically run the test suite for Biopython."
1d16b65 The modification to setup.py gives the option of --no-gui for the com…
lasher authored
267
268 user_options = [
269 # provide the option to run tests in no-gui mode
270 ('no-gui', None, "Do not run in GUI mode")
271 ]
272
273 def initialize_options(self):
274 self.no_gui = None
275
276 def finalize_options(self):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
277 pass
1d16b65 The modification to setup.py gives the option of --no-gui for the com…
lasher authored
278
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
279 def run(self):
280 this_dir = os.getcwd()
281
282 # change to the test dir and run the tests
283 os.chdir("Tests")
b720e3d In Python 2.3.2, the current directory '' is not included in the path.
grouse authored
284 sys.path.insert(0, '')
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
285 import run_tests
1d16b65 The modification to setup.py gives the option of --no-gui for the com…
lasher authored
286 if self.no_gui:
287 run_tests.main(['--no-gui'])
288 else:
289 run_tests.main([])
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
290
291 # change back to the current directory
292 os.chdir(this_dir)
293
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
294 def can_import(module_name):
295 """can_import(module_name) -> module or None"""
296 try:
297 return __import__(module_name)
298 except ImportError:
299 return None
300 raise AssertionError, "how did I get here?"
301
302 def is_Martel_installed():
303 old_path = sys.path[:]
304
305 # First, check the version of the Martel that's bundled with
306 # Biopython.
307 sys.path.insert(0, '') # Make sure I'm importing the current one.
308 m = can_import("Martel")
309 sys.path = old_path
310 if m:
311 bundled_martel_version = m.__version__
ccd3b4d @peterjc Fixes a Martel install problem when mxTextTools is missing (bug 2511)
peterjc authored
312 del sys.modules["Martel"] # Unload the bundled version of Martel.
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
313 else:
ccd3b4d @peterjc Fixes a Martel install problem when mxTextTools is missing (bug 2511)
peterjc authored
314 #We won't be able to import the bundled version of Martel if an
315 #external dependency like mxTextTools is missing.
316 #In this case, we can't compare versions to any pre-installed Martel
317 #(even if that could be imported).
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
318 bundled_martel_version = None
319
320 # Now try and import a Martel that's not bundled with Biopython.
321 # To do that, I need to delete all the references to the current
322 # path from sys.path.
323 i = 0
324 while i < len(sys.path):
7adf843 Added fix to Martel check code which keeps is_Martel_Installed from r…
chapmanb authored
325 if sys.path[i] in ['', '.', os.getcwd()]:
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
326 del sys.path[i]
327 else:
328 i += 1
329 m = can_import("Martel")
330 sys.path = old_path
331 if m:
332 old_martel_version = m.__version__
333 else:
ccd3b4d @peterjc Fixes a Martel install problem when mxTextTools is missing (bug 2511)
peterjc authored
334 #Either there is no pre-installed copy of Martel, or if there is
335 #it cannot be imported (e.g. missing a dependency like mxTextTools).
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
336 old_martel_version = None
337
338 installed = 0
ff3d016 Install Martel if the Biopython version is the same or newer -- preve…
chapmanb authored
339 # If the bundled one is the older, then ignore it
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
340 if old_martel_version and bundled_martel_version and \
ff3d016 Install Martel if the Biopython version is the same or newer -- preve…
chapmanb authored
341 bundled_martel_version < old_martel_version:
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
342 installed = 1
343 return installed
344
345 def is_mxTextTools_installed():
346 if can_import("TextTools"):
347 return 1
348 return can_import("mx.TextTools")
349
350 def is_Numpy_installed():
351 return can_import("Numeric")
352
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
353 # --- set up the packages we are going to install
354 # standard biopython packages
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
355 PACKAGES = [
356 'Bio',
357 'Bio.Ais',
358 'Bio.Align',
1231257 @peterjc Include Bio.AlignIO in installation
peterjc authored
359 'Bio.AlignIO',
193e993 initial checking of Bartek Wilczynski's AlignAce module
jchang authored
360 'Bio.AlignAce',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
361 'Bio.Alphabet',
362 'Bio.Application',
363 'Bio.Blast',
364 'Bio.builders',
365 'Bio.builders.Search',
366 'Bio.builders.SeqRecord',
0cd0e9c Modified Files:
idoerg authored
367 'Bio.CAPS',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
368 'Bio.CDD',
76ce5ca Added Compass parsing code contributed by James Casbon.
chapmanb authored
369 'Bio.Compass',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
370 'Bio.Clustalw',
371 'Bio.config',
372 'Bio.Crystal',
373 'Bio.Data',
374 'Bio.dbdefs',
375 'Bio.ECell',
376 'Bio.Emboss',
377 'Bio.Encodings',
8521e25 Moving Bio/Entrez.py to Bio/Entrez/__init__.py.
mdehoon authored
378 'Bio.Entrez',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
379 'Bio.Enzyme',
380 'Bio.expressions',
381 'Bio.expressions.blast',
382 'Bio.expressions.embl',
383 'Bio.expressions.swissprot',
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
384 'Bio.EUtils',
385 'Bio.EUtils.DTDs',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
386 'Bio.Fasta',
387 'Bio.formatdefs',
388 'Bio.FSSP',
389 'Bio.GA',
390 'Bio.GA.Crossover',
391 'Bio.GA.Mutation',
392 'Bio.GA.Repair',
393 'Bio.GA.Selection',
394 'Bio.GenBank',
395 'Bio.Geo',
396 'Bio.GFF',
397 'Bio.Gobase',
398 'Bio.Graphics',
399 'Bio.HMM',
400 'Bio.IntelliGenetics',
401 'Bio.InterPro',
402 'Bio.KEGG',
403 'Bio.KEGG.Compound',
404 'Bio.KEGG.Enzyme',
405 'Bio.KEGG.Map',
1c9b14b Added LocusLink back in to the install since tests pass
chapmanb authored
406 'Bio.LocusLink',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
407 'Bio.Medline',
08d88f3 Add Bio.MEME to the packages to be installed.
mdehoon authored
408 'Bio.MEME',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
409 'Bio.MetaTool',
410 'Bio.Mindy',
411 'Bio.MultiProc',
412 'Bio.NBRF',
413 'Bio.Ndb',
414 'Bio.NeuralNetwork',
415 'Bio.NeuralNetwork.BackPropagation',
416 'Bio.NeuralNetwork.Gene',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
417 'Bio.Nexus',
7bcfbce Adding NMR files kindly contributed by Bob Bussell
chapmanb authored
418 'Bio.NMR',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
419 'Bio.Parsers',
420 'Bio.Pathway',
421 'Bio.Pathway.Rep',
422 'Bio.PDB',
983daba Add Bio.PDB.mmCIF (but not MMFIFlex) as a module to make sure that
mdehoon authored
423 'Bio.PDB.mmCIF',
4f07b8a Added Bio.PopGen module by Tiago Antao.
mdehoon authored
424 'Bio.PopGen',
425 'Bio.PopGen.Async',
426 'Bio.PopGen.FDist',
427 'Bio.PopGen.GenePop',
96f01d5 2375: Activating SimCoal on Biopython setup
tiagoantao authored
428 'Bio.PopGen.SimCoal',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
429 'Bio.Prosite',
430 'Bio.Rebase',
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This i…
chapmanb authored
431 'Bio.Restriction',
432 'Bio.Restriction._Update',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
433 'Bio.Saf',
434 'Bio.SCOP',
435 'Bio.SeqIO',
436 'Bio.SeqUtils',
2214cae Added Sequencing directory to packages
chapmanb authored
437 'Bio.Sequencing',
7738632 Added Bio.Statistics.
mdehoon authored
438 'Bio.Statistics',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
439 'Bio.SubsMat',
440 'Bio.SVDSuperimposer',
441 'Bio.SwissProt',
442 'Bio.UniGene',
443 'Bio.writers',
444 'Bio.writers.SeqRecord',
3a5d550 Adding Bio.Wise to the distribution
grouse authored
445 'Bio.Wise',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
446 'Bio.WWW',
447 ]
448
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
449 # packages that require Numeric Python
450 NUMPY_PACKAGES = [
451 'Bio.Affy',
452 'Bio.Cluster',
453 ]
454
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
455 EXTENSIONS = [
456 Extension('Bio.clistfns',
457 ['Bio/clistfnsmodule.c']
458 ),
459 Extension('Bio.cmathfns',
460 ['Bio/cmathfnsmodule.c',
461 'Bio/csupport.c'],
462 include_dirs=["Bio"]
463 ),
464 Extension('Bio.cstringfns',
465 ['Bio/cstringfnsmodule.c']
466 ),
467 Extension('Bio.cdistance',
468 ['Bio/cdistancemodule.c',
469 'Bio/csupport.c'],
470 include_dirs=["Bio"]
471 ),
472 Extension('Bio.cpairwise2',
473 ['Bio/cpairwise2module.c',
474 'Bio/csupport.c'],
475 include_dirs=["Bio"]
476 ),
477 Extension('Bio.trie',
478 ['Bio/triemodule.c',
479 'Bio/trie.c'],
480 include_dirs=["Bio"]
481 ),
482 Extension('Bio.cMarkovModel',
483 ['Bio/cMarkovModelmodule.c',
484 'Bio/csupport.c'],
485 include_dirs=["Bio"]
486 ),
969dae8 Uncommented mmCIF module because of problems if GNU's Flex is missing
nisse authored
487 # Extension('Bio.PDB.mmCIF.MMCIFlex',
488 # ['Bio/PDB/mmCIF/lex.yy.c',
489 # 'Bio/PDB/mmCIF/MMCIFlexmodule.c'],
490 # include_dirs=["Bio"],
491 # libraries=["fl"]
492 # ),
2800c6c *** empty log message ***
idoerg authored
493 Extension('Bio.Nexus.cnexus',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
494 ['Bio/Nexus/cnexus.c']
495 ),
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This i…
chapmanb authored
496 Extension('Bio.Restriction.DNAUtils',
497 ['Bio/Restriction/DNAUtils.c']
498 ),
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
499 ]
500
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
501 # extensions that require numeric python
502 NUMPY_EXTENSIONS = [
503 Extension('Bio.Cluster.cluster',
504 ['Bio/Cluster/clustermodule.c',
2ae6620 Bio.Cluster no longer uses ranlib.
mdehoon authored
505 'Bio/Cluster/cluster.c'],
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
506 include_dirs=["Bio/Cluster"]
507 ),
c686839 The CEL file parser in Bio/Affy/celmodule.cc was replaced by a scanne…
mdehoon authored
508 # CplusplusExtension('Bio.Affy._cel', # The file parser in celmodule.cc was
509 # ['Bio/Affy/celmodule.cc'], # replaced by a scanner/consumer in
510 # language="c++" # CelFile.py, using Biopython's
511 # ), # parser framework
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
512 ]
513
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
514 DATA_FILES=[
eb7dfb6 Reverting previous change, as this is still needed for Python 2.3.
mdehoon authored
515 "Bio/Entrez/DTDs/*.dtd",
516 "Bio/EUtils/DTDs/*.dtd",
517 "Bio/PopGen/SimCoal/data/*.par"
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
518 ]
519
eb7dfb6 Reverting previous change, as this is still needed for Python 2.3.
mdehoon authored
520 # EUtils contains dtd files that need to be installed in the same
521 # directory as the python modules. Distutils doesn't have a simple
522 # way of handling this, and we need to subclass install_data. This
523 # code is adapted from the mx.TextTools distribution.
524
94b412a See bug #2375. Copy data files to the build directory, so the tests run
mdehoon authored
525 # We can use package_data instead once we require Python 2.4 or higher.
eb7dfb6 Reverting previous change, as this is still needed for Python 2.3.
mdehoon authored
526
527 class install_data_biopython(install_data):
528 def finalize_options(self):
529 if self.install_dir is None:
530 installobj = self.distribution.get_command_obj('install')
531 self.install_dir = installobj.install_platlib
532 install_data.finalize_options(self)
533
534 def run (self):
535 import glob
536 if not self.dry_run:
537 self.mkpath(self.install_dir)
538 data_files = self.get_inputs()
539 for entry in data_files:
540 if type(entry) is not type(""):
541 raise ValueError, "data_files must be strings"
542 # Unix- to platform-convention conversion
543 entry = os.sep.join(entry.split("/"))
544 filenames = glob.glob(entry)
545 for filename in filenames:
546 dst = os.path.join(self.install_dir, filename)
547 dstdir = os.path.split(dst)[0]
548 if not self.dry_run:
549 self.mkpath(dstdir)
550 outfile = self.copy_file(filename, dst)[0]
551 else:
552 outfile = dst
553 self.outfiles.append(outfile)
554
555
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
556 # Install BioSQL.
557 PACKAGES.append("BioSQL")
558
559 setup(
560 name='biopython',
a9a0bd2 Use package_data to install package data.
mdehoon authored
561 version='1.45',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
562 author='The Biopython Consortium',
563 author_email='biopython@biopython.org',
564 url='http://www.biopython.org/',
565 cmdclass={
566 "install" : install_biopython,
567 "build_py" : build_py_biopython,
a8ae40f now installs Martel and doesn't complain about it
jchang authored
568 "build_ext" : build_ext_biopython,
eb7dfb6 Reverting previous change, as this is still needed for Python 2.3.
mdehoon authored
569 "install_data" : install_data_biopython,
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
570 "test" : test_biopython,
571 },
572 packages=PACKAGES,
573 ext_modules=EXTENSIONS,
eb7dfb6 Reverting previous change, as this is still needed for Python 2.3.
mdehoon authored
574 data_files=DATA_FILES,
94b412a See bug #2375. Copy data files to the build directory, so the tests run
mdehoon authored
575 # package_data = {'Bio.Entrez': ['DTDs/*.dtd']}
576 ## Use this once we require Python version >= 2.4.
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
577 )
Something went wrong with that request. Please try again.