Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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