diff --git a/.travis.yml b/.travis.yml index 78475f0d6..0068e208a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ sudo: required services: - docker python: +- '3.5' - '3.6' install: - pip install sphinx mypy diff --git a/bugzoo/core/fileline.py b/bugzoo/core/fileline.py index ae0726fe4..90abe8bfd 100644 --- a/bugzoo/core/fileline.py +++ b/bugzoo/core/fileline.py @@ -15,7 +15,7 @@ def compactify(d: Dict['FileLine', Any]) -> Dict[str, Dict[int, Any]]: assert isinstance(d, dict) assert all(isinstance(x, FileLine) for x in d) - out: Dict[str, Dict[int, Any]] = {} + out = {} # type: Dict[str, Dict[int, Any]] for (line, val) in d.items(): if not line.filename in out: out[line.filename] = {} @@ -24,7 +24,7 @@ def compactify(d: Dict['FileLine', Any]) -> Dict[str, Dict[int, Any]]: @staticmethod def decompactify(d: Dict[str, Dict[int, Any]]) -> 'Dict[FileLine, Any]': - lines: Dict['FileLine', Any] = {} + lines = {} # type: Dict['FileLine', Any] for fn in d: for num in d[fn]: lines[FileLine(fn, num)] = d[fn][num] @@ -82,7 +82,7 @@ def from_list(lst: List[FileLine]) -> 'FileLineSet': @staticmethod def from_iter(itr: Iterable[FileLine]) -> 'FileLineSet': - d: Dict[str, Set[int]] = {} + d = {} # type: Dict[str, Set[int]] for line in itr: if not line.filename in d: d[line.filename] = set() @@ -90,8 +90,8 @@ def from_iter(itr: Iterable[FileLine]) -> 'FileLineSet': return FileLineSet(d) def __init__(self, contents: Dict[str, Set[int]]) -> None: - self.__contents: Dict[str, FrozenSet[int]] = \ - {fn: frozenset(line_nums) for (fn, line_nums) in contents.items()} + self.__contents = \ + {fn: frozenset(line_nums) for (fn, line_nums) in contents.items()} # type: Dict[str, FrozenSet[int]] def __iter__(self) -> Iterator[FileLine]: """ @@ -172,7 +172,7 @@ def restricted_to_files(self, filenames: List[str]) -> 'FileLineSet': any one of the given files. (I.e., returns the intersection of this set and the set of all lines from a given set of files.) """ - restricted: Dict[str, Set[int]] = {} + restricted = {} # type: Dict[str, Set[int]] for fn in filenames: restricted[fn] = set(self.__contents[fn]) return FileLineSet(restricted) diff --git a/bugzoo/core/patch.py b/bugzoo/core/patch.py index d54c5b9ce..dcb30d5f8 100644 --- a/bugzoo/core/patch.py +++ b/bugzoo/core/patch.py @@ -79,7 +79,7 @@ def _read_next(cls, lines: List[str]) -> 'Hunk': last_insertion_at = old_start_at - hunk_lines: List[HunkLine] = [] + hunk_lines = [] # type: List[HunkLine] while True: # discarding the previous line ensures that we only consume lines # from the line buffer that belong to the hunk diff --git a/bugzoo/core/spectra.py b/bugzoo/core/spectra.py index 9f2dadebd..3880b96bd 100644 --- a/bugzoo/core/spectra.py +++ b/bugzoo/core/spectra.py @@ -59,8 +59,8 @@ class Spectra(object): def from_coverage(coverage: TestSuiteCoverage) -> 'Spectra': # tally the number of times that each line is touched by a passing # or failing test - tally_failing: Dict[FileLine, int] = {} - tally_passing: Dict[FileLine, int] = {} + tally_failing = {} # type: Dict[FileLine, int] + tally_passing = {} # type: Dict[FileLine, int] for test in coverage.passing: for line in coverage[test].lines: diff --git a/bugzoo/server/__init__.py b/bugzoo/server/__init__.py index 2560d3a75..18253158e 100644 --- a/bugzoo/server/__init__.py +++ b/bugzoo/server/__init__.py @@ -4,7 +4,7 @@ from bugzoo.server.daemon import Daemon from bugzoo.server.code import ErrorCode -daemon: Daemon = None +daemon = None # type: Daemon app = flask.Flask(__name__) @@ -18,7 +18,7 @@ def list_bugs(): @app.route('/bugs/', methods=['GET']) def show_bug(uid: str): - jsn: Dict[Any, Any] = {} + jsn = {} # type: Dict[Any, Any] try: bug = daemon.bugs[uid] jsn = bug.to_dict() diff --git a/bugzoo/testing/base.py b/bugzoo/testing/base.py index 5efc2e9f2..2b72befa9 100644 --- a/bugzoo/testing/base.py +++ b/bugzoo/testing/base.py @@ -113,8 +113,8 @@ def from_dict(yml: dict) -> 'TestSuite': raise Exception("unexpected test harness type: {}".format(typ)) def __init__(self, tests: List[TestCase]) -> None: - self.__tests: Dict[str, TestCase] = \ - {test.name: test for test in tests} + self.__tests = \ + {test.name: test for test in tests} # type: Dict[str, TestCase] def __getitem__(self, name: str) -> TestCase: """ diff --git a/bugzoo/testing/simple.py b/bugzoo/testing/simple.py index c93b9641a..a49d5e3c0 100644 --- a/bugzoo/testing/simple.py +++ b/bugzoo/testing/simple.py @@ -87,8 +87,8 @@ def __init__(self, super().__init__(command, context, time_limit, tests) # extract the passing and failing test cases - self.__passing: List[TestCase] = [] - self.__failing: List[TestCase] = [] + self.__passing = [] # type: List[TestCase] + self.__failing = [] # type: List[TestCase] for t in self.tests: if t.name.startswith('p'): diff --git a/bugzoo/version.py b/bugzoo/version.py index f593cd5bd..4c354e070 100644 --- a/bugzoo/version.py +++ b/bugzoo/version.py @@ -1 +1 @@ -__version__ = '2.0.4' +__version__ = '2.0.5'