Skip to content

Commit

Permalink
Removed the Martel special case code (it should be safe to assume tha…
Browse files Browse the repository at this point in the history
…t Martel has not been distributed separately from Biopython from some years now)
  • Loading branch information
peterc committed Sep 24, 2008
1 parent 1283e42 commit d81c27e
Showing 1 changed file with 3 additions and 60 deletions.
63 changes: 3 additions & 60 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ def check_dependencies():
# - is packaged required, boolean
# - package website, string
dependencies = [
#mxTextTools is only used by Martel and other deprecated code.
#We therefore won't worry about if it is installed or not.
#("mxTextTools", is_mxTextTools_installed, 0,
# "http://www.egenix.com/files/python/eGenix-mx-Extensions.html"),
("Numerical Python (NumPy)", is_Numpy_installed, 0,
"http://numpy.scipy.org/"),
]
Expand Down Expand Up @@ -134,10 +130,6 @@ class build_py_biopython(build_py):
def run(self):
if not check_dependencies_once():
return
# Check to see if Martel is installed. If not, then install
# it automatically.
if not is_Martel_installed():
self.packages.append("Martel")
# Add software that requires Numpy to be installed.
if is_Numpy_installed():
self.packages.extend(NUMPY_PACKAGES)
Expand Down Expand Up @@ -235,54 +227,6 @@ def can_import(module_name):
return None
raise AssertionError, "how did I get here?"

def is_Martel_installed():
old_path = sys.path[:]

# First, check the version of the Martel that's bundled with
# Biopython.
sys.path.insert(0, '') # Make sure I'm importing the current one.
m = can_import("Martel")
sys.path = old_path
if m:
bundled_martel_version = m.__version__
del sys.modules["Martel"] # Unload the bundled version of Martel.
else:
#We won't be able to import the bundled version of Martel if an
#external dependency like mxTextTools is missing.
#In this case, we can't compare versions to any pre-installed Martel
#(even if that could be imported).
bundled_martel_version = None

# Now try and import a Martel that's not bundled with Biopython.
# To do that, I need to delete all the references to the current
# path from sys.path.
i = 0
while i < len(sys.path):
if sys.path[i] in ['', '.', os.getcwd()]:
del sys.path[i]
else:
i += 1
m = can_import("Martel")
sys.path = old_path
if m:
old_martel_version = m.__version__
else:
#Either there is no pre-installed copy of Martel, or if there is
#it cannot be imported (e.g. missing a dependency like mxTextTools).
old_martel_version = None

installed = 0
# If the bundled one is the older, then ignore it
if old_martel_version and bundled_martel_version and \
bundled_martel_version < old_martel_version:
installed = 1
return installed

def is_mxTextTools_installed():
if can_import("TextTools"):
return 1
return can_import("mx.TextTools")

def is_Numpy_installed():
return can_import("numpy")

Expand Down Expand Up @@ -369,6 +313,9 @@ def is_Numpy_installed():
'Bio.writers.SeqRecord',
'Bio.Wise',
'Bio.WWW',
#Other top level packages,
'BioSQL',
'Martel', #Deprecated as of Biopython 1.49
]

# packages that require Numeric Python
Expand Down Expand Up @@ -465,10 +412,6 @@ def run (self):
outfile = dst
self.outfiles.append(outfile)


# Install BioSQL.
PACKAGES.append("BioSQL")

setup(
name='biopython',
version='1.48',
Expand Down

0 comments on commit d81c27e

Please sign in to comment.