Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 525 lines (470 sloc) 16.284 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?
76 dependencies = [
77 ("mxTextTools", is_mxTextTools_installed, 1,
31236fa Fixed bad link for mxTextTools kindly pointed out by Marc Colosimo
chapmanb authored
78 "http://www.egenix.com/files/python/eGenix-mx-Extensions.html"),
a8ae40f now installs Martel and doesn't complain about it
jchang authored
79 ("Numerical Python", is_Numpy_installed, 0,
80 "http://numpy.sourceforge.net/"),
81 ("Reportlab", is_reportlab_installed, 0,
b6580cd Fixed spelling error "is you are unsure" ==> "if you are unsure"
mdehoon authored
82 "http://www.reportlab.org/downloads.html"),
a8ae40f now installs Martel and doesn't complain about it
jchang authored
83 ]
84
85 for name, is_installed_fn, is_required, url in dependencies:
86 if is_installed_fn():
87 continue
88
89 print "*** %s *** is either not installed or out of date." % name
90 if is_required:
91
92 print """
93 This package is required for many Biopython features. Please install
94 it before you install Biopython."""
95 default = 0
96 else:
97 print """
98 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
99 specialized modules in Biopython. You probably don't need this if you
a8ae40f now installs Martel and doesn't complain about it
jchang authored
100 are unsure. You can ignore this requirement, and install it later if
101 you see ImportErrors."""
102 default = 1
103 print "You can find %s at %s." % (name, url)
104 print
5c9fef2 Modified setup.py to try and fix Martel/mxTextTools issues from bug 1…
chapmanb authored
105 # exit automatically if required packages not installed
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
106 if not(default):
107 sys.exit(-1)
a8ae40f now installs Martel and doesn't complain about it
jchang authored
108
109 if not get_yes_or_no(
110 "Do you want to continue this installation?", default):
111 return 0
112 return 1
113
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
114 class install_biopython(install):
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
115 """Override the standard install to check for dependencies.
116
117 This will just run the normal install, and then print warning messages
118 if packages are missing.
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
119
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
120 """
121 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
122 if check_dependencies_once():
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
123 # Run the normal install.
124 install.run(self)
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
125
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
126 class build_py_biopython(build_py):
127 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
128 if not check_dependencies_once():
129 return
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
130 # Check to see if Martel is installed. If not, then install
131 # it automatically.
132 if not is_Martel_installed():
133 self.packages.append("Martel")
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
134 # Add software that requires Numpy to be installed.
a8ae40f now installs Martel and doesn't complain about it
jchang authored
135 if is_Numpy_installed():
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
136 self.packages.extend(NUMPY_PACKAGES)
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
137 build_py.run(self)
fc90717 Whew, final thing to add! Added code for displaying pretty pictures u…
chapmanb authored
138
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
139 class CplusplusExtension(Extension):
140 """Hack-y wrapper around Extension to support C++ and Python2.2.
141
142 Python2.3 defines an extension attribute, which can be used in
143 'build_extension' to work around problems Python has with always
144 using the C++ compiler to compile C++ code.
145
146 This should be able to be removed once we move to requiring Python 2.3 or
147 better.
148 """
149 def __init__(self, *args, **kw):
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
150 # 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
151 if sys.version_info[1] < 3:
152 try:
153 self.language = kw['language']
154 del kw['language']
155 except KeyError:
156 pass
157 Extension.__init__(self, *args, **kw)
158
a8ae40f now installs Martel and doesn't complain about it
jchang authored
159 class build_ext_biopython(build_ext):
160 def run(self):
161 if not check_dependencies_once():
162 return
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
163 # add software that requires NumPy to install
a8ae40f now installs Martel and doesn't complain about it
jchang authored
164 if is_Numpy_installed():
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
165 self.extensions.extend(NUMPY_EXTENSIONS)
a8ae40f now installs Martel and doesn't complain about it
jchang authored
166 build_ext.run(self)
167
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
168 def build_extensions(self):
dac04da Fix to try and make things work on Microsoft Visual C++
chapmanb authored
169 # Unix C compiler plus others
170 if hasattr(self.compiler, "compiler_so"):
171 self._original_compiler_so = self.compiler.compiler_so
172 # MSVC -- others?
173 else:
174 self._original_compiler_so = self.compiler.cc
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
175
176 build_ext.build_extensions(self)
177
178 def build_extension(self, ext):
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
179 """Work around distutils bug which uses the C compiler for C++ code.
180 """
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right …
chapmanb authored
181 # build this extension by default
182 build = 1
a573247 Even more kludgy fix for c++ compiling with setup.py -- this time it …
chapmanb authored
183 if hasattr(ext, "language") and ext.language == "c++":
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right …
chapmanb authored
184 # places where C++ just won't build right now:
dac04da Fix to try and make things work on Microsoft Visual C++
chapmanb authored
185 # mingw32, msvc -- windows just needs work in general
186 if self.compiler.compiler_type in ["mingw32", "msvc"]:
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right …
chapmanb authored
187 build = 0
188 # fix for distutils where C++ is not handled well. This includes
189 # 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
190 cxx = None
c6c0628 Hopefully final fix to skip compilation of C++ for mingw32 and msvc
chapmanb authored
191 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
192 cxx = sysconfig.get_config_vars("CXX")
193 if os.environ.has_key("CXX"):
194 cxx = os.environ["CXX"]
195 # set the C++ compiler if it doesn't exist in distutils
196 if cxx:
197 self.compiler.set_executable("compiler", cxx)
198 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
199 self.compiler.set_executable("linker_so",
930f619 Update setup.py to try and fix mingw32 compile problem. Fix typo in Affy
chapmanb authored
200 cxx + ["-shared"])
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
201 else:
202 self.compiler.compiler_so = self._original_compiler_so
203
f4f6cd3 Turn off C++ compilation on mingw32 where it just doesn't work right …
chapmanb authored
204 # C++ extensions just plain won't build on some platforms
205 if build:
206 build_ext.build_extension(self, ext)
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
207
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
208 class test_biopython(Command):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
209 """Run all of the tests for the package.
210
211 This is a automatic test run class to make distutils kind of act like
212 perl. With this you can do:
213
214 python setup.py build
215 python setup.py install
216 python setup.py test
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
217
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
218 """
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
219 description = "Automatically run the test suite for Biopython."
220 user_options = [] # distutils complains if this is not here.
221 def initialize_options(self): # distutils wants this
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
222 pass
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
223 def finalize_options(self): # this too
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
224 pass
225 def run(self):
226 this_dir = os.getcwd()
227
228 # change to the test dir and run the tests
229 os.chdir("Tests")
b720e3d In Python 2.3.2, the current directory '' is not included in the path.
grouse authored
230 sys.path.insert(0, '')
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
231 import run_tests
232 run_tests.main([])
233
234 # change back to the current directory
235 os.chdir(this_dir)
236
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
237 def can_import(module_name):
238 """can_import(module_name) -> module or None"""
239 try:
240 return __import__(module_name)
241 except ImportError:
242 return None
243 raise AssertionError, "how did I get here?"
244
245 def is_Martel_installed():
246 old_path = sys.path[:]
247
248 # First, check the version of the Martel that's bundled with
249 # Biopython.
250 sys.path.insert(0, '') # Make sure I'm importing the current one.
251 m = can_import("Martel")
252 sys.path = old_path
253 if m:
254 bundled_martel_version = m.__version__
255 else:
256 bundled_martel_version = None
257 del sys.modules["Martel"] # Delete the old version of Martel.
258
259 # Now try and import a Martel that's not bundled with Biopython.
260 # To do that, I need to delete all the references to the current
261 # path from sys.path.
262 i = 0
263 while i < len(sys.path):
7adf843 Added fix to Martel check code which keeps is_Martel_Installed from r…
chapmanb authored
264 if sys.path[i] in ['', '.', os.getcwd()]:
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
265 del sys.path[i]
266 else:
267 i += 1
268 m = can_import("Martel")
269 sys.path = old_path
270 if m:
271 old_martel_version = m.__version__
272 else:
273 old_martel_version = None
274
275 installed = 0
ff3d016 Install Martel if the Biopython version is the same or newer -- preve…
chapmanb authored
276 # 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
277 if old_martel_version and bundled_martel_version and \
ff3d016 Install Martel if the Biopython version is the same or newer -- preve…
chapmanb authored
278 bundled_martel_version < old_martel_version:
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
279 installed = 1
280 return installed
281
282 def is_mxTextTools_installed():
283 if can_import("TextTools"):
284 return 1
285 return can_import("mx.TextTools")
286
287 def is_Numpy_installed():
288 return can_import("Numeric")
289
290 def is_reportlab_installed():
291 return can_import("reportlab")
292
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
293 # --- set up the packages we are going to install
294 # standard biopython packages
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
295 PACKAGES = [
296 'Bio',
297 'Bio.Ais',
298 'Bio.Align',
193e993 initial checking of Bartek Wilczynski's AlignAce module
jchang authored
299 'Bio.AlignAce',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
300 'Bio.Alphabet',
301 'Bio.Application',
302 'Bio.Blast',
303 'Bio.builders',
304 'Bio.builders.Search',
305 'Bio.builders.SeqRecord',
0cd0e9c Modified Files:
idoerg authored
306 'Bio.CAPS',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
307 'Bio.CDD',
76ce5ca Added Compass parsing code contributed by James Casbon.
chapmanb authored
308 'Bio.Compass',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
309 'Bio.Clustalw',
310 'Bio.config',
311 'Bio.Crystal',
312 'Bio.Data',
313 'Bio.dbdefs',
314 'Bio.ECell',
315 'Bio.Emboss',
316 'Bio.Encodings',
317 'Bio.Enzyme',
318 'Bio.expressions',
319 'Bio.expressions.blast',
320 'Bio.expressions.embl',
321 'Bio.expressions.swissprot',
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
322 'Bio.EUtils',
323 'Bio.EUtils.DTDs',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
324 'Bio.Fasta',
325 'Bio.formatdefs',
326 'Bio.FSSP',
327 'Bio.GA',
328 'Bio.GA.Crossover',
329 'Bio.GA.Mutation',
330 'Bio.GA.Repair',
331 'Bio.GA.Selection',
332 'Bio.GenBank',
333 'Bio.Geo',
334 'Bio.GFF',
335 'Bio.Gobase',
336 'Bio.Graphics',
337 'Bio.HMM',
338 'Bio.IntelliGenetics',
339 'Bio.InterPro',
340 'Bio.Kabat',
341 'Bio.KEGG',
342 'Bio.KEGG.Compound',
343 'Bio.KEGG.Enzyme',
344 'Bio.KEGG.Map',
1c9b14b Added LocusLink back in to the install since tests pass
chapmanb authored
345 'Bio.LocusLink',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
346 'Bio.Medline',
347 'Bio.MetaTool',
348 'Bio.Mindy',
349 'Bio.MultiProc',
350 'Bio.NBRF',
351 'Bio.Ndb',
352 'Bio.NeuralNetwork',
353 'Bio.NeuralNetwork.BackPropagation',
354 'Bio.NeuralNetwork.Gene',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
355 'Bio.Nexus',
7bcfbce Adding NMR files kindly contributed by Bob Bussell
chapmanb authored
356 'Bio.NMR',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
357 'Bio.Parsers',
358 'Bio.Pathway',
359 'Bio.Pathway.Rep',
360 'Bio.PDB',
3520916 *** empty log message ***
nisse authored
361 'Bio.PDB.mmCIF',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
362 'Bio.Prosite',
363 'Bio.Rebase',
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This i…
chapmanb authored
364 'Bio.Restriction',
365 'Bio.Restriction._Update',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
366 'Bio.Saf',
367 'Bio.SCOP',
368 'Bio.SeqIO',
369 'Bio.SeqUtils',
2214cae Added Sequencing directory to packages
chapmanb authored
370 'Bio.Sequencing',
7738632 Added Bio.Statistics.
mdehoon authored
371 'Bio.Statistics',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
372 'Bio.SubsMat',
373 'Bio.SVDSuperimposer',
374 'Bio.SwissProt',
375 'Bio.UniGene',
376 'Bio.writers',
377 'Bio.writers.SeqRecord',
3a5d550 Adding Bio.Wise to the distribution
grouse authored
378 'Bio.Wise',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
379 'Bio.WWW',
380 ]
381
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
382 # packages that require Numeric Python
383 NUMPY_PACKAGES = [
384 'Bio.Affy',
385 'Bio.Cluster',
f487844 Removed two lines in setup.py that were causing problems when compili…
mdehoon authored
386 # 'Bio.KDTree', # disabled by default to avoid C++ compilation errors
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
387 ]
388
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
389 EXTENSIONS = [
390 Extension('Bio.cSVM',
391 ['Bio/cSVMmodule.c',
392 'Bio/csupport.c'],
393 include_dirs=["Bio"]
394 ),
395 Extension('Bio.ckMeans',
396 ['Bio/ckMeansmodule.c',
397 'Bio/csupport.c'],
398 include_dirs=["Bio"]
399 ),
400 Extension('Bio.clistfns',
401 ['Bio/clistfnsmodule.c']
402 ),
403 Extension('Bio.cmathfns',
404 ['Bio/cmathfnsmodule.c',
405 'Bio/csupport.c'],
406 include_dirs=["Bio"]
407 ),
408 Extension('Bio.cstringfns',
409 ['Bio/cstringfnsmodule.c']
410 ),
411 Extension('Bio.cdistance',
412 ['Bio/cdistancemodule.c',
413 'Bio/csupport.c'],
414 include_dirs=["Bio"]
415 ),
416 Extension('Bio.cpairwise2',
417 ['Bio/cpairwise2module.c',
418 'Bio/csupport.c'],
419 include_dirs=["Bio"]
420 ),
421 Extension('Bio.trie',
422 ['Bio/triemodule.c',
423 'Bio/trie.c'],
424 include_dirs=["Bio"]
425 ),
426 Extension('Bio.cMarkovModel',
427 ['Bio/cMarkovModelmodule.c',
428 'Bio/csupport.c'],
429 include_dirs=["Bio"]
430 ),
3520916 *** empty log message ***
nisse authored
431 Extension('Bio.PDB.mmCIF.MMCIFlex',
432 ['Bio/PDB/mmCIF/lex.yy.c',
433 'Bio/PDB/mmCIF/MMCIFlexmodule.c'],
434 include_dirs=["Bio"],
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
435 libraries=["fl"]
436 ),
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
437 Extension('Bio.cnexus',
438 ['Bio/Nexus/cnexus.c']
439 ),
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This i…
chapmanb authored
440 Extension('Bio.Restriction.DNAUtils',
441 ['Bio/Restriction/DNAUtils.c']
442 ),
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
443 ]
444
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
445 # extensions that require numeric python
446 NUMPY_EXTENSIONS = [
447 Extension('Bio.Cluster.cluster',
448 ['Bio/Cluster/clustermodule.c',
449 'Bio/Cluster/cluster.c',
450 'Bio/Cluster/ranlib.c',
451 'Bio/Cluster/com.c',
452 'Bio/Cluster/linpack.c'],
453 include_dirs=["Bio/Cluster"]
454 ),
f487844 Removed two lines in setup.py that were causing problems when compili…
mdehoon authored
455 # CplusplusExtension('Bio.KDTree._CKDTree', # Disabled by default to avoid
456 # ["Bio/KDTree/KDTree.cpp", # C++ compilation errors
457 # "Bio/KDTree/KDTree.swig.cpp"],
458 # libraries=["stdc++"],
459 # language="c++"
460 # ),
c686839 The CEL file parser in Bio/Affy/celmodule.cc was replaced by a scanne…
mdehoon authored
461 # CplusplusExtension('Bio.Affy._cel', # The file parser in celmodule.cc was
462 # ['Bio/Affy/celmodule.cc'], # replaced by a scanner/consumer in
463 # language="c++" # CelFile.py, using Biopython's
464 # ), # parser framework
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
465 ]
466
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
467 DATA_FILES=[
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
468 "Bio/EUtils/DTDs/*.dtd",
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
469 ]
470
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
471 # EUtils contains dtd files that need to be installed in the same
472 # directory as the python modules. Distutils doesn't have a simple
473 # way of handling this, and we need to subclass install_data. This
474 # code is adapted from the mx.TextTools distribution.
475
476 class install_data_biopython(install_data):
477 def finalize_options(self):
478 if self.install_dir is None:
479 installobj = self.distribution.get_command_obj('install')
480 self.install_dir = installobj.install_platlib
481 install_data.finalize_options(self)
482
483 def run (self):
484 import glob
485 if not self.dry_run:
486 self.mkpath(self.install_dir)
487 data_files = self.get_inputs()
488 for entry in data_files:
489 if type(entry) is not type(""):
490 raise ValueError, "data_files must be strings"
491 # Unix- to platform-convention conversion
492 entry = os.sep.join(entry.split("/"))
493 filenames = glob.glob(entry)
494 for filename in filenames:
495 dst = os.path.join(self.install_dir, filename)
496 dstdir = os.path.split(dst)[0]
497 if not self.dry_run:
498 self.mkpath(dstdir)
499 outfile = self.copy_file(filename, dst)[0]
500 else:
501 outfile = dst
502 self.outfiles.append(outfile)
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
503
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
504
505 # Install BioSQL.
506 PACKAGES.append("BioSQL")
507
508 setup(
509 name='biopython',
f50e2b1 Changed biopython version to 1.40
idoerg authored
510 version='1.40',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
511 author='The Biopython Consortium',
512 author_email='biopython@biopython.org',
513 url='http://www.biopython.org/',
514 cmdclass={
515 "install" : install_biopython,
516 "build_py" : build_py_biopython,
a8ae40f now installs Martel and doesn't complain about it
jchang authored
517 "build_ext" : build_ext_biopython,
b9fe0cc the EUtils dtd's were not being installed correctly, when the
jchang authored
518 "install_data" : install_data_biopython,
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
519 "test" : test_biopython,
520 },
521 packages=PACKAGES,
522 ext_modules=EXTENSIONS,
9283de6 fixed installation of Bio/EUtils/DTDs
jchang authored
523 data_files=DATA_FILES,
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
524 )
Something went wrong with that request. Please try again.