Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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