I retested 'base.py' with run_tests.py. Failure of run_tests.py in my window8 has nothing to do with

top_dir = "c:\\Python27\\Lib\\site-packages\\sfepy"

It failed here:

    if (package_name is None) and (top_dir == path[:len(top_dir)]):
        package_name = path[len(top_dir) + 1:].replace('/', '.')
        path = top_dir

I added several "print" in base.py (see below) and two attached files are from the two top_dir cases:
   
    case 1: top_dir = os.path.normpath(os.path.join(base_dir, '..'))
    case 2: top_dir = "c:\\Python27\\Lib\\site-packages\\sfepy"

def import_file(filename, package_name=None, can_reload=True):
    """
    Import a file as a module. The module is explicitly reloaded to
    prevent undesirable interactions.
    """
    from sfepy import base_dir
    #top_dir = os.path.normpath(os.path.join(base_dir, '..'))
    top_dir = "c:\\Python27\\Lib\\site-packages\\sfepy"
    print('top_dir===>',top_dir)
    #print('os.path.normpath top_dir===>',top_dir)
    print('package_name==>', package_name)------------------------------------------------------------------------------
    path = os.path.dirname(os.path.normpath(os.path.realpath(filename)))
    print('path===>',type(path),len(top_dir), path[:len(top_dir)],path[len(top_dir) + 1:],path)
    if (package_name is None) and (top_dir == path[:len(top_dir)]):
        package_name = path[len(top_dir) + 1:].replace('/', '.')
        path = top_dir
        print('path....',path)

See if this helps to fix the issue in window 8.


ouyang


On Wednesday, July 23, 2014 10:16:31 PM UTC+8, Robert Cimrman wrote:
Thanks for the info.

So you have both sfepy installed system-wide, and run it in-place? Does
removing the system-wide files change something?

r.

On 07/23/2014 03:59 PM, Ouyang wrote:
>
> On Wednesday, July 23, 2014 8:53:33 PM UTC+8, Ouyang wrote:
>
>      top_dir = os.path.normpath(os.path.join(base_dir, '..'))
>
> This statement assign "c:\\sfepy" to top_dir instead of
> "c:\\Python27\\Lib\\site-packages\\sfepy".
>
> After I hack the base.py in c:\\sfepy\\sfepy\\base\\base.py (NOT
> c:\\Python27\\Lib\\site-packages\\sfepy\\base\\base.py)
>
>      top_dir = "c:\\Python27\\Lib\\site-packages\\sfepy"
>
> run_tests.py  passes except  stokes_slip_bc.py which crash python.
>
>
>    Sfepy should call base.py at
> c:\\Python27\\Lib\\site-packages\\sfepy\\base\\ at very beginning.
>
>
> Ouyang
>
> Hi,
>>
>>     For run_tests.py for the latest sfepy in window 8, here is what I do:
>>
>> 1. Installations:
>>   1.1 Upgrade python(x,y) from 2.7.6.0 to 2.7.6.1 (packages installed are
>>   listed in the attached file using "yolk -l".)
>>   1.2 Reinstall msysgit:
>>      Since installation of 1.9.4 "NETINSTALL" verion of msysGit failed
>> (msysGit-netinstall-1.9.4-preview20140611.exe),  I installed 1.9.0
>> "FULLINSTALL" version of msysGit
>> (msysGit-fullinstall-1.9.0-preview20140217.exe at
>> https://github.com/msysgit/msysgit/releases).
>>
>> 2. run_tests.py:
>>
>>    2.1 Old version of sfepy:
>>      2.1.1 Start msysGit shell with msys.bat
>>      2.1.2 cd to sfepy root directory
>>      2.1.3 python setup.py build_ext --inplace --compiler=mingw32
>>         (I ignored the error info: "msvcr90.dll not found").
>>      2.1.4 ./run_tests.py
>>      2.1.5 This time, all tests are ok except stokes_slip_bc.py which
>> causes python
>> crash. It was ok before with python(x,y)-2.7.6.0 and previous msysgit
>> installation.
>>
>>    2.2 Latest verstion of sfepy:
>>      2.2.1 python setup.py clean
>>      2.2.2 python setup.py build_ext --inplace --compiler=mingw32
>>      2.2.3 ./run_tests.py
>>      2.2.5 No luck again: 79 test file(s) executed in 10.12 s, 63
>> failure(s) of 116 test(s)
>>
>> ouyang
>>
>