Email Re: [Python-projects] invoking pylint on __init__.py

from
to
subject
Re: [Python-projects] invoking pylint on __init__.py
date
2005/11/08 09:56
on 08.11.2005 09:17 Sylvain Thénault said the following:
> On Tuesday 08 November Ã  08:51, Stefan Rank wrote:

>>Just installed the new astng and pylint 0.8.1 and...
>>one of the two surprises is gone, see below.
>>(unfortunately the other one is the one that bugs me :)
>> if i have time one of these days i'll try to investigate
>> on the windows-box.)


> In this case take a look at pylint/test/regrtest.py, which implements a
> test case trying to reproduce your problem.
>  

Very nice. I just ran it once, not much time now, output below.

And, for the record, I just realised that passing an absolute path also 
fails (checks whole package) if the cwd is the one containing __init__.py::

    cd path
    pylint.bat __init__.py                  # too much checking
    pylint.bat D:\full\path\__init__.py     # too much checking

    #whereas

    cd ..
    pylint.bat D:\full\path\__init__.py     # works


output of regrtest.py:

C:\Python24\Lib\site-packages\pylint\test>python regrtest.py
F.FF
======================================================================
FAIL: test_check_package___init__ (__main__.NonRegrTC)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "regrtest.py", line 60, in test_check_package___init__
     '%s: %s' % (variation, checked))
AssertionError: regrtest_data/package/__init__.py: 
['regrtest_data/package/__init__.py']

======================================================================
FAIL: test_package___init___precedence (__main__.NonRegrTC)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "regrtest.py", line 52, in test_package___init___precedence
     self.failUnlessEqual(got, '')
AssertionError: 'F:  0: No module named precedence_test' != ''

======================================================================
FAIL: test_package___path___manipulation (__main__.NonRegrTC)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "regrtest.py", line 47, in test_package___path___manipulation
     self.failUnlessEqual(got, '')
AssertionError: 'F:  0: No module named package' != ''

----------------------------------------------------------------------
Ran 4 tests in 0.020s

FAILED (failures=3)



>>on 07.11.2005 16:43 Sylvain Thénault said the following:
>>
>>>On Monday 31 October Ã  16:28, Sylvain Thénault wrote:
>>>
>>>>On Monday 31 October Ã  15:43, Stefan Rank wrote:
>>>>
>>>>>I am trying to use pylint to check *only* a __init__.py file.
>>>>>
>>>>>My experiments (on windows, py24, pylint 0.8)::
>>>>>
>>>>>pylint.bat mypackage.__init__
>>>>>
>>>>>works. But the following two::
>>>>>
>>>>>pylint.bat __init__.py
>>>>>pylint.bat .\__init__.py
>>>>>
>>>>>check the whole package. (where I would expect to only check __init__).
>>
>>This is still happening.


> hum, strange. Possibly a pb related to sys.path handling differences
> between windows and linux.



is a reply to