Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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