Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 546 lines (481 sloc) 16.628 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 install ...
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 sho...
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 Peter Cock Make mxTextTools optional (like ReportLab and Numeric), so that Biopytho...
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 Peter Cock Make mxTextTools optional (like ReportLab and Numeric), so that Biopytho...
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 1409...
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++) sho...
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 install ...
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 install ...
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 install ...
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 usin...
chapmanb authored
163
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it sho...
chapmanb authored
164 class CplusplusExtension(Extension):
165 """Hack-y wrapper around Extension to support C++ and Python2.2.
166
167 Python2.3 defines an extension attribute, which can be used in
168 'build_extension' to work around problems Python has with always
169 using the C++ compiler to compile C++ code.
170
171 This should be able to be removed once we move to requiring Python 2.3 or
172 better.
173 """
174 def __init__(self, *args, **kw):
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
175 # fix the language -- 2.2 doesn't have languages
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it sho...
chapmanb authored
176 if sys.version_info[1] < 3:
177 try:
178 self.language = kw['language']
179 del kw['language']
180 except KeyError:
181 pass
182 Extension.__init__(self, *args, **kw)
183
a8ae40f now installs Martel and doesn't complain about it
jchang authored
184 class build_ext_biopython(build_ext):
185 def run(self):
186 if not check_dependencies_once():
187 return
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it sho...
chapmanb authored
188 # add software that requires NumPy to install
a8ae40f now installs Martel and doesn't complain about it
jchang authored
189 if is_Numpy_installed():
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
190 self.extensions.extend(NUMPY_EXTENSIONS)
a8ae40f now installs Martel and doesn't complain about it
jchang authored
191 build_ext.run(self)
192
a151e5c workaround for bug in distutils that prevents one from compiling both C ...
grouse authored
193 def build_extensions(self):
dac04da Fix to try and make things work on Microsoft Visual C++
chapmanb authored
194 # Unix C compiler plus others
195 if hasattr(self.compiler, "compiler_so"):
196 self._original_compiler_so = self.compiler.compiler_so
197 # MSVC -- others?
198 else:
199 self._original_compiler_so = self.compiler.cc
a151e5c workaround for bug in distutils that prevents one from compiling both C ...
grouse authored
200
201 build_ext.build_extensions(self)
202
203 def build_extension(self, ext):
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it sho...
chapmanb authored
204 """Work around distutils bug which uses the C compiler for C++ code.
205 """
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right now...
chapmanb authored
206 # build this extension by default
207 build = 1
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it sho...
chapmanb authored
208 if hasattr(ext, "language") and ext.language == "c++":
1a4e813 Mingw can now build C++ code for the Windows installer.
mdehoon authored
209 # C++ didn't build in the past with msvc
210 # mingw32 seems fine now
211 if self.compiler.compiler_type=="msvc":
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right now...
chapmanb authored
212 build = 0
213 # fix for distutils where C++ is not handled well. This includes
214 # 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
215 cxx = None
c6c0628 Hopefully final fix to skip compilation of C++ for mingw32 and msvc
chapmanb authored
216 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
217 cxx = sysconfig.get_config_vars("CXX")
218 if os.environ.has_key("CXX"):
219 cxx = os.environ["CXX"]
220 # set the C++ compiler if it doesn't exist in distutils
221 if cxx:
222 self.compiler.set_executable("compiler", cxx)
223 self.compiler.set_executable("compiler_so", cxx)
23b62a9 A few more fixes for 2.2 versions -- now make sure to set the linker_so ...
chapmanb authored
224 self.compiler.set_executable("linker_so",
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
225 cxx + ["-shared"])
a151e5c workaround for bug in distutils that prevents one from compiling both C ...
grouse authored
226 else:
227 self.compiler.compiler_so = self._original_compiler_so
228
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right now...
chapmanb authored
229 # C++ extensions just plain won't build on some platforms
230 if build:
231 build_ext.build_extension(self, ext)
a151e5c workaround for bug in distutils that prevents one from compiling both C ...
grouse authored
232
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
233 class test_biopython(Command):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
234 """Run all of the tests for the package.
235
236 This is a automatic test run class to make distutils kind of act like
237 perl. With this you can do:
238
239 python setup.py build
240 python setup.py install
241 python setup.py test
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
242
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
243 """
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
244 description = "Automatically run the test suite for Biopython."
1d16b65 The modification to setup.py gives the option of --no-gui for the comman...
lasher authored
245
246 user_options = [
247 # provide the option to run tests in no-gui mode
248 ('no-gui', None, "Do not run in GUI mode")
249 ]
250
251 def initialize_options(self):
252 self.no_gui = None
253
254 def finalize_options(self):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
255 pass
1d16b65 The modification to setup.py gives the option of --no-gui for the comman...
lasher authored
256
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
257 def run(self):
258 this_dir = os.getcwd()
259
260 # change to the test dir and run the tests
261 os.chdir("Tests")
b720e3d In Python 2.3.2, the current directory '' is not included in the path.
grouse authored
262 sys.path.insert(0, '')
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
263 import run_tests
1d16b65 The modification to setup.py gives the option of --no-gui for the comman...
lasher authored
264 if self.no_gui:
265 run_tests.main(['--no-gui'])
266 else:
267 run_tests.main([])
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
268
269 # change back to the current directory
270 os.chdir(this_dir)
271
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
272 def can_import(module_name):
273 """can_import(module_name) -> module or None"""
274 try:
275 return __import__(module_name)
276 except ImportError:
277 return None
278 raise AssertionError, "how did I get here?"
279
280 def is_Martel_installed():
281 old_path = sys.path[:]
282
283 # First, check the version of the Martel that's bundled with
284 # Biopython.
285 sys.path.insert(0, '') # Make sure I'm importing the current one.
286 m = can_import("Martel")
287 sys.path = old_path
288 if m:
289 bundled_martel_version = m.__version__
290 else:
291 bundled_martel_version = None
292 del sys.modules["Martel"] # Delete the old version of Martel.
293
294 # Now try and import a Martel that's not bundled with Biopython.
295 # To do that, I need to delete all the references to the current
296 # path from sys.path.
297 i = 0
298 while i < len(sys.path):
7adf843 Added fix to Martel check code which keeps is_Martel_Installed from read...
chapmanb authored
299 if sys.path[i] in ['', '.', os.getcwd()]:
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
300 del sys.path[i]
301 else:
302 i += 1
303 m = can_import("Martel")
304 sys.path = old_path
305 if m:
306 old_martel_version = m.__version__
307 else:
308 old_martel_version = None
309
310 installed = 0
ff3d016 Install Martel if the Biopython version is the same or newer -- prevent ...
chapmanb authored
311 # 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
312 if old_martel_version and bundled_martel_version and \
ff3d016 Install Martel if the Biopython version is the same or newer -- prevent ...
chapmanb authored
313 bundled_martel_version < old_martel_version:
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
314 installed = 1
315 return installed
316
317 def is_mxTextTools_installed():
318 if can_import("TextTools"):
319 return 1
320 return can_import("mx.TextTools")
321
322 def is_Numpy_installed():
323 return can_import("Numeric")
324
7db13b0 Updated to check for dependencies and print out warnings and to install ...
chapmanb authored
325 # --- set up the packages we are going to install
326 # standard biopython packages
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
327 PACKAGES = [
328 'Bio',
329 'Bio.Ais',
330 'Bio.Align',
1231257 Peter Cock Include Bio.AlignIO in installation
peterjc authored
331 'Bio.AlignIO',
193e993 initial checking of Bartek Wilczynski's AlignAce module
jchang authored
332 'Bio.AlignAce',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
333 'Bio.Alphabet',
334 'Bio.Application',
335 'Bio.Blast',
336 'Bio.builders',
337 'Bio.builders.Search',
338 'Bio.builders.SeqRecord',
0cd0e9c Modified Files:
idoerg authored
339 'Bio.CAPS',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
340 'Bio.CDD',
76ce5ca Added Compass parsing code contributed by James Casbon.
chapmanb authored
341 'Bio.Compass',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
342 'Bio.Clustalw',
343 'Bio.config',
344 'Bio.Crystal',
345 'Bio.Data',
346 'Bio.dbdefs',
347 'Bio.ECell',
348 'Bio.Emboss',
349 'Bio.Encodings',
8521e25 Moving Bio/Entrez.py to Bio/Entrez/__init__.py.
mdehoon authored
350 'Bio.Entrez',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
351 'Bio.Enzyme',
352 'Bio.expressions',
353 'Bio.expressions.blast',
354 'Bio.expressions.embl',
355 'Bio.expressions.swissprot',
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
356 'Bio.EUtils',
357 'Bio.EUtils.DTDs',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
358 'Bio.Fasta',
359 'Bio.formatdefs',
360 'Bio.FSSP',
361 'Bio.GA',
362 'Bio.GA.Crossover',
363 'Bio.GA.Mutation',
364 'Bio.GA.Repair',
365 'Bio.GA.Selection',
366 'Bio.GenBank',
367 'Bio.Geo',
368 'Bio.GFF',
369 'Bio.Gobase',
370 'Bio.Graphics',
371 'Bio.HMM',
372 'Bio.IntelliGenetics',
373 'Bio.InterPro',
374 'Bio.KEGG',
375 'Bio.KEGG.Compound',
376 'Bio.KEGG.Enzyme',
377 'Bio.KEGG.Map',
1c9b14b Added LocusLink back in to the install since tests pass
chapmanb authored
378 'Bio.LocusLink',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
379 'Bio.Medline',
08d88f3 Add Bio.MEME to the packages to be installed.
mdehoon authored
380 'Bio.MEME',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
381 'Bio.MetaTool',
382 'Bio.Mindy',
383 'Bio.MultiProc',
384 'Bio.NBRF',
385 'Bio.Ndb',
386 'Bio.NeuralNetwork',
387 'Bio.NeuralNetwork.BackPropagation',
388 'Bio.NeuralNetwork.Gene',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
389 'Bio.Nexus',
7bcfbce Adding NMR files kindly contributed by Bob Bussell
chapmanb authored
390 'Bio.NMR',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
391 'Bio.Parsers',
392 'Bio.Pathway',
393 'Bio.Pathway.Rep',
394 'Bio.PDB',
983daba Add Bio.PDB.mmCIF (but not MMFIFlex) as a module to make sure that
mdehoon authored
395 'Bio.PDB.mmCIF',
4f07b8a Added Bio.PopGen module by Tiago Antao.
mdehoon authored
396 'Bio.PopGen',
397 'Bio.PopGen.Async',
398 'Bio.PopGen.FDist',
399 'Bio.PopGen.GenePop',
96f01d5 2375: Activating SimCoal on Biopython setup
tiagoantao authored
400 'Bio.PopGen.SimCoal',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
401 'Bio.Prosite',
402 'Bio.Rebase',
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This incl...
chapmanb authored
403 'Bio.Restriction',
404 'Bio.Restriction._Update',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
405 'Bio.Saf',
406 'Bio.SCOP',
407 'Bio.SeqIO',
408 'Bio.SeqUtils',
2214cae Added Sequencing directory to packages
chapmanb authored
409 'Bio.Sequencing',
7738632 Added Bio.Statistics.
mdehoon authored
410 'Bio.Statistics',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
411 'Bio.SubsMat',
412 'Bio.SVDSuperimposer',
413 'Bio.SwissProt',
414 'Bio.UniGene',
415 'Bio.writers',
416 'Bio.writers.SeqRecord',
3a5d550 Adding Bio.Wise to the distribution
grouse authored
417 'Bio.Wise',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
418 'Bio.WWW',
419 ]
420
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
421 # packages that require Numeric Python
422 NUMPY_PACKAGES = [
423 'Bio.Affy',
424 'Bio.Cluster',
425 ]
426
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
427 EXTENSIONS = [
428 Extension('Bio.clistfns',
429 ['Bio/clistfnsmodule.c']
430 ),
431 Extension('Bio.cmathfns',
432 ['Bio/cmathfnsmodule.c',
433 'Bio/csupport.c'],
434 include_dirs=["Bio"]
435 ),
436 Extension('Bio.cstringfns',
437 ['Bio/cstringfnsmodule.c']
438 ),
439 Extension('Bio.cdistance',
440 ['Bio/cdistancemodule.c',
441 'Bio/csupport.c'],
442 include_dirs=["Bio"]
443 ),
444 Extension('Bio.cpairwise2',
445 ['Bio/cpairwise2module.c',
446 'Bio/csupport.c'],
447 include_dirs=["Bio"]
448 ),
449 Extension('Bio.trie',
450 ['Bio/triemodule.c',
451 'Bio/trie.c'],
452 include_dirs=["Bio"]
453 ),
454 Extension('Bio.cMarkovModel',
455 ['Bio/cMarkovModelmodule.c',
456 'Bio/csupport.c'],
457 include_dirs=["Bio"]
458 ),
969dae8 Uncommented mmCIF module because of problems if GNU's Flex is missing
nisse authored
459 # Extension('Bio.PDB.mmCIF.MMCIFlex',
460 # ['Bio/PDB/mmCIF/lex.yy.c',
461 # 'Bio/PDB/mmCIF/MMCIFlexmodule.c'],
462 # include_dirs=["Bio"],
463 # libraries=["fl"]
464 # ),
2800c6c *** empty log message ***
idoerg authored
465 Extension('Bio.Nexus.cnexus',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
466 ['Bio/Nexus/cnexus.c']
467 ),
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This incl...
chapmanb authored
468 Extension('Bio.Restriction.DNAUtils',
469 ['Bio/Restriction/DNAUtils.c']
470 ),
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
471 ]
472
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
473 # extensions that require numeric python
474 NUMPY_EXTENSIONS = [
475 Extension('Bio.Cluster.cluster',
476 ['Bio/Cluster/clustermodule.c',
2ae6620 Bio.Cluster no longer uses ranlib.
mdehoon authored
477 'Bio/Cluster/cluster.c'],
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
478 include_dirs=["Bio/Cluster"]
479 ),
c686839 The CEL file parser in Bio/Affy/celmodule.cc was replaced by a scanner/c...
mdehoon authored
480 # CplusplusExtension('Bio.Affy._cel', # The file parser in celmodule.cc was
481 # ['Bio/Affy/celmodule.cc'], # replaced by a scanner/consumer in
482 # language="c++" # CelFile.py, using Biopython's
483 # ), # parser framework
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
484 ]
485
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
486 DATA_FILES=[
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
487 "Bio/EUtils/DTDs/*.dtd",
96f01d5 2375: Activating SimCoal on Biopython setup
tiagoantao authored
488 "Bio/PopGen/SimCoal/data/*par"
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
489 ]
490
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
491 # EUtils contains dtd files that need to be installed in the same
492 # directory as the python modules. Distutils doesn't have a simple
493 # way of handling this, and we need to subclass install_data. This
494 # code is adapted from the mx.TextTools distribution.
495
496 class install_data_biopython(install_data):
497 def finalize_options(self):
498 if self.install_dir is None:
499 installobj = self.distribution.get_command_obj('install')
500 self.install_dir = installobj.install_platlib
501 install_data.finalize_options(self)
502
503 def run (self):
504 import glob
505 if not self.dry_run:
506 self.mkpath(self.install_dir)
507 data_files = self.get_inputs()
508 for entry in data_files:
509 if type(entry) is not type(""):
510 raise ValueError, "data_files must be strings"
511 # Unix- to platform-convention conversion
512 entry = os.sep.join(entry.split("/"))
513 filenames = glob.glob(entry)
514 for filename in filenames:
515 dst = os.path.join(self.install_dir, filename)
516 dstdir = os.path.split(dst)[0]
517 if not self.dry_run:
518 self.mkpath(dstdir)
519 outfile = self.copy_file(filename, dst)[0]
520 else:
521 outfile = dst
522 self.outfiles.append(outfile)
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
523
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
524
525 # Install BioSQL.
526 PACKAGES.append("BioSQL")
527
528 setup(
529 name='biopython',
d56188a Check for ReportLab only when it actually used. No need to check it at
mdehoon authored
530 version='1.45a',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
531 author='The Biopython Consortium',
532 author_email='biopython@biopython.org',
533 url='http://www.biopython.org/',
534 cmdclass={
535 "install" : install_biopython,
536 "build_py" : build_py_biopython,
a8ae40f now installs Martel and doesn't complain about it
jchang authored
537 "build_ext" : build_ext_biopython,
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
538 "install_data" : install_data_biopython,
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
539 "test" : test_biopython,
540 },
541 packages=PACKAGES,
542 ext_modules=EXTENSIONS,
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
543 data_files=DATA_FILES,
e35e4f9 Intermediate update (unfinished).
mdehoon authored
544 package_data = {'Bio.Entrez': ['DTDs/*.dtd']}
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
545 )
Something went wrong with that request. Please try again.