Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 468 lines (404 sloc) 14.159 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 install ...
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
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
40 def is_pypy():
41 import platform
42 try:
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
43 if platform.python_implementation() == 'PyPy':
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
44 return True
45 except AttributeError:
46 #New in Python 2.6, not in Jython yet either
47 pass
48 return False
49
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
50
fdee559 @peterjc Hack setup.py to run under IronPython
peterjc authored
51 def is_ironpython():
52 return sys.platform == "cli"
53 #TODO - Use platform as in Pypy test?
54
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
55
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
56 def get_yes_or_no(question, default):
57 if default:
58 option_str = "(Y/n)"
59 default_str = 'y'
60 else:
61 option_str = "(y/N)"
62 default_str = 'n'
63
e4e4dc4 @peterjc Updating the documentation URL
peterjc authored
64 while True:
b758767 @peterjc Use print function spacing in setup.py
peterjc authored
65 print("%s %s:" % (question, option_str))
942ef84 @tiagoantao setup.py is now Python 3 aware
tiagoantao authored
66 if sys.version_info[0] == 3:
67 response = input().lower()
68 else:
69 response = raw_input().lower()
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
70 if not response:
71 response = default_str
72 if response[0] in ['y', 'n']:
73 break
b758767 @peterjc Use print function spacing in setup.py
peterjc authored
74 print("Please answer y or n.")
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
75 return response[0] == 'y'
76
f8e5190 @peterjc Remove setuptools code (see mailing list)
peterjc authored
77
3f17f75 @peterjc We are phasing out support for Python 2.5
peterjc authored
78 # Make sure we have the right Python version.
66594d6 @peterjc Update setup.py now we've dropped Python 2.5
peterjc authored
79 if sys.version_info[:2] < (2, 6):
80 print("Biopython requires Python 2.6 or later (or python 3.3 or later). "
81 "Python %d.%d detected" % sys.version_info[:2])
de71aad @peterjc Disable installation under Python 3.1 (unittest import broke)
peterjc authored
82 sys.exit(1)
83 elif sys.version_info[:2] == (3, 0) or sys.version_info[:2] == (3, 1):
84 print("Biopython will not work on Python 3.0 or 3.1, please try Python 3.3 or later")
b2179b5 @peterjc More specific warnings regarding Python 3 versions
peterjc authored
85 sys.exit(1)
942ef84 @tiagoantao setup.py is now Python 3 aware
tiagoantao authored
86 elif sys.version_info[0] == 3:
b2179b5 @peterjc More specific warnings regarding Python 3 versions
peterjc authored
87 if sys.version_info[:2] < (3, 3):
88 #TODO - Turn off old buildbots/travis and make this an error?
de71aad @peterjc Disable installation under Python 3.1 (unittest import broke)
peterjc authored
89 #May want to wait until PyPy3 targets 3.3 instead of 3.2
41c32c9 @peterjc Avoid warning about C Python 3.3.1 if using PyPy3
peterjc authored
90 print("WARNING - For Python 3, we strongly recommend Python 3.3 or later.")
91 if sys.version_info == (3, 3, 1) and sys.implementation == "cpython":
b2179b5 @peterjc More specific warnings regarding Python 3 versions
peterjc authored
92 print("WARNING - Rather than Python 3.3.1, we recommend Python 3.3.0, or 3.3.2, or later.")
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
93 import do2to3
94 python3_source = "build/py%i.%i" % sys.version_info[:2]
95 if "clean" in sys.argv:
96 if os.path.isdir(python3_source):
97 shutil.rmtree(python3_source)
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
98 del python3_source # so we don't try to change to it below
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
99 else:
100 if not os.path.isdir("build"):
101 os.mkdir("build")
102 do2to3.main(".", python3_source)
0f821c5 @chapmanb Enable installation with pip using Python 3.3. Uses workarounds from num...
chapmanb authored
103 # Ugly hack to make pip work with Python 3, from 2to3 numpy setup:
104 # https://github.com/numpy/numpy/blob/bb726ca19f434f5055c0efceefe48d89469fcbbe/setup.py#L172
105 # Explanation: pip messes with __file__ which interacts badly with the
106 # change in directory due to the 2to3 conversion. Therefore we restore
107 # __file__ to what it would have been otherwise.
108 local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
109 global __file__
110 __file__ = os.path.join(os.curdir, os.path.basename(__file__))
111 if '--egg-base' in sys.argv:
112 # Change pip-egg-info entry to absolute path, so pip can find it
113 # after changing directory.
114 idx = sys.argv.index('--egg-base')
115 if sys.argv[idx + 1] == 'pip-egg-info':
116 sys.argv[idx + 1] = os.path.join(local_path, 'pip-egg-info')
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs lik...
chapmanb authored
117
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
118
a8ae40f now installs Martel and doesn't complain about it
jchang authored
119 def check_dependencies_once():
120 # Call check_dependencies, but cache the result for subsequent
121 # calls.
122 global _CHECKED
123 if _CHECKED is None:
124 _CHECKED = check_dependencies()
125 return _CHECKED
126
f8e5190 @peterjc Remove setuptools code (see mailing list)
peterjc authored
127
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as depend...
chapmanb authored
128 def is_automated():
129 """Check for installation with easy_install or pip.
130 """
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs lik...
chapmanb authored
131 is_automated = False
132 # easy_install: --dist-dir option passed
133 try:
134 dist_dir_i = sys.argv.index("--dist-dir")
135 except ValueError:
136 dist_dir_i = None
137 if dist_dir_i is not None:
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
138 dist_dir = sys.argv[dist_dir_i + 1]
4f96917 @chapmanb Eric's suggestions to generalize easy_install/pip detection
chapmanb authored
139 if "egg-dist-tmp" in dist_dir:
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs lik...
chapmanb authored
140 is_automated = True
141 # pip -- calls from python directly with "-c"
d9500da @cbrueffer Distinguish continuation lines from the next logical line (PEP8 E125).
cbrueffer authored
142 if sys.argv in [["-c", "develop", "--no-deps"],
143 ["--no-deps", "-c", "develop"],
144 ["-c", "egg_info"]] \
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as depend...
chapmanb authored
145 or "pip-egg-info" in sys.argv \
1d3d2fe @chapmanb Correctly detect pip installation for pip 1.1 Thanks to @kblin
chapmanb authored
146 or sys.argv[:3] == ["-c", "install", "--record"] \
147 or sys.argv[:4] == ['-c', 'install', '--single-version-externally-managed',
148 '--record']:
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs lik...
chapmanb authored
149 is_automated = True
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as depend...
chapmanb authored
150 return is_automated
151
5b12cfd @chapmanb Add numpy as required library and skip check with automated installs lik...
chapmanb authored
152
a8ae40f now installs Martel and doesn't complain about it
jchang authored
153 def check_dependencies():
154 """Return whether the installation should continue."""
155 # There should be some way for the user to tell specify not to
156 # check dependencies. For example, it probably should not if
157 # the user specified "-q". However, I'm not sure where
158 # distutils stores that information. Also, install has a
159 # --force option that gets saved in self.user_options. It
160 # means overwrite previous installations. If the user has
161 # forced an installation, should we also ignore dependencies?
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy, an...
peterjc authored
162
163 # We only check for NumPy, as this is a compile time dependency
4d2350a @cbrueffer Avoid multiple statements on one line (PEP8 E701).
cbrueffer authored
164 if is_Numpy_installed():
165 return True
bc82834 @chapmanb Improve Biopython installation with pip: avoid including numpy as depend...
chapmanb authored
166 if is_automated():
167 return True # For automated builds go ahead with installed packages
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
168 if os.name == 'java':
169 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
170 if is_pypy():
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
171 return True # Full NumPy not available for PyPy (for now)
fdee559 @peterjc Hack setup.py to run under IronPython
peterjc authored
172 if is_ironpython():
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
173 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 El...
peterjc authored
174
b758767 @peterjc Use print function spacing in setup.py
peterjc authored
175 print("""
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy, an...
peterjc authored
176 Numerical Python (NumPy) is not installed.
177
a8ae40f now installs Martel and doesn't complain about it
jchang authored
178 This package is required for many Biopython features. Please install
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy, an...
peterjc authored
179 it before you install Biopython. You can install Biopython anyway, but
180 anything dependent on NumPy will not work. If you do this, and later
181 install NumPy, you should then re-install Biopython.
182
183 You can find NumPy at http://numpy.scipy.org
942ef84 @tiagoantao setup.py is now Python 3 aware
tiagoantao authored
184 """)
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy, an...
peterjc authored
185 # exit automatically if running as part of some script
186 # (e.g. PyPM, ActiveState's Python Package Manager)
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
187 if not sys.stdout.isatty():
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy, an...
peterjc authored
188 sys.exit(-1)
189 # We can ask the user
190 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
191
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
192
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
193 class install_biopython(install):
7db13b0 Updated to check for dependencies and print out warnings and to install ...
chapmanb authored
194 """Override the standard install to check for dependencies.
195
196 This will just run the normal install, and then print warning messages
197 if packages are missing.
b7761b6 Fixes to imported EUtils to get it working happily with Bio:
chapmanb authored
198
7db13b0 Updated to check for dependencies and print out warnings and to install ...
chapmanb authored
199 """
4e4c3aa @chapmanb Add support for single-version-externally-managed flag which pip asks fo...
chapmanb authored
200 # Adds support for the single-version-externally-managed flag
201 # which is present in setuptools but not distutils. pip requires it.
202 # In setuptools this forces installation the "old way" which we
203 # only support here, so we just make it a no-op.
204 user_options = install.user_options + [
205 ('single-version-externally-managed', None,
206 "used by system package builders to create 'flat' eggs"),
207 ]
208 boolean_options = install.boolean_options + [
209 'single-version-externally-managed',
210 ]
bfa8b25 @cbrueffer Add a blank line before and after functions (PEP8 E301).
cbrueffer authored
211
4e4c3aa @chapmanb Add support for single-version-externally-managed flag which pip asks fo...
chapmanb authored
212 def initialize_options(self):
213 install.initialize_options(self)
214 self.single_version_externally_managed = None
215
7db13b0 Updated to check for dependencies and print out warnings and to install ...
chapmanb authored
216 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
217 if check_dependencies_once():
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
218 # Run the normal install.
219 install.run(self)
7db13b0 Updated to check for dependencies and print out warnings and to install ...
chapmanb authored
220
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
221
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
222 class build_py_biopython(build_py):
223 def run(self):
a8ae40f now installs Martel and doesn't complain about it
jchang authored
224 if not check_dependencies_once():
225 return
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
226 # Add software that requires Numpy to be installed.
a8ae40f now installs Martel and doesn't complain about it
jchang authored
227 if is_Numpy_installed():
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
228 self.packages.extend(NUMPY_PACKAGES)
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
229 build_py.run(self)
fc90717 Whew, final thing to add! Added code for displaying pretty pictures usin...
chapmanb authored
230
94b412a See bug #2375. Copy data files to the build directory, so the tests run
mdehoon authored
231
a8ae40f now installs Martel and doesn't complain about it
jchang authored
232 class build_ext_biopython(build_ext):
233 def run(self):
234 if not check_dependencies_once():
235 return
236 build_ext.run(self)
237
a151e5c workaround for bug in distutils that prevents one from compiling both C ...
grouse authored
238
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
239 class test_biopython(Command):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
240 """Run all of the tests for the package.
241
242 This is a automatic test run class to make distutils kind of act like
243 perl. With this you can do:
244
245 python setup.py build
246 python setup.py install
247 python setup.py test
b1c8597 @cbrueffer Trim EOL whitespace (PEP8 W291, W293), batch 3.
cbrueffer authored
248
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
249 """
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
250 description = "Automatically run the test suite for Biopython."
844496e @peterjc Removing the now redundant --no-gui argument for the test suite.
peterjc authored
251 user_options = []
1d16b65 The modification to setup.py gives the option of --no-gui for the comman...
lasher authored
252
253 def initialize_options(self):
844496e @peterjc Removing the now redundant --no-gui argument for the test suite.
peterjc authored
254 pass
1d16b65 The modification to setup.py gives the option of --no-gui for the comman...
lasher authored
255
256 def finalize_options(self):
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
257 pass
1d16b65 The modification to setup.py gives the option of --no-gui for the comman...
lasher authored
258
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
259 def run(self):
260 this_dir = os.getcwd()
261
262 # change to the test dir and run the tests
263 os.chdir("Tests")
b720e3d In Python 2.3.2, the current directory '' is not included in the path.
grouse authored
264 sys.path.insert(0, '')
b1c8597 @cbrueffer Trim EOL whitespace (PEP8 W291, W293), batch 3.
cbrueffer authored
265 import run_tests
844496e @peterjc Removing the now redundant --no-gui argument for the test suite.
peterjc authored
266 run_tests.main([])
b50486d Allow setup.py to be able to run tests with python setup.py test
chapmanb authored
267
268 # change back to the current directory
269 os.chdir(this_dir)
270
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
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
fd82a0a @cbrueffer Add blank lines where needed (PEP8 E302).
cbrueffer authored
279
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
280 def is_Numpy_installed():
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
281 if is_pypy():
282 return False
7452113 @peterjc Simplify the dependency checking code since we only care about NumPy, an...
peterjc authored
283 return bool(can_import("numpy"))
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
284
7db13b0 Updated to check for dependencies and print out warnings and to install ...
chapmanb authored
285 # --- set up the packages we are going to install
286 # standard biopython packages
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
287 PACKAGES = [
288 'Bio',
289 'Bio.Align',
32c4f4b @peterjc Adding wrapper from Cymon Cox for the MUSCLE alignment tool, with basic ...
peterjc authored
290 'Bio.Align.Applications',
1231257 @peterjc Include Bio.AlignIO in installation
peterjc authored
291 'Bio.AlignIO',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
292 'Bio.Alphabet',
293 'Bio.Application',
294 'Bio.Blast',
0cd0e9c Modified Files:
idoerg authored
295 'Bio.CAPS',
76ce5ca Added Compass parsing code contributed by James Casbon.
chapmanb authored
296 'Bio.Compass',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
297 'Bio.Crystal',
298 'Bio.Data',
299 'Bio.Emboss',
8521e25 Moving Bio/Entrez.py to Bio/Entrez/__init__.py.
mdehoon authored
300 'Bio.Entrez',
c23628e Now that Bio/ExPASy.py was replaced by Bio/ExPASy/__init__.py, we need t...
mdehoon authored
301 'Bio.ExPASy',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
302 'Bio.FSSP',
303 'Bio.GA',
304 'Bio.GA.Crossover',
305 'Bio.GA.Mutation',
306 'Bio.GA.Repair',
307 'Bio.GA.Selection',
308 'Bio.GenBank',
309 'Bio.Geo',
310 'Bio.Graphics',
cace008 @peterjc Initial check in of GenomeDiagram by Leighton Pritchard, converted for B...
peterjc authored
311 'Bio.Graphics.GenomeDiagram',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
312 'Bio.HMM',
313 'Bio.KEGG',
314 'Bio.KEGG.Compound',
315 'Bio.KEGG.Enzyme',
316 'Bio.KEGG.Map',
317 'Bio.Medline',
9deacf3 added Bio.Motif to setup.py
bartek authored
318 'Bio.Motif',
fc68931 @peterjc Need to install Bio.Motif.PArsers
peterjc authored
319 'Bio.Motif.Parsers',
594a86a @peterjc Include Bio.Motif.Applications module
peterjc authored
320 'Bio.Motif.Applications',
a4bf956 Renaming Bio.Motif to Bio.motifs; Copying the biopython 1.60 version of ...
mdehoon authored
321 'Bio.motifs',
322 'Bio.motifs.applications',
af84a3c @pgarland Add the new Bio.motifs.jaspar package to the list of packages to install
pgarland authored
323 'Bio.motifs.jaspar',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
324 'Bio.NeuralNetwork',
325 'Bio.NeuralNetwork.BackPropagation',
326 'Bio.NeuralNetwork.Gene',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
327 'Bio.Nexus',
7bcfbce Adding NMR files kindly contributed by Bob Bussell
chapmanb authored
328 'Bio.NMR',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
329 'Bio.Pathway',
330 'Bio.Pathway.Rep',
331 'Bio.PDB',
4f07b8a Added Bio.PopGen module by Tiago Antao.
mdehoon authored
332 'Bio.PopGen',
333 'Bio.PopGen.Async',
334 'Bio.PopGen.FDist',
335 'Bio.PopGen.GenePop',
96f01d5 2375: Activating SimCoal on Biopython setup
tiagoantao authored
336 'Bio.PopGen.SimCoal',
05f9ba2 Added Restriction enzyme package contributed by Frederic Sohm. This incl...
chapmanb authored
337 'Bio.Restriction',
338 'Bio.Restriction._Update',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
339 'Bio.SCOP',
b903d00 @bow Update setup.py to include SearchIO and its submodules
bow authored
340 'Bio.SearchIO',
16e2334 @bow Add Bio.SearchIO._model to setup.py
bow authored
341 'Bio.SearchIO._model',
b903d00 @bow Update setup.py to include SearchIO and its submodules
bow authored
342 'Bio.SearchIO.BlastIO',
343 'Bio.SearchIO.HmmerIO',
344 'Bio.SearchIO.ExonerateIO',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
345 'Bio.SeqIO',
346 'Bio.SeqUtils',
2214cae Added Sequencing directory to packages
chapmanb authored
347 'Bio.Sequencing',
42be9a8 Add Novoalign commandline submitted by Osvaldo Zagordi; Bug 2904
chapmanb authored
348 'Bio.Sequencing.Applications',
7738632 Added Bio.Statistics.
mdehoon authored
349 'Bio.Statistics',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
350 'Bio.SubsMat',
351 'Bio.SVDSuperimposer',
352 'Bio.SwissProt',
01ba2f2 @peterjc Basics for TogoWS REST API support
peterjc authored
353 'Bio.TogoWS',
eb394c0 @chapmanb Whoops. Revert setup.py to latest version
chapmanb authored
354 'Bio.Phylo',
b22304a @etal Phylo.Applications: Added a PhyML wrapper (Feature #3216)
etal authored
355 'Bio.Phylo.Applications',
9531507 @peterjc Must install new PAML module
peterjc authored
356 'Bio.Phylo.PAML',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
357 'Bio.UniGene',
946823d @peterjc Must install the new Bio.UniProt module
peterjc authored
358 'Bio.UniProt',
3a5d550 Adding Bio.Wise to the distribution
grouse authored
359 'Bio.Wise',
1a9bd6e @peterjc Make Bio._py3k module into a package (Bio/_py3k/__init__.py)
peterjc authored
360 'Bio._py3k',
d81c27e @peterjc Removed the Martel special case code (it should be safe to assume that M...
peterjc authored
361 #Other top level packages,
362 'BioSQL',
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
363 ]
364
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
365 # packages that require Numeric Python
366 NUMPY_PACKAGES = [
367 'Bio.Affy',
368 'Bio.Cluster',
379fbb7 Switched from the old Numerical Python to the new NumPy. Bio.KDTree is i...
mdehoon authored
369 'Bio.KDTree',
593e65e Added Affymetrix package from Harry Zuzan
chapmanb authored
370 ]
371
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
372 if os.name == 'java':
ae19435 @peterjc Fix from Kyle Ellrott to get setup.py to work on Jython 2.5.0 by not ins...
peterjc authored
373 # Jython doesn't support C extensions
374 EXTENSIONS = []
fdee559 @peterjc Hack setup.py to run under IronPython
peterjc authored
375 elif is_pypy() or is_ironpython():
2a26cee @peterjc Modify setup.py to work on PyPy 1.6 (and ignore micronumpy)
peterjc authored
376 # Skip C extensions for now
377 EXTENSIONS = []
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
378 else:
ae19435 @peterjc Fix from Kyle Ellrott to get setup.py to work on Jython 2.5.0 by not ins...
peterjc authored
379 EXTENSIONS = [
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
380 Extension('Bio.cpairwise2',
c21a741 Put csupport in the pairwise2 module, as currently it is not used anywhe...
Michiel de Hoon authored
381 ['Bio/cpairwise2module.c'],
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
382 ),
383 Extension('Bio.trie',
384 ['Bio/triemodule.c',
385 'Bio/trie.c'],
386 include_dirs=["Bio"]
387 ),
2800c6c *** empty log message ***
idoerg authored
388 Extension('Bio.Nexus.cnexus',
c2c11a9 Biopython now works with Python >= 2.3
idoerg authored
389 ['Bio/Nexus/cnexus.c']
390 ),
fdcb82e added code so that it now checks for dependencies before biopython is
jchang authored
391 ]
392
48d1716 @peterjc Seems must define list of extensions earlier for them to be installed on...
peterjc authored
393 #Add extensions that requires NumPy to build
394 if is_Numpy_installed():
395 import numpy
396 numpy_include_dir = numpy.get_include()
397 EXTENSIONS.append(
398 Extension('Bio.Cluster.cluster',
399 ['Bio/Cluster/clustermodule.c',
400 'Bio/Cluster/cluster.c'],
401 include_dirs=[numpy_include_dir],
402 ))
403 EXTENSIONS.append(
404 Extension('Bio.KDTree._CKDTree',
405 ["Bio/KDTree/KDTree.c",
406 "Bio/KDTree/KDTreemodule.c"],
407 include_dirs=[numpy_include_dir],
408 ))
409 EXTENSIONS.append(
410 Extension('Bio.Motif._pwm',
411 ["Bio/Motif/_pwm.c"],
412 include_dirs=[numpy_include_dir],
413 ))
a4bf956 Renaming Bio.Motif to Bio.motifs; Copying the biopython 1.60 version of ...
mdehoon authored
414 EXTENSIONS.append(
415 Extension('Bio.motifs._pwm',
416 ["Bio/motifs/_pwm.c"],
417 include_dirs=[numpy_include_dir],
418 ))
48d1716 @peterjc Seems must define list of extensions earlier for them to be installed on...
peterjc authored
419
ae19435 @peterjc Fix from Kyle Ellrott to get setup.py to work on Jython 2.5.0 by not ins...
peterjc authored
420
839c345 @peterjc Adding Bio.__version__ and using this in setup.py automatically. The fi...
peterjc authored
421 #We now define the Biopython version number in Bio/__init__.py
422 #Here we can't use "import Bio" then "Bio.__version__" as that would
423 #tell us the version of Biopython already installed (if any).
424 __version__ = "Undefined"
425 for line in open('Bio/__init__.py'):
426 if (line.startswith('__version__')):
427 exec(line.strip())
428
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
429 #Simple trick to use the 2to3 converted source under Python 3,
430 #change the current directory before/after running setup.
431 #Note as a side effect there will be a build folder underneath
432 #the python3_source folder.
433 old_path = os.getcwd()
434 try:
435 src_path = python3_source
436 except NameError:
437 src_path = os.path.dirname(os.path.abspath(sys.argv[0]))
438 os.chdir(src_path)
439 sys.path.insert(0, src_path)
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
440
441 setup_args = {
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
442 "name": 'biopython',
443 "version": __version__,
444 "author": 'The Biopython Consortium',
445 "author_email": 'biopython@biopython.org',
446 "url": 'http://www.biopython.org/',
447 "description": 'Freely available tools for computational molecular biology.',
448 "download_url": 'http://biopython.org/DIST/',
449 "cmdclass": {
450 "install": install_biopython,
451 "build_py": build_py_biopython,
452 "build_ext": build_ext_biopython,
453 "test": test_biopython,
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
454 },
7585a62 @cbrueffer Some PEP8 cleanup.
cbrueffer authored
455 "packages": PACKAGES,
456 "ext_modules": EXTENSIONS,
457 "package_data": {
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
458 'Bio.Entrez': ['DTDs/*.dtd', 'DTDs/*.ent', 'DTDs/*.mod'],
459 'Bio.PopGen': ['SimCoal/data/*.par'],
460 },
461 }
462
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
463 try:
78b965f @peterjc Only pass install_requires to setup with setuptools, not distutils
peterjc authored
464 setup(**setup_args)
1eeed11 @peterjc Call 2to3 from setup.py on Python 3 (like NumPy)
peterjc authored
465 finally:
466 del sys.path[0]
467 os.chdir(old_path)
Something went wrong with that request. Please try again.