Is it necessary to use python 3.x for patching something (and running tests) in pylint code-base?
Hi Contributors, I am trying to patch something to the pylint code-base and I am running some tests to make sure there are no breakage. When I was running test_func.py in /test, I got this - Traceback (most recent call last): File "./test_func.py", line 27, in <module> from pylint.testutils import (make_tests, LintTestUsingModule, LintTestUsingFile, File "/Users/ahirnish/pylint_patch/pylint/pylint/testutils.py", line 35, in <module> import astroid File "/Users/ahirnish/pylint_patch/astroid/astroid/__init__.py", line 47, in <module> import enum ImportError: No module named enum I am using Python 2.7 and when I searched for this error on Google, results said that 'enum' was introduced from Python3.4 but it was backported to previous releases too, including 2.7. Owing to the error, I did 'pip install enum' and now I am seeing this - Traceback (most recent call last): File "./test_func.py", line 27, in <module> from pylint.testutils import (make_tests, LintTestUsingModule, LintTestUsingFile, File "/Users/ahirnish/pylint_patch/pylint/pylint/testutils.py", line 35, in <module> import astroid File "/Users/ahirnish/pylint_patch/astroid/astroid/__init__.py", line 51, in <module> Load = _Context.Load AttributeError: 'Enum' object has no attribute 'Load' This prompted me to ask if Python 3.x is required to run the tests in the pylint code-base? Or is there something very obvious I am missing here? Thanks in advance for clarification. -- Regards, Ahirnish
Hey, * Ahirnish Pareek <ahirnish@arista.com> [2016-04-14 14:35:51 +0530]:
I am using Python 2.7 and when I searched for this error on Google, results said that 'enum' was introduced from Python3.4 but it was backported to previous releases too, including 2.7. Owing to the error, I did 'pip install enum' and now I am seeing this -
The backport of Python 3.4's enum to earlier versions is called 'enum34'. The 'enum' package seems to be something different, which existed before Python 3.4. I can recommend using tox to run the tests instead, which will set up a virtualenv and install the right dependencies when you simply run 'tox': https://testrun.org/tox/ Florian -- http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I'm running a crowdfunding to work on my FOSS-project full-time: http://igg.me/at/qutebrowser
participants (2)
-
Ahirnish Pareek -
Florian Bruhin