Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark tests broken on master and 2.7.0 #4119

Closed
Pierre-Sassoulas opened this issue Feb 22, 2021 · 3 comments · Fixed by #4138, tingvarsson/telegram.ongabot#33 or hypothesis/checkmate#227

Comments

@Pierre-Sassoulas
Copy link
Member

Steps to reproduce

pip3 install -r requirements_test.txt
python3 -m pytest . -k test_baseline_benchmark_j1_all_checks_lots_of_files

I think this is due to the fact that we're not launching those test on Github Actions we should launch them once (so test are fasters in general).

@Pierre-Sassoulas
Copy link
Member Author

Pierre-Sassoulas commented Feb 22, 2021

This one was tricky to bisect because the problem is the version of astroid (6e2de8e).

I ended up using pip3 uninstall pylint astroid;pip3 install "astroid==2.4.2";pip3 install -e . -U;python3 -m pytest -k test_baseline_benchmark_j1_all_checks_lots_of_files as test.

Fixed by putting "astroid>=2.4.0,<=2.6", back in the documentation. Broken again by putting astroid>=2.5.0

It means astroid 2.5.0 is breaking this benchmark test. Do you have an idea why @hippo91 ? Should I open a bug in astroid ?

Stacktrace;

>       register_plugins(
            linter, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
        )

tests/benchmark/test_baseline_benchmarks.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pylint/utils/utils.py:254: in register_plugins
    module = modutils.load_module_from_file(
venv/lib/python3.8/site-packages/astroid/modutils.py:240: in load_module_from_file
    return load_module_from_modpath(modpath)
venv/lib/python3.8/site-packages/astroid/modutils.py:225: in load_module_from_modpath
    return load_module_from_name(".".join(parts))
venv/lib/python3.8/site-packages/astroid/modutils.py:210: in load_module_from_name
    return importlib.import_module(dotted_name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '.git', package = None

    def import_module(name, package=None):
        """Import a module.
    
        The 'package' argument is required when performing a relative import. It
        specifies the package to use as the anchor point from which to resolve the
        relative import to an absolute import.
    
        """
        level = 0
        if name.startswith('.'):
            if not package:
                msg = ("the 'package' argument is required to perform a relative "
                       "import for {!r}")
>               raise TypeError(msg.format(name))
E               TypeError: the 'package' argument is required to perform a relative import for '.git'

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.7.1 milestone Feb 22, 2021
@hippo91
Copy link
Contributor

hippo91 commented Feb 22, 2021

@Pierre-Sassoulas please open a new issue on astroid side. I will try to have a look ASAP. Sorry for this...

@Pierre-Sassoulas
Copy link
Member Author

I bissected the problem in astroid and opened pylint-dev/astroid#909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment