Giter VIP home page Giter VIP logo

ocular.py's People

Contributors

messense avatar michaeljoseph avatar schmittjoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ocular.py's Issues

TypeError: Can't convert 'builtin_function_or_method' object to str implicitly

I'm trying to call ocular as part of my Travis-CI build, but am getting a traceback:

$ ocular
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.3.5/bin/ocular", line 9, in <module>
    load_entry_point('scrutinizer-ocular==1.0.0', 'console_scripts', 'ocular')()
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/scrutinizer/ocular/app.py", line 11, in main
    App().run()
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/scrutinizer/ocular/app.py", line 22, in run
    repository_name = self.parse_repository_name(args.repository)
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/scrutinizer/ocular/app.py", line 61, in parse_repository_name
    return self.introspector.get_repository_name()
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/scrutinizer/ocular/repository_introspector.py", line 23, in get_repository_name
    output = check_output(['git', 'remote', '-v'], cwd=self.dir).decode('ascii')
  File "/opt/python/3.3.5/lib/python3.3/subprocess.py", line 576, in check_output
    with Popen(*popenargs, stdout=PIPE, **kwargs) as process:
  File "/opt/python/3.3.5/lib/python3.3/subprocess.py", line 819, in __init__
    restore_signals, start_new_session)
  File "/opt/python/3.3.5/lib/python3.3/subprocess.py", line 1386, in _execute_child
    restore_signals, start_new_session, preexec_fn)
TypeError: Can't convert 'builtin_function_or_method' object to str implicitly

Is something configured incorrectly?

ocular fails with ImportError

Traceback (most recent call last):
  File "/home/michael/.virtualenvs/changes/bin/ocular", line 9, in <module>
    load_entry_point('scrutinizer-ocular==1.0.1', 'console_scripts', 'ocular')()
  File "/home/michael/.virtualenvs/changes/local/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/michael/.virtualenvs/changes/local/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/home/michael/.virtualenvs/changes/local/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named scrutinizer.ocular.app

Tests fail on Ubuntu 14.04 LTS

$ python setup.py develop
$ python setup.py test
running test
running egg_info
writing dependency_links to scrutinizer_ocular.egg-info/dependency_links.txt
writing requirements to scrutinizer_ocular.egg-info/requires.txt
writing scrutinizer_ocular.egg-info/PKG-INFO
writing top-level names to scrutinizer_ocular.egg-info/top_level.txt
writing entry points to scrutinizer_ocular.egg-info/entry_points.txt
reading manifest file 'scrutinizer_ocular.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'scrutinizer_ocular.egg-info/SOURCES.txt'
running build_ext
========================================================================== test session starts ===========================================================================
platform linux2 -- Python 2.7.6 -- py-1.4.23 -- pytest-2.6.0
collected 7 items 

tests/test_coverage_parser.py F
tests/test_integration.py F
tests/test_repository_introspector.py sss
tests/test_uploader.py ..

================================================================================ FAILURES ================================================================================
_________________________________________________________________ CoverageParserTest.test_parse_coverage _________________________________________________________________

self = <tests.test_coverage_parser.CoverageParserTest testMethod=test_parse_coverage>

    def test_parse_coverage(self):
>       xml_data = self.parser.parse('tests/res/sample-coverage', None)

tests/test_coverage_parser.py:12: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scrutinizer/ocular/coverage_parser.py:14: in parse
    coverage_data.xml_report(outfile=xml_report_file.name)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/control.py:694: in xml_report
    return reporter.report(morfs, outfile=outfile)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/xmlreport.py:56: in report
    self.report_files(self.xml_file, morfs)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/report.py:84: in report_files
    report_fn(cu, self.coverage._analyze(cu))
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/control.py:592: in _analyze
    return Analysis(self, it)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/results.py:18: in __init__
    actual_filename, source = self.find_source(self.filename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <coverage.results.Analysis object at 0x7f27b7de9d10>, filename = '/home/johannes/workspace/ocular.py-dev/scrutinizer/__init__.py'

    def find_source(self, filename):
        """Find the source for `filename`.

            Returns two values: the actual filename, and the source.

            The source returned depends on which of these cases holds:

                * The filename seems to be a non-source file: returns None

                * The filename is a source file, and actually exists: returns None.

                * The filename is a source file, and is in a zip file or egg:
                  returns the source.

                * The filename is a source file, but couldn't be found: raises
                  `NoSource`.

            """
        source = None

        base, ext = os.path.splitext(filename)
        TRY_EXTS = {
            '.py':  ['.py', '.pyw'],
            '.pyw': ['.pyw'],
        }
        try_exts = TRY_EXTS.get(ext)
        if not try_exts:
            return filename, None

        for try_ext in try_exts:
            try_filename = base + try_ext
            if os.path.exists(try_filename):
                return try_filename, None
            source = self.coverage.file_locator.get_zip_data(try_filename)
            if source:
                return try_filename, source
>       raise NoSource("No source for code: '%s'" % filename)
E       NoSource: No source for code: '/home/johannes/workspace/ocular.py-dev/scrutinizer/__init__.py'

../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/results.py:92: NoSource
_________________________________________________________________ IntegrationTest.test_uploads_coverage __________________________________________________________________

self = <tests.test_integration.IntegrationTest testMethod=test_uploads_coverage>

    def test_uploads_coverage(self):
        parser = CoverageParser()
>       xml_data = parser.parse('tests/res/sample-coverage', None)

tests/test_integration.py:11: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scrutinizer/ocular/coverage_parser.py:14: in parse
    coverage_data.xml_report(outfile=xml_report_file.name)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/control.py:694: in xml_report
    return reporter.report(morfs, outfile=outfile)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/xmlreport.py:56: in report
    self.report_files(self.xml_file, morfs)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/report.py:84: in report_files
    report_fn(cu, self.coverage._analyze(cu))
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/control.py:592: in _analyze
    return Analysis(self, it)
../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/results.py:18: in __init__
    actual_filename, source = self.find_source(self.filename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <coverage.results.Analysis object at 0x7f27b7dfbd90>, filename = '/home/johannes/workspace/ocular.py-dev/scrutinizer/__init__.py'

    def find_source(self, filename):
        """Find the source for `filename`.

            Returns two values: the actual filename, and the source.

            The source returned depends on which of these cases holds:

                * The filename seems to be a non-source file: returns None

                * The filename is a source file, and actually exists: returns None.

                * The filename is a source file, and is in a zip file or egg:
                  returns the source.

                * The filename is a source file, but couldn't be found: raises
                  `NoSource`.

            """
        source = None

        base, ext = os.path.splitext(filename)
        TRY_EXTS = {
            '.py':  ['.py', '.pyw'],
            '.pyw': ['.pyw'],
        }
        try_exts = TRY_EXTS.get(ext)
        if not try_exts:
            return filename, None

        for try_ext in try_exts:
            try_filename = base + try_ext
            if os.path.exists(try_filename):
                return try_filename, None
            source = self.coverage.file_locator.get_zip_data(try_filename)
            if source:
                return try_filename, source
>       raise NoSource("No source for code: '%s'" % filename)
E       NoSource: No source for code: '/home/johannes/workspace/ocular.py-dev/scrutinizer/__init__.py'

../../.virtualenvs/ocular.py/local/lib/python2.7/site-packages/coverage-3.7.1-py2.7-linux-x86_64.egg/coverage/results.py:92: NoSource
============================================================= 2 failed, 2 passed, 3 skipped in 7.05 seconds ==============================================================
Exception OSError: (2, 'No such file or directory', '/tmp/tmpX4h2ag') in <bound method _TemporaryFileWrapper.__del__ of <closed file '<fdopen>', mode 'w+b' at 0x7f27b87f7540>> ignored
Exception OSError: (2, 'No such file or directory', '/tmp/tmp6jUENT') in <bound method _TemporaryFileWrapper.__del__ of <closed file '<fdopen>', mode 'w+b' at 0x7f27b7e07390>> ignored

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.