Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 495 lines (423 sloc) 14.829 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
b4379ed @peterjc Dropping support for Python 2.3
peterjc authored
10 Biopython manual, linked to from:
22df84e Updated setup.py for GenBank
chapmanb authored
11
e4e4dc4 @peterjc Updating the documentation URL
peterjc authored
12 http://biopython.org/wiki/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
0277345 @peterjc Clarify the mailing list bit
peterjc authored
19 Or, if all else fails, feel free to write to the sign up to the Biopython
e4e4dc4 @peterjc Updating the documentation URL
peterjc authored
20 mailing list and ask for help. See:
21
22 http://biopython.org/wiki/Mailing_lists
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
23 """
de12c5e @peterjc Add: from __future__ import print_statement
peterjc authored
24 from __future__ import print_function
25
f726249 merged Andrew's Seq package with the tree
jchang authored
26 import sys
96a6095 Upgrade setup.py for SubsMat
chapmanb authored
27 import os
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
28 import shutil
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
29
f8e5190 @peterjc Remove setuptools code (see mailing list)
peterjc authored
30 from distutils.core import setup
31 from distutils.core import Command
32 from distutils.command.install import install
33 from distutils.command.build_py import build_py
34 from distutils.command.build_ext import build_ext
35 from distutils.extension import Extension
36
37 _CHECKED = None
38
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
39
2ceecab @peterjc Handle clang error about -mno-fused-madd under Mac OS X.
peterjc authored
40 def osx_clang_fix():
41 """Add clang switch to ignore unused arguments to avoid OS X compile error.
42
43 This is a hack to cope with Apple shipping a version of Python compiled
44 with the -mno-fused-madd argument which clang from XCode 5.1 does not
45 support::
46
47 $ cc -v
48 Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
49 Target: x86_64-apple-darwin13.2.0
50 Thread model: posix
51
52 $ which python-config
53 /Library/Frameworks/Python.framework/Versions/Current/bin/python-config
54
55 $ python-config --cflags
56 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
57 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
58 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
59 -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
60 -fno-common -dynamic -DNDEBUG -g -O3
61
62 We can avoid the clang compilation error with -Qunused-arguments which is
63 (currently) harmless if gcc is being used instead (e.g. compiling Biopython
64 against a locally compiled Python rather than the Apple provided Python).
65 """
66 # see http://lists.open-bio.org/pipermail/biopython-dev/2014-April/011240.html
67 if sys.platform != "darwin":
68 return
69 # see also Bio/_py3k/__init__.py (which we can't use in setup.py)
70 if sys.version_info[0] >= 3:
71 from subprocess import getoutput
72 else:
73 from commands import getoutput
74 cc = getoutput("cc -v")
75 if "gcc" in cc or "clang" not in cc:
76 return
77 for flag in ["CFLAGS", "CPPFLAGS"]:
78 if flag not in os.environ:
79 os.environ[flag] = "-Qunused-arguments"
80 elif "-Qunused-arguments" not in os.environ[flag]:
81 os.environ[flag] += " -Qunused-arguments"
82
83 osx_clang_fix()
84
85
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
86 def is_pypy():
87 import platform
88 try:
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
89 if platform.python_implementation() == 'PyPy':
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
90 return True
91 except AttributeError:
82272b1 @peterjc autopep8 E265 - Format block comments.
peterjc authored
92 # New in Python 2.6, not in Jython yet either
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
93 pass
94 return False
95
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
96
fdee559 @peterjc Hack setup.py to run under IronPython
peterjc authored
97 def is_ironpython():
98 return sys.platform == "cli"
82272b1 @peterjc autopep8 E265 - Format block comments.
peterjc authored
99 # TODO - Use platform as in Pypy test?
fdee559 @peterjc Hack setup.py to run under IronPython
peterjc authored
100
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
101
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
102 def get_yes_or_no(question, default):
103 if default:
104 option_str = "(Y/n)"
105 default_str = 'y'
106 else:
107 option_str = "(y/N)"
108 default_str = 'n'
109
e4e4dc4 @peterjc Updating the documentation URL
peterjc authored
110 while True:
b758767 @peterjc Use print function spacing in setup.py
peterjc authored
111 print("%s %s:" % (question, option_str))
942ef84 @tiagoantao setup.py is now Python 3 aware
tiagoantao authored
112 if sys.version_info[0] == 3:
113 response = input().lower()
114 else:
115 response = raw_input().lower()
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
116 if not response:
117 response = default_str
118 if response[0] in ['y', 'n']:
119 break
b758767 @peterjc Use print function spacing in setup.py
peterjc authored
120 print("Please answer y or n.")
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
121 return response[0] == 'y'
122
f8e5190 @peterjc Remove setuptools code (see mailing list)
peterjc authored
123
3f17f75 @peterjc We are phasing out support for Python 2.5
peterjc authored
124 # Make sure we have the right Python version.
66594d6 @peterjc Update setup.py now we've dropped Python 2.5
peterjc authored
125 if sys.version_info[:2] < (2, 6):
b5fb7f6 @peterjc Drop Python 3.2
peterjc authored
126 print("Biopython requires Python 2.6 or 2.7 (or Python 3.3 or later). "
66594d6 @peterjc Update setup.py now we've dropped Python 2.5
peterjc authored
127 "Python %d.%d detected" % sys.version_info[:2])
de71aad @peterjc Disable installation under Python 3.1 (unittest import broke)
peterjc authored
128 sys.exit(1)
65b72a8 @peterjc PyPy3 version 2.4.0 seems to work.
peterjc authored
129 elif is_pypy() and sys.version_info[0] == 3 and sys.version_info[:2] == (3, 2):
130 # PyPy3 2.4.0 is compatibile with Python 3.2.5 plus unicode literals
131 # so ought to work with Biopython
132 pass
b5fb7f6 @peterjc Drop Python 3.2
peterjc authored
133 elif sys.version_info[0] == 3 and sys.version_info[:2] < (3, 3):
134 print("Biopython requires Python 3.3 or later (or Python 2.6 or 2.7). "
135 "Python %d.%d detected" % sys.version_info[:2])
b2179b5 @peterjc More specific warnings regarding Python 3 versions
peterjc authored
136 sys.exit(1)
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs …
chapmanb authored
137
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
138
a8ae40f now installs Martel and doesn't complain about it
jchang authored
139 def check_dependencies_once():
140 # Call check_dependencies, but cache the result for subsequent
141 # calls.
142 global _CHECKED
143 if _CHECKED is None:
144 _CHECKED = check_dependencies()
145 return _CHECKED
146
f8e5190 @peterjc Remove setuptools code (see mailing list)
peterjc authored
147
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as dep…
chapmanb authored
148 def is_automated():
149 """Check for installation with easy_install or pip.
150 """
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs …
chapmanb authored
151 is_automated = False
152 # easy_install: --dist-dir option passed
153 try:
154 dist_dir_i = sys.argv.index("--dist-dir")
155 except ValueError:
156 dist_dir_i = None
157 if dist_dir_i is not None:
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
158 dist_dir = sys.argv[dist_dir_i + 1]
4f96917 @chapmanb Eric's suggestions to generalize easy_install/pip detection
chapmanb authored
159 if "egg-dist-tmp" in dist_dir:
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs …
chapmanb authored
160 is_automated = True
161 # pip -- calls from python directly with "-c"
d9500da @cbrueffer Distinguish continuation lines from the next logical line (PEP8 E125).
cbrueffer authored
162 if sys.argv in [["-c", "develop", "--no-deps"],
163 ["--no-deps", "-c", "develop"],
164 ["-c", "egg_info"]] \
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as dep…
chapmanb authored
165 or "pip-egg-info" in sys.argv \
1d3d2fe @chapmanb Correctly detect pip installation for pip 1.1 Thanks to @kblin
chapmanb authored
166 or sys.argv[:3] == ["-c", "install", "--record"] \
167 or sys.argv[:4] == ['-c', 'install', '--single-version-externally-managed',
168 '--record']:
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs …
chapmanb authored
169 is_automated = True
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as dep…
chapmanb authored
170 return is_automated
171
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs …
chapmanb authored
172
a8ae40f now installs Martel and doesn't complain about it
jchang authored
173 def check_dependencies():
174 """Return whether the installation should continue."""
175 # There should be some way for the user to tell specify not to
176 # check dependencies. For example, it probably should not if
177 # the user specified "-q". However, I'm not sure where
178 # distutils stores that information. Also, install has a
179 # --force option that gets saved in self.user_options. It
180 # means overwrite previous installations. If the user has
181 # forced an installation, should we also ignore dependencies?
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy,…
peterjc authored
182
183 # We only check for NumPy, as this is a compile time dependency
4d2350a @cbrueffer Avoid multiple statements on one line (PEP8 E701).
cbrueffer authored
184 if is_Numpy_installed():
185 return True
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as dep…
chapmanb authored
186 if is_automated():
187 return True # For automated builds go ahead with installed packages
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
188 if os.name == 'java':
189 return True # NumPy is not avaliable for Jython (for now)
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
190 if is_pypy():
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
191 return True # Full NumPy not available for PyPy (for now)
fdee559 @peterjc Hack setup.py to run under IronPython
peterjc authored
192 if is_ironpython():
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
193 return True # We're ignoring NumPy under IronPython (for now)
0627102 @peterjc Don't nag Jython users about NumPy not being installed. Fix from Kyle…
peterjc authored
194
b758767 @peterjc Use print function spacing in setup.py
peterjc authored
195 print("""
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy,…
peterjc authored
196 Numerical Python (NumPy) is not installed.
197
a8ae40f now installs Martel and doesn't complain about it
jchang authored
198 This package is required for many Biopython features. Please install
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy,…
peterjc authored
199 it before you install Biopython. You can install Biopython anyway, but
200 anything dependent on NumPy will not work. If you do this, and later
201 install NumPy, you should then re-install Biopython.
202
1d98d32 @tiagoantao Updating the URL of NumPy
tiagoantao authored
203 You can find NumPy at http://www.numpy.org
942ef84 @tiagoantao setup.py is now Python 3 aware
tiagoantao authored
204 """)
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy,…
peterjc authored
205 # exit automatically if running as part of some script
206 # (e.g. PyPM, ActiveState's Python Package Manager)
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
207 if not sys.stdout.isatty():
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy,…
peterjc authored
208 sys.exit(-1)
209 # We can ask the user
210 return get_yes_or_no("Do you want to continue this installation?", False)
a8ae40f now installs Martel and doesn't complain about it
jchang authored
211
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
212
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
213 class install_biopython(install):
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
214 """Override the standard install to check for dependencies.
215
216 This will just run the normal install, and then print warning messages
217 if packages are missing.
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
218
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
219 """
4e4c3aa @chapmanb Add support for single-version-externally-managed flag which pip asks…
chapmanb authored
220 # Adds support for the single-version-externally-managed flag
221 # which is present in setuptools but not distutils. pip requires it.
222 # In setuptools this forces installation the "old way" which we
223 # only support here, so we just make it a no-op.
224 user_options = install.user_options + [
225 ('single-version-externally-managed', None,
226 "used by system package builders to create 'flat' eggs"),
227 ]
228 boolean_options = install.boolean_options + [
229 'single-version-externally-managed',
230 ]
bfa8b25 @cbrueffer Add a blank line before and after functions (PEP8 E301).
cbrueffer authored
231
4e4c3aa @chapmanb Add support for single-version-externally-managed flag which pip asks…
chapmanb authored
232 def initialize_options(self):
233 install.initialize_options(self)
234 self.single_version_externally_managed = None
235
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
236 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
237 if check_dependencies_once():
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
238 # Run the normal install.
239 install.run(self)
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
240
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
241
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
242 class build_py_biopython(build_py):
243 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
244 if not check_dependencies_once():
245 return
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
246 # Add software that requires Numpy to be installed.
a8ae40f now installs Martel and doesn't complain about it
jchang authored
247 if is_Numpy_installed():
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
248 self.packages.extend(NUMPY_PACKAGES)
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
249 build_py.run(self)
fc90717 Whew, final thing to add! Added code for displaying pretty pictures u…
chapmanb authored
250
94b412a See bug #2375. Copy data files to the build directory, so the tests run
mdehoon authored
251
a8ae40f now installs Martel and doesn't complain about it
jchang authored
252 class build_ext_biopython(build_ext):
253 def run(self):
254 if not check_dependencies_once():
255 return
256 build_ext.run(self)
257
a151e5c workaround for bug in distutils that prevents one from compiling both…
grouse authored
258
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
259 class test_biopython(Command):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
260 """Run all of the tests for the package.
261
262 This is a automatic test run class to make distutils kind of act like
263 perl. With this you can do:
264
265 python setup.py build
266 python setup.py install
267 python setup.py test
b1c8597 @cbrueffer Trim EOL whitespace (PEP8 W291, W293), batch 3.
cbrueffer authored
268
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
269 """
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
270 description = "Automatically run the test suite for Biopython."
844496e @peterjc Removing the now redundant --no-gui argument for the test suite.
peterjc authored
271 user_options = []
1d16b65 The modification to setup.py gives the option of --no-gui for the com…
lasher authored
272
273 def initialize_options(self):
844496e @peterjc Removing the now redundant --no-gui argument for the test suite.
peterjc authored
274 pass
1d16b65 The modification to setup.py gives the option of --no-gui for the com…
lasher authored
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, '')
b1c8597 @cbrueffer Trim EOL whitespace (PEP8 W291, W293), batch 3.
cbrueffer authored
285 import run_tests
844496e @peterjc Removing the now redundant --no-gui argument for the test suite.
peterjc authored
286 run_tests.main([])
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
287
288 # change back to the current directory
289 os.chdir(this_dir)
290
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
291
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
292 def can_import(module_name):
293 """can_import(module_name) -> module or None"""
294 try:
295 return __import__(module_name)
296 except ImportError:
297 return None
298
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
299
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
300 def is_Numpy_installed():
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
301 if is_pypy():
302 return False
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy,…
peterjc authored
303 return bool(can_import("numpy"))
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
304
7db13b0 Updated to check for dependencies and print out warnings and to insta…
chapmanb authored
305 # --- set up the packages we are going to install
306 # standard biopython packages
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
307 PACKAGES = [
308 'Bio',
309 'Bio.Align',
32c4f4b @peterjc Adding wrapper from Cymon Cox for the MUSCLE alignment tool, with bas…
peterjc authored
310 'Bio.Align.Applications',
1231257 @peterjc Include Bio.AlignIO in installation
peterjc authored
311 'Bio.AlignIO',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
312 'Bio.Alphabet',
313 'Bio.Application',
314 'Bio.Blast',
0cd0e9c Modified Files:
idoerg authored
315 'Bio.CAPS',
64c625b @zruan change Bio.CodonSeq to Bio.codonseq to follow PEP8
zruan authored
316 'Bio.codonalign',
76ce5ca Added Compass parsing code contributed by James Casbon.
chapmanb authored
317 'Bio.Compass',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
318 'Bio.Crystal',
319 'Bio.Data',
320 'Bio.Emboss',
8521e25 Moving Bio/Entrez.py to Bio/Entrez/__init__.py.
mdehoon authored
321 'Bio.Entrez',
c23628e Now that Bio/ExPASy.py was replaced by Bio/ExPASy/__init__.py, we nee…
mdehoon authored
322 'Bio.ExPASy',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
323 'Bio.FSSP',
324 'Bio.GA',
325 'Bio.GA.Crossover',
326 'Bio.GA.Mutation',
327 'Bio.GA.Repair',
328 'Bio.GA.Selection',
329 'Bio.GenBank',
330 'Bio.Geo',
331 'Bio.Graphics',
cace008 @peterjc Initial check in of GenomeDiagram by Leighton Pritchard, converted fo…
peterjc authored
332 'Bio.Graphics.GenomeDiagram',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
333 'Bio.HMM',
334 'Bio.KEGG',
335 'Bio.KEGG.Compound',
336 'Bio.KEGG.Enzyme',
337 'Bio.KEGG.Map',
0729526 @widdowquinn KEGG KGML parsing and graphics with tests
widdowquinn authored
338 'Bio.KEGG.KGML',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
339 'Bio.Medline',
9deacf3 added Bio.Motif to setup.py
bartek authored
340 'Bio.Motif',
fc68931 @peterjc Need to install Bio.Motif.PArsers
peterjc authored
341 'Bio.Motif.Parsers',
594a86a @peterjc Include Bio.Motif.Applications module
peterjc authored
342 'Bio.Motif.Applications',
a4bf956 Renaming Bio.Motif to Bio.motifs; Copying the biopython 1.60 version …
mdehoon authored
343 'Bio.motifs',
344 'Bio.motifs.applications',
af84a3c @pgarland Add the new Bio.motifs.jaspar package to the list of packages to install
pgarland authored
345 'Bio.motifs.jaspar',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
346 'Bio.NeuralNetwork',
347 'Bio.NeuralNetwork.BackPropagation',
348 'Bio.NeuralNetwork.Gene',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
349 'Bio.Nexus',
7bcfbce Adding NMR files kindly contributed by Bob Bussell
chapmanb authored
350 'Bio.NMR',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
351 'Bio.Pathway',
352 'Bio.Pathway.Rep',
353 'Bio.PDB',
4f07b8a Added Bio.PopGen module by Tiago Antao.
mdehoon authored
354 'Bio.PopGen',
355 'Bio.PopGen.Async',
356 'Bio.PopGen.FDist',
357 'Bio.PopGen.GenePop',
96f01d5 2375: Activating SimCoal on Biopython setup
tiagoantao authored
358 'Bio.PopGen.SimCoal',
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This i…
chapmanb authored
359 'Bio.Restriction',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
360 'Bio.SCOP',
b903d00 @bow Update setup.py to include SearchIO and its submodules
bow authored
361 'Bio.SearchIO',
16e2334 @bow Add Bio.SearchIO._model to setup.py
bow authored
362 'Bio.SearchIO._model',
b903d00 @bow Update setup.py to include SearchIO and its submodules
bow authored
363 'Bio.SearchIO.BlastIO',
364 'Bio.SearchIO.HmmerIO',
365 'Bio.SearchIO.ExonerateIO',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
366 'Bio.SeqIO',
367 'Bio.SeqUtils',
2214cae Added Sequencing directory to packages
chapmanb authored
368 'Bio.Sequencing',
42be9a8 Add Novoalign commandline submitted by Osvaldo Zagordi; Bug 2904
chapmanb authored
369 'Bio.Sequencing.Applications',
7738632 Added Bio.Statistics.
mdehoon authored
370 'Bio.Statistics',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
371 'Bio.SubsMat',
372 'Bio.SVDSuperimposer',
eac5005 @xulesc Add rmsd based structure superimpose that uses quaternions.
xulesc authored
373 'Bio.PDB.QCPSuperimposer',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
374 'Bio.SwissProt',
01ba2f2 @peterjc Basics for TogoWS REST API support
peterjc authored
375 'Bio.TogoWS',
eb394c0 @chapmanb Whoops. Revert setup.py to latest version
chapmanb authored
376 'Bio.Phylo',
b22304a @etal Phylo.Applications: Added a PhyML wrapper (Feature #3216)
etal authored
377 'Bio.Phylo.Applications',
9531507 @peterjc Must install new PAML module
peterjc authored
378 'Bio.Phylo.PAML',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
379 'Bio.UniGene',
946823d @peterjc Must install the new Bio.UniProt module
peterjc authored
380 'Bio.UniProt',
3a5d550 Adding Bio.Wise to the distribution
grouse authored
381 'Bio.Wise',
1a9bd6e @peterjc Make Bio._py3k module into a package (Bio/_py3k/__init__.py)
peterjc authored
382 'Bio._py3k',
82272b1 @peterjc autopep8 E265 - Format block comments.
peterjc authored
383 # Other top level packages,
d81c27e @peterjc Removed the Martel special case code (it should be safe to assume tha…
peterjc authored
384 'BioSQL',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
385 ]
386
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
387 # packages that require Numeric Python
388 NUMPY_PACKAGES = [
389 'Bio.Affy',
390 'Bio.Cluster',
379fbb7 Switched from the old Numerical Python to the new NumPy. Bio.KDTree i…
mdehoon authored
391 'Bio.KDTree',
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
392 ]
393
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
394 if os.name == 'java':
ae19435 @peterjc Fix from Kyle Ellrott to get setup.py to work on Jython 2.5.0 by not …
peterjc authored
395 # Jython doesn't support C extensions
396 EXTENSIONS = []
fdee559 @peterjc Hack setup.py to run under IronPython
peterjc authored
397 elif is_pypy() or is_ironpython():
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
398 # Skip C extensions for now
399 EXTENSIONS = []
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
400 else:
ae19435 @peterjc Fix from Kyle Ellrott to get setup.py to work on Jython 2.5.0 by not …
peterjc authored
401 EXTENSIONS = [
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
402 Extension('Bio.cpairwise2',
c21a741 Put csupport in the pairwise2 module, as currently it is not used any…
Michiel de Hoon authored
403 ['Bio/cpairwise2module.c'],
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
404 ),
405 Extension('Bio.trie',
406 ['Bio/triemodule.c',
407 'Bio/trie.c'],
408 include_dirs=["Bio"]
409 ),
2800c6c *** empty log message ***
idoerg authored
410 Extension('Bio.Nexus.cnexus',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
411 ['Bio/Nexus/cnexus.c']
412 ),
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
413 ]
414
82272b1 @peterjc autopep8 E265 - Format block comments.
peterjc authored
415 # Add extensions that requires NumPy to build
48d1716 @peterjc Seems must define list of extensions earlier for them to be installed…
peterjc authored
416 if is_Numpy_installed():
417 import numpy
418 numpy_include_dir = numpy.get_include()
419 EXTENSIONS.append(
420 Extension('Bio.Cluster.cluster',
421 ['Bio/Cluster/clustermodule.c',
422 'Bio/Cluster/cluster.c'],
423 include_dirs=[numpy_include_dir],
424 ))
425 EXTENSIONS.append(
426 Extension('Bio.KDTree._CKDTree',
427 ["Bio/KDTree/KDTree.c",
428 "Bio/KDTree/KDTreemodule.c"],
429 include_dirs=[numpy_include_dir],
430 ))
431 EXTENSIONS.append(
432 Extension('Bio.Motif._pwm',
433 ["Bio/Motif/_pwm.c"],
434 include_dirs=[numpy_include_dir],
435 ))
a4bf956 Renaming Bio.Motif to Bio.motifs; Copying the biopython 1.60 version …
mdehoon authored
436 EXTENSIONS.append(
437 Extension('Bio.motifs._pwm',
438 ["Bio/motifs/_pwm.c"],
439 include_dirs=[numpy_include_dir],
440 ))
eac5005 @xulesc Add rmsd based structure superimpose that uses quaternions.
xulesc authored
441 EXTENSIONS.append(
442 Extension('Bio.PDB.QCPSuperimposer.qcprotmodule',
443 ["Bio/PDB/QCPSuperimposer/qcprotmodule.c"],
444 include_dirs=[numpy_include_dir],
445 ))
48d1716 @peterjc Seems must define list of extensions earlier for them to be installed…
peterjc authored
446
ae19435 @peterjc Fix from Kyle Ellrott to get setup.py to work on Jython 2.5.0 by not …
peterjc authored
447
82272b1 @peterjc autopep8 E265 - Format block comments.
peterjc authored
448 # We now define the Biopython version number in Bio/__init__.py
449 # Here we can't use "import Bio" then "Bio.__version__" as that would
450 # tell us the version of Biopython already installed (if any).
839c345 @peterjc Adding Bio.__version__ and using this in setup.py automatically. The…
peterjc authored
451 __version__ = "Undefined"
452 for line in open('Bio/__init__.py'):
453 if (line.startswith('__version__')):
454 exec(line.strip())
455
82272b1 @peterjc autopep8 E265 - Format block comments.
peterjc authored
456 # Simple trick to use the 2to3 converted source under Python 3,
457 # change the current directory before/after running setup.
458 # Note as a side effect there will be a build folder underneath
459 # the python3_source folder.
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
460 old_path = os.getcwd()
461 try:
462 src_path = python3_source
463 except NameError:
464 src_path = os.path.dirname(os.path.abspath(sys.argv[0]))
465 os.chdir(src_path)
466 sys.path.insert(0, src_path)
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
467
468 setup_args = {
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
469 "name": 'biopython',
470 "version": __version__,
c056f38 @peterjc The Biopython Consortium --> The Biopython Contributors
peterjc authored
471 "author": 'The Biopython Contributors',
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
472 "author_email": 'biopython@biopython.org',
473 "url": 'http://www.biopython.org/',
474 "description": 'Freely available tools for computational molecular biology.',
475 "download_url": 'http://biopython.org/DIST/',
476 "cmdclass": {
477 "install": install_biopython,
478 "build_py": build_py_biopython,
479 "build_ext": build_ext_biopython,
480 "test": test_biopython,
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
481 },
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
482 "packages": PACKAGES,
483 "ext_modules": EXTENSIONS,
484 "package_data": {
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
485 'Bio.Entrez': ['DTDs/*.dtd', 'DTDs/*.ent', 'DTDs/*.mod'],
486 'Bio.PopGen': ['SimCoal/data/*.par'],
487 },
488 }
489
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
490 try:
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
491 setup(**setup_args)
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
492 finally:
493 del sys.path[0]
494 os.chdir(old_path)
Something went wrong with that request. Please try again.