Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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