Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Jan 4, 2015
  1. @peterjc

    PEP8 white space in Tests

    peterjc committed
    autopep8 --select E225,E226,E261,E302 -i Tests/*.py
Commits on Nov 12, 2014
  1. @carlosp420 @peterjc

    PEP8 fixes, various test files

    carlosp420 committed with peterjc
Commits on Nov 11, 2014
  1. @peterjc
Commits on Oct 27, 2014
  1. @peterjc

    autopep8 E265 - Format block comments.

    peterjc committed
    $ autopep8 --version
    autopep8 1.0.4
    $ autopep8 -r -i --select E265 ...
Commits on Nov 3, 2013
  1. @peterjc

    Use the new Bio._py3k builtins

    peterjc committed
Commits on Sep 28, 2013
  1. @peterjc
Commits on Sep 9, 2013
  1. @peterjc

    Add: from __future__ import print_statement

    peterjc committed
    This is currently redundant as we are carefully only
    using this simple print style which is both a print
    statement (with redundant brackets) under Python 2
    and a print function under Python 3:
    However, adding the __future__ import to any file using
    a print should catch any accidental usage of the print
    statement in the near future (even if not testing under
    Python 3 where it would be spotted since we've turned
    off the print fixer during the 2to3 conversion).
    This was automated as follows:
    MAGIC = "from __future__ import print_function"
    import os
    import sys
    def should_mark(filename):
        handle = open(filename, "rU")
        lines = [line.strip() for line in handle if "print" in line]
        if MAGIC in lines:
            #print("%s is marked" % filename)
            return False
        if "print" in lines:
            print("TODO - %s has a naked print" % filename)
        for line in lines:
            if "print" not in line:
            line = line.strip(" #")
            if line.startswith(">>>") or line.startswith("..."):
                line = line[3:].strip()
            if line.startswith("print ") or line.startswith("print("):
                return True
        print("%s has no print statements" % filename)
        return False
    def mark_file(filename, marker=MAGIC):
        with open(filename, "rU") as h:
            lines = list(h.readlines())
        with open(filename, "w") as h:
            while (lines[0].startswith("#") or not lines[0].strip()):
            if lines[0].startswith('"""') or lines[0].startswith('r"""'):
                # Module docstring
                if lines[0].strip() == '"""':
                    print("Non-PEP8 module docstring in %s" % filename)
                if lines[0].rstrip().endswith('"""') and lines[0].strip() != '"""':
                    # One liner
                    print("One line module docstring in %s" % filename)
                    while not lines[0].strip().endswith('"""'):
            while (lines[0].startswith("#") or not lines[0].strip()):
            h.write(marker + "\n\n")
    for dirpath, dirnames, filenames in os.walk("."):
        if dirpath.startswith("./build/"):
        for f in filenames:
            if not f.endswith(".py"):
            f = os.path.join(dirpath, f)
            if should_mark(f):
                print("Marking %s" % f)
Commits on Sep 7, 2013
  1. @peterjc
Commits on Aug 30, 2013
  1. @superbobry

    Partially migrated to print-function-like syntax

    superbobry committed
      For now we only handle the 'print' statement with a single argument,
      i. e.:
          print ... -> print(...)
      Migration was performed using a 2to3 fixer class:
          from lib2to3 import fixer_base, patcomp
          from lib2to3.fixer_util import Name, Call
          parend_expr = patcomp.compile_pattern(
              """atom< '(' [atom|term|testlist_gexp|STRING|NAME] ')' >""")
          class FixSinglePrint(fixer_base.BaseFix):
              PATTERN = "print_stmt"
              BM_compatible = True
              def transform(self, node, results):
                  assert results
                  assert node.children[0] == Name(u"print")
                  args = node.children[1:]
                  if len(args) != 1 or parend_expr.match(args[0]):
                      # We only fix 'print' statements which have _exactly_ one
                      # non-parenthesized argument.
                  l_args = [arg.clone() for arg in args]
                  l_args[0].prefix = u""
                  n_stmt = Call(Name(u"print"), l_args)
                  n_stmt.prefix = node.prefix
                  return n_stmt
Commits on Dec 5, 2012
  1. @cbrueffer @peterjc
Commits on Dec 4, 2012
  1. @cbrueffer
  2. @cbrueffer @peterjc
Commits on Jan 26, 2011
  1. @peterjc

    Use dict rather than list of tuples in Bio.SCOP.Cla.Record class (Bug…

    peterjc committed
    … 3109, based on fix from Jeffrey Finkelstein)
  2. @peterjc
Commits on Jan 25, 2010
  1. Cleaning up the SCOP tests

    mdehoon committed
Commits on Nov 11, 2009
  1. @peterjc

    No code changes. Removing white space before ':' character to match P…

    peterjc committed
    …EP8. Added a few missing license statements too.
Commits on Feb 9, 2009
  1. Simplifying these tests.

    mdehoon committed
Commits on Feb 4, 2009
  1. Don't rely on a run_tests function; run print-and-compare tests autom…

    mdehoon committed
    when importing a module. Also, removing run_tests functions where they're not
    being used.
Commits on Dec 11, 2007
  1. @peterjc
Commits on Feb 15, 2005
Commits on May 10, 2004
  1. Integrate SCOP unit tests

    gec committed
Something went wrong with that request. Please try again.