From 7d412ec8f12bb0a164646bec90f2d3b949bc7836 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Thu, 27 Dec 2018 14:47:39 +1000 Subject: [PATCH] Changes for Ubuntu 18.10. --- README.md | 8 +++--- eris/tools.py | 25 ++++++++++++------- eris/tools.toml | 10 ++++---- make-readme.py | 2 +- setup.py | 2 +- .../results/objdump_disassemble-Mcrt1_o | 2 +- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index e512c0c..f9d7339 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Eris maintains an up-to-date set of reports for every file in a codebase. ### Installation -(Tested in Ubuntu 18.04) +(Tested in Ubuntu 18.10) # git clone https://github.com/ahamilton/eris # cd eris @@ -26,7 +26,7 @@ then to run: Extensions(94) | Tools(61) ----------:| ----- .* | [contents](http://pygments.org/) • metadata • [git_blame](https://git-scm.com/docs/git-blame) • [git_log](https://git-scm.com/docs/git-log) -.py | [python_syntax](https://en.wikipedia.org/wiki/Python_syntax_and_semantics) • [python_unittests](https://docs.python.org/3/library/unittest.html) • [pydoc](https://docs.python.org/3/library/pydoc.html) • [mypy](package) • [python_coverage](http://nedbatchelder.com/code/coverage/) • [pycodestyle](https://pypi.python.org/pypi/pycodestyle) • [pydocstyle](http://pydocstyle.readthedocs.org/) • [pyflakes](https://launchpad.net/pyflakes) • [pylint](http://www.pylint.org/) • [python_gut](https://github.com/ahamilton/eris/blob/master/gut.py) • [python_modulefinder](https://docs.python.org/3/library/modulefinder.html) • [dis](https://docs.python.org/3/library/dis.html) • [python_mccabe](https://github.com/flintwork/mccabe) • [bandit](https://wiki.openstack.org/wiki/Security/Projects/Bandit) +.py | [python_syntax](https://en.wikipedia.org/wiki/Python_syntax_and_semantics) • [python_unittests](https://docs.python.org/3/library/unittest.html) • [pydoc](https://docs.python.org/3/library/pydoc.html) • [mypy](http://mypy-lang.org/) • [python_coverage](https://coverage.readthedocs.io/) • [pycodestyle](http://pycodestyle.pycqa.org/en/latest/) • [pydocstyle](http://pycodestyle.pycqa.org/en/latest/) • [pyflakes](https://pypi.org/project/pyflakes/) • [pylint](https://www.pylint.org/) • [python_gut](https://github.com/ahamilton/eris/blob/master/gut.py) • [python_modulefinder](https://docs.python.org/3/library/modulefinder.html) • [dis](https://docs.python.org/3/library/dis.html) • [python_mccabe](https://pypi.org/project/mccabe/) • [bandit](https://pypi.org/project/bandit/) .pl .pm .t | [perl_syntax](https://en.wikipedia.org/wiki/Perl) • [perldoc](http://perldoc.perl.org/) • [perltidy](http://perltidy.sourceforge.net/) .pod .pod6 | [perldoc](http://perldoc.perl.org/) .java | [uncrustify](https://github.com/uncrustify/uncrustify) @@ -37,8 +37,8 @@ Extensions(94) | Tools(61) .js | [js_syntax](http://nodejs.org/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html) .php | [php7_syntax](https://en.wikipedia.org/wiki/PHP) .go | [gofmt](https://golang.org) • [go_vet](https://golang.org) • [golint](https://github.com/golang/lint) • [godoc](http://golang.org/x/tools) -.bash .sh .dash .ksh | [shellcheck](http://hackage.haskell.org/package/ShellCheck) -.pdf | [pdf2txt](http://www.unixuser.org/~euske/python/pdfminer/) +.bash .sh .dash .ksh | [shellcheck](https://www.shellcheck.net/) +.pdf | [pdf2txt](https://euske.github.io/pdfminer/) .html .htm | [html_syntax](http://www.html-tidy.org/) • [tidy](http://www.html-tidy.org/) • [html2text](http://www.mbayer.de/html2text/) • [pandoc](https://pandoc.org/) .yaml .yml | [yamllint](https://github.com/adrienverge/yamllint) .md .epub .docx .odt .rst | [pandoc](https://pandoc.org/) diff --git a/eris/tools.py b/eris/tools.py index df4b698..995e708 100644 --- a/eris/tools.py +++ b/eris/tools.py @@ -22,7 +22,6 @@ import tempfile import time import traceback -import PIL.Image import pygments import pygments.lexers import pygments.styles @@ -321,7 +320,7 @@ def pydoc(path): return status, fill3.Text(_fix_input(stdout)) -@deps(deps={"pip3/mypy"}, url="mypy", executables={"mypy"}) +@deps(deps={"pip3/mypy"}, url="http://mypy-lang.org/", executables={"mypy"}) def mypy(path): stdout, stderr, returncode = _do_command( [PYTHON_EXECUTABLE, "-m", "mypy", path], timeout=TIMEOUT) @@ -336,7 +335,8 @@ def _colorize_coverage_report(text): for line in text.splitlines(keepends=True)]) -@deps(deps={"pip/coverage", "pip3/coverage"}, url="python3-coverage") +@deps(deps={"pip/coverage", "pip3/coverage"}, + url="https://coverage.readthedocs.io/") def python_coverage(path): # FIX: Also use test_*.py files. test_path = path[:-(len(".py"))] + "_test.py" @@ -361,22 +361,25 @@ def python_coverage(path): "No corresponding test file: " + os.path.normpath(test_path)) -@deps(deps={"pip/pycodestyle", "pip3/pycodestyle"}, url="python-pycodestyle") +@deps(deps={"pip/pycodestyle", "pip3/pycodestyle"}, + url="http://pycodestyle.pycqa.org/en/latest/") def pycodestyle(path): return _run_command([_python_version(path), "-m", "pycodestyle", path]) -@deps(deps={"pip/pydocstyle", "pip3/pydocstyle"}, url="python3-pydocstyle") +@deps(deps={"pip/pydocstyle", "pip3/pydocstyle"}, + url="http://pycodestyle.pycqa.org/en/latest/") def pydocstyle(path): return _run_command([_python_version(path), "-m", "pydocstyle", path]) -@deps(deps={"pip/pyflakes", "pip3/pyflakes"}, url="pyflakes") +@deps(deps={"pip/pyflakes", "pip3/pyflakes"}, + url="https://pypi.org/project/pyflakes/") def pyflakes(path): return _run_command([_python_version(path), "-m", "pyflakes", path]) -@deps(deps={"pip/pylint", "pip3/pylint"}, url="pylint3") +@deps(deps={"pip/pylint", "pip3/pylint"}, url="https://www.pylint.org/") def pylint(path): return _run_command([_python_version(path), "-m", "pylint", "--errors-only", path]) @@ -416,7 +419,8 @@ def _colorize_mccabe(text, python_version): for line in text.splitlines(keepends=True)]) -@deps(deps={"pip/mccabe", "pip3/mccabe"}, url="python3-mccabe") +@deps(deps={"pip/mccabe", "pip3/mccabe"}, + url="https://pypi.org/project/mccabe/") def python_mccabe(path): python_version = _python_version(path) stdout, *rest = _do_command([python_version, "-m", "mccabe", path]) @@ -436,7 +440,8 @@ def python_mccabe(path): # Status.not_applicable) -@deps(deps={"pip/bandit", "pip3/bandit"}, url="python3-bandit") +@deps(deps={"pip/bandit", "pip3/bandit"}, + url="https://pypi.org/project/bandit/") def bandit(path): python_version = _python_version(path) stdout, stderr, returncode = _do_command( @@ -523,6 +528,7 @@ MAX_IMAGE_SIZE = 200 def _resize_image(image, new_width): + import PIL.Image # Here to avoid 'Segmentation Fault' in install-tools scale = new_width / image.width return image.resize((int(image.width * scale), int(image.height * scale)), PIL.Image.ANTIALIAS) @@ -530,6 +536,7 @@ def _resize_image(image, new_width): @deps(deps={"pip3/pillow"}, url="python3-pil") def pil(path): + import PIL.Image with open(path, "rb") as image_file: with PIL.Image.open(image_file).convert("RGB") as image: if image.width > MAX_IMAGE_SIZE: diff --git a/eris/tools.toml b/eris/tools.toml index a96409a..0a18e9a 100644 --- a/eris/tools.toml +++ b/eris/tools.toml @@ -137,8 +137,8 @@ tools_for_extensions = [ [pdf2txt] dependencies = ["pip/pdfminer"] - url = "python-pdfminer" - command = "pdf2txt" + url = "https://euske.github.io/pdfminer/" + command = "pdf2txt.py" success_status = "normal" [html2text] @@ -152,12 +152,12 @@ tools_for_extensions = [ success_status = "normal" [c_syntax_gcc] - dependencies = ["gcc", "g++-6"] + dependencies = ["gcc", "g++"] url = "https://gcc.gnu.org/" command = "gcc -fsyntax-only" [cpp_syntax_gcc] - dependencies = ["gcc", "g++-6"] + dependencies = ["gcc", "g++"] url = "https://gcc.gnu.org/" command = "gcc -fsyntax-only" @@ -183,7 +183,7 @@ tools_for_extensions = [ [clang_format] dependencies = ["clang-format"] url = "https://clang.llvm.org/docs/ClangFormat.html" - command = "clang-format-6.0" + command = "clang-format" success_status = "normal" [ruby_syntax] diff --git a/make-readme.py b/make-readme.py index 204614c..40edb00 100755 --- a/make-readme.py +++ b/make-readme.py @@ -30,7 +30,7 @@ Eris maintains an up-to-date set of reports for every file in a codebase. ### Installation -(Tested in Ubuntu 18.04) +(Tested in Ubuntu 18.10) # git clone https://github.com/ahamilton/eris # cd eris diff --git a/setup.py b/setup.py index f943597..f40fac1 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ except ImportError: setup(name="eris", - version="17.06", + version="18.12", description=("Eris maintains an up-to-date set of reports for every" " file in a codebase."), url="https://github.com/ahamilton/eris", diff --git a/tests/golden-files/results/objdump_disassemble-Mcrt1_o b/tests/golden-files/results/objdump_disassemble-Mcrt1_o index 2968436..cfbb89f 100644 --- a/tests/golden-files/results/objdump_disassemble-Mcrt1_o +++ b/tests/golden-files/results/objdump_disassemble-Mcrt1_o @@ -2,4 +2,4 @@ ./input/Mcrt1.o: file format elf32-i386 objdump: ./input/Mcrt1.o: not a dynamic object -objdump: ./input/Mcrt1.o: Invalid operation \ No newline at end of file +objdump: ./input/Mcrt1.o: invalid operation \ No newline at end of file