Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some PEP8 cleanup.

  • Loading branch information...
commit 7585a6211d06c820debcdf5a804b517f6e59eaf4 1 parent 514eb8f
@cbrueffer cbrueffer authored
Showing with 34 additions and 34 deletions.
  1. +8 −8 do2to3.py
  2. +26 −26 setup.py
View
16 do2to3.py
@@ -47,7 +47,7 @@ def run2to3(filenames):
if e != 0:
sys.stderr = stderr
sys.stderr.write(handle.getvalue())
- os.remove(filename) #Don't want a half edited file!
+ os.remove(filename) # Don't want a half edited file!
raise RuntimeError("Error %i from 2to3 on %s"
% (e, filename))
#And again for any doctests,
@@ -55,13 +55,13 @@ def run2to3(filenames):
if e != 0:
sys.stderr = stderr
sys.stderr.write(handle.getvalue())
- os.remove(filename) #Don't want a half edited file!
+ os.remove(filename) # Don't want a half edited file!
raise RuntimeError("Error %i from 2to3 (doctests) on %s"
% (e, filename))
except KeyboardInterrupt:
sys.stderr = stderr
sys.stderr.write("Interrupted during %s\n" % filename)
- os.remove(filename) #Don't want a half edited file!
+ os.remove(filename) # Don't want a half edited file!
for filename in filenames:
if os.path.isfile(filename):
#Don't want uncoverted files left behind:
@@ -116,7 +116,7 @@ def do_update(py2folder, py3folder, verbose=False):
#Ignore hidden files
continue
elif f.endswith("~") or f.endswith(".bak") \
- or f.endswith(".swp"):
+ or f.endswith(".swp"):
#Ignore backup files
continue
elif f.endswith(".pyc") or f.endswith("$py.class"):
@@ -131,17 +131,17 @@ def do_update(py2folder, py3folder, verbose=False):
#might able to use times down to microseconds (10^-6), but
#that doesn't work on this Windows machine I'm testing on.
if os.path.isfile(new) and\
- round(os.stat(new).st_mtime*1000) >= \
- round(os.stat(old).st_mtime*1000):
+ round(os.stat(new).st_mtime * 1000) >= \
+ round(os.stat(old).st_mtime * 1000):
if verbose:
print("Current: %s" % new)
continue
#Python, C code, data files, etc - copy with date stamp etc
shutil.copy2(old, new)
- assert abs(os.stat(old).st_mtime-os.stat(new).st_mtime)<0.0001, \
+ assert abs(os.stat(old).st_mtime - os.stat(new).st_mtime) < 0.0001, \
"Modified time not copied! %0.8f vs %0.8f, diff %f" \
% (os.stat(old).st_mtime, os.stat(new).st_mtime,
- abs(os.stat(old).st_mtime-os.stat(new).st_mtime))
+ abs(os.stat(old).st_mtime - os.stat(new).st_mtime))
if f.endswith(".py"):
#Also run 2to3 on it
to_convert.append(new)
View
52 setup.py
@@ -29,7 +29,7 @@
def is_pypy():
import platform
try:
- if platform.python_implementation()=='PyPy':
+ if platform.python_implementation() == 'PyPy':
return True
except AttributeError:
#New in Python 2.6, not in Jython yet either
@@ -75,7 +75,7 @@ def get_yes_or_no(question, default):
if "clean" in sys.argv:
if os.path.isdir(python3_source):
shutil.rmtree(python3_source)
- del python3_source #so we don't try to change to it below
+ del python3_source # so we don't try to change to it below
else:
if not os.path.isdir("build"):
os.mkdir("build")
@@ -116,7 +116,7 @@ def get_install_requires():
if not _SETUPTOOLS:
return []
# skip this with jython and pypy and ironpython
- if os.name=="java" or is_pypy() or is_ironpython():
+ if os.name == "java" or is_pypy() or is_ironpython():
return []
# check for easy_install and pip
is_automated = False
@@ -126,7 +126,7 @@ def get_install_requires():
except ValueError:
dist_dir_i = None
if dist_dir_i is not None:
- dist_dir = sys.argv[dist_dir_i+1]
+ dist_dir = sys.argv[dist_dir_i + 1]
if "egg-dist-tmp" in dist_dir:
is_automated = True
# pip -- calls from python directly with "-c"
@@ -157,12 +157,12 @@ def check_dependencies():
if is_Numpy_installed():
return True
- if os.name=='java':
- return True #NumPy is not avaliable for Jython (for now)
+ if os.name == 'java':
+ return True # NumPy is not avaliable for Jython (for now)
if is_pypy():
- return True #Full NumPy not available for PyPy (for now)
+ return True # Full NumPy not available for PyPy (for now)
if is_ironpython():
- return True #We're ignoring NumPy under IronPython (for now)
+ return True # We're ignoring NumPy under IronPython (for now)
print ("""
Numerical Python (NumPy) is not installed.
@@ -176,7 +176,7 @@ def check_dependencies():
""")
# exit automatically if running as part of some script
# (e.g. PyPM, ActiveState's Python Package Manager)
- if not sys.stdout.isatty() :
+ if not sys.stdout.isatty():
sys.exit(-1)
# We can ask the user
return get_yes_or_no("Do you want to continue this installation?", False)
@@ -358,7 +358,7 @@ def is_Numpy_installed():
'Bio.KDTree',
]
-if os.name == 'java' :
+if os.name == 'java':
# Jython doesn't support C extensions
EXTENSIONS = []
elif is_pypy() or is_ironpython():
@@ -375,7 +375,7 @@ def is_Numpy_installed():
['Bio/Nexus/cnexus.c']
),
]
-else :
+else:
EXTENSIONS = [
Extension('Bio.cpairwise2',
['Bio/cpairwise2module.c'],
@@ -440,22 +440,22 @@ def is_Numpy_installed():
sys.path.insert(0, src_path)
setup_args = {
- "name" : 'biopython',
- "version" : __version__,
- "author" : 'The Biopython Consortium',
- "author_email" : 'biopython@biopython.org',
- "url" : 'http://www.biopython.org/',
- "description" : 'Freely available tools for computational molecular biology.',
- "download_url" : 'http://biopython.org/DIST/',
- "cmdclass" : {
- "install" : install_biopython,
- "build_py" : build_py_biopython,
- "build_ext" : build_ext_biopython,
- "test" : test_biopython,
+ "name": 'biopython',
+ "version": __version__,
+ "author": 'The Biopython Consortium',
+ "author_email": 'biopython@biopython.org',
+ "url": 'http://www.biopython.org/',
+ "description": 'Freely available tools for computational molecular biology.',
+ "download_url": 'http://biopython.org/DIST/',
+ "cmdclass": {
+ "install": install_biopython,
+ "build_py": build_py_biopython,
+ "build_ext": build_ext_biopython,
+ "test": test_biopython,
},
- "packages" : PACKAGES,
- "ext_modules" : EXTENSIONS,
- "package_data" : {
+ "packages": PACKAGES,
+ "ext_modules": EXTENSIONS,
+ "package_data": {
'Bio.Entrez': ['DTDs/*.dtd', 'DTDs/*.ent', 'DTDs/*.mod'],
'Bio.PopGen': ['SimCoal/data/*.par'],
},
Please sign in to comment.
Something went wrong with that request. Please try again.