tools: Not detecting the type of python files. Assuming python3.

- Also now not using any tools that depend on python2.
- Simplifies installation.
- Personally not using python2.
- Eris is not used widely enough to justify supporting python2 files.
- The way of determining whether a source file was python2 or python3 was
  not very good.
This commit is contained in:
Andrew Hamilton 2019-01-21 11:46:51 +10:00
parent 7d412ec8f1
commit 85a5840cff
17 changed files with 53 additions and 140 deletions

View file

@ -1,4 +0,0 @@
def hi():
print "hi"

View file

@ -1,19 +0,0 @@
Test results:
No issues identified.
Code scanned:
Total lines of code: 2
Total lines skipped (#nosec): 0
Run metrics:
Total issues (by severity):
Undefined: 0
Low: 0
Medium: 0
High: 0
Total issues (by confidence):
Undefined: 0
Low: 0
Medium: 0
High: 0
Files skipped (0):

View file

@ -1 +0,0 @@
input/hi.py:4: error: Missing parentheses in call to 'print'. Did you mean print("hi")?

View file

@ -1,12 +0,0 @@
Help on module hi:
NAME
hi
FILE
input/hi.py
FUNCTIONS
hi()

View file

@ -1 +0,0 @@
No config file found, using default configuration

View file

@ -1,4 +0,0 @@
(B
(B> def hi():(B
(B> print "hi"(B

View file

@ -1 +0,0 @@
(Bdef(B (Bhi(B():(B

View file

@ -1 +0,0 @@
("3:0: 'hi'", 1)

View file

@ -1,4 +0,0 @@
Name File
---- ----
m __main__ ./input/hi.py

View file

@ -1 +0,0 @@
No tests.

View file

@ -81,7 +81,7 @@ class ToolsTestCase(unittest.TestCase):
def test_contents(self):
self._test_tool(tools.contents, [("hi3.py", tools.Status.normal)])
HI_OK = [("hi3.py", tools.Status.ok), ("hi.py", tools.Status.ok)]
HI_OK = [("hi3.py", tools.Status.ok)]
def test_python_syntax(self):
self._test_tool(tools.python_syntax, self.HI_OK)
@ -94,8 +94,7 @@ class ToolsTestCase(unittest.TestCase):
# ("hi3_test.py", tools.Status.ok),
# ("test_foo.py", tools.Status.ok)])
HI_NORMAL = [("hi3.py", tools.Status.normal),
("hi.py", tools.Status.normal)]
HI_NORMAL = [("hi3.py", tools.Status.normal)]
def test_pydoc(self):
# FIX: This is failing inside AppImages.
@ -103,8 +102,7 @@ class ToolsTestCase(unittest.TestCase):
self._test_tool(tools.pydoc, self.HI_NORMAL)
def test_mypy(self):
self._test_tool(tools.mypy, [("hi3.py", tools.Status.ok),
("hi.py", tools.Status.problem)])
self._test_tool(tools.mypy, self.HI_OK)
def test_python_coverage(self):
self._test_tool(tools.python_coverage, self.HI_NORMAL)
@ -128,8 +126,7 @@ class ToolsTestCase(unittest.TestCase):
self._test_tool(tools.python_mccabe, self.HI_OK)
def test_bandit(self):
self._test_tool(tools.bandit, [("hi3.py", tools.Status.ok),
("hi.py", tools.Status.ok)])
self._test_tool(tools.bandit, self.HI_OK)
# FIX: Make the golden-file deterministic
# def test_pydisasm(self):