thegooglecodearchive / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

/usr/lib/pymodules/python2.5/py/impl/path/local.py:528: EnvironmentError #173

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,
I'm forwarding the Debian bug 560631 :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560631 .

Probably due to the recent upgrade to python-codespeak-lib 1.1.1, mpmath
can't run tests anymore. During the package build we run

python mpmath/tests/runtests.py -strict -py -local

that now results in this failure (complete log is available in the above link):

======================================================= test session starts
========================================================
python: platform linux2 -- Python 2.5.4 -- pytest-1.1.1
test object 1: /home/morph/deb/build-area/mpmath-0.13

build/lib E
mpmath/tests/test_basic_ops.py ............
mpmath/tests/test_bitwise.py ..........
mpmath/tests/test_calculus.py .......
mpmath/tests/test_compatibility.py ...
mpmath/tests/test_convert.py .............
mpmath/tests/test_diff.py ..
mpmath/tests/test_division.py .......
mpmath/tests/test_elliptic.py ...........
mpmath/tests/test_functions.py ...........................................
mpmath/tests/test_functions2.py .....................................
mpmath/tests/test_gammazeta.py ...........................
mpmath/tests/test_hp.py ...
mpmath/tests/test_identify.py ..
mpmath/tests/test_interval.py .........
mpmath/tests/test_linalg.py ..............
mpmath/tests/test_matrices.py ........
mpmath/tests/test_mpmath.py ........
mpmath/tests/test_ode.py .....
mpmath/tests/test_pickle.py .
mpmath/tests/test_power.py ...
mpmath/tests/test_quad.py .............
mpmath/tests/test_rootfinding.py .......
mpmath/tests/test_special.py .....
mpmath/tests/test_summation.py .....
mpmath/tests/test_trig.py ...

============================================================== ERRORS
==============================================================
_____________________________ ERROR during collection
/home/morph/deb/build-area/mpmath-0.13/build/lib _____________________________

collector = <Directory 'lib'>

    def pytest_make_collect_report(collector):
        result = excinfo = None
        try:
>           result = collector._memocollect()

/usr/lib/pymodules/python2.5/py/plugin/pytest_runner.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Directory 'lib'>

    def _memocollect(self):
        """ internal helper method to cache results of calling collect(). """
>       return self._memoizedcall('_collected', self.collect)

/usr/lib/pymodules/python2.5/py/impl/test/collect.py:300: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Directory 'lib'>, attrname = '_collected', function = <bound method
Directory.collect of <Directory 'lib'>>

    def _memoizedcall(self, attrname, function):
        exattrname = "_ex_" + attrname
        failure = getattr(self, exattrname, None)
        if failure is not None:
            py.builtin._reraise(failure[0], failure[1], failure[2])
        if hasattr(self, attrname):
            return getattr(self, attrname)
        try:
>           res = function()

/usr/lib/pymodules/python2.5/py/impl/test/collect.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Directory 'lib'>

    def collect(self):
        l = self._deprecated_collect()
        if l is not None:
            return l
        l = []
        for path in self.fspath.listdir(sort=True):
>           res = self.consider(path)

/usr/lib/pymodules/python2.5/py/impl/test/collect.py:388: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Directory 'lib'>, path =
local('/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath')

    def consider(self, path):
>       if self._ignore(path):

/usr/lib/pymodules/python2.5/py/impl/test/collect.py:406: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Directory 'lib'>, path =
local('/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath')

    def _ignore(self, path):
>       ignore_paths = self.config.getconftest_pathlist("collect_ignore",
path=path)

/usr/lib/pymodules/python2.5/py/impl/test/collect.py:397: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <py.impl.test.config.Config object at 0x2acb5f307b50>, name =
'collect_ignore'
path = local('/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath')

    def getconftest_pathlist(self, name, path=None):
        """ return a matching value, which needs to be sequence
                of filenames that will be returned as a list of Path
                objects (they can be relative to the location
                where they were found).
            """
        try:
>           mod, relroots = self._conftest.rget_with_confmod(name, path)

/usr/lib/pymodules/python2.5/py/impl/test/config.py:170: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <py.impl.test.conftesthandle.Conftest object at 0x2acb5f307bd0>,
name = 'collect_ignore'
path = local('/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath')

    def rget_with_confmod(self, name, path=None):
>       modules = self.getconftestmodules(path)

/usr/lib/pymodules/python2.5/py/impl/test/conftesthandle.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <py.impl.test.conftesthandle.Conftest object at 0x2acb5f307bd0>
path = local('/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath')

    def getconftestmodules(self, path):
        """ return a list of imported conftest modules for the given path.  """
        try:
            clist = self._path2confmods[path]
        except KeyError:
            if path is None:
                raise ValueError("missing default conftest.")
            dp = path.dirpath()
            if dp == path:
                return [self.importconftest(defaultconftestpath)]
            clist = self.getconftestmodules(dp)
            conftestpath = path.join("conftest.py")
            if conftestpath.check(file=1):
>               clist.append(self.importconftest(conftestpath))

/usr/lib/pymodules/python2.5/py/impl/test/conftesthandle.py:49: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <py.impl.test.conftesthandle.Conftest object at 0x2acb5f307bd0>
conftestpath =
local('/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath/conftest.py')

    def importconftest(self, conftestpath):
        # Using caching here looks redundant since ultimately
        # sys.modules caches already
        assert conftestpath.check(), conftestpath
        if not conftestpath.dirpath('__init__.py').check(file=1):
            # HACK: we don't want any "globally" imported conftest.py,
            #       prone to conflicts and subtle problems
            modname = str(conftestpath).replace('.', conftestpath.sep)
            mod = conftestpath.pyimport(modname=modname)
        else:
>           mod = conftestpath.pyimport()

/usr/lib/pymodules/python2.5/py/impl/test/conftesthandle.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self =
local('/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath/conftest.py'),
modname = 'mpmath.conftest'
ensuresyspath = True

    def pyimport(self, modname=None, ensuresyspath=True):
        """ return path as an imported python module.
                if modname is None, look for the containing package
                and construct an according module name.
                The module will be put/looked up in sys.modules.
            """
        if not self.check():
            raise py.error.ENOENT(self)
        #print "trying to import", self
        pkgpath = None
        if modname is None:
            pkgpath = self.pypkgpath()
            if pkgpath is not None:
                if ensuresyspath:
                    self._prependsyspath(pkgpath.dirpath())
                pkg = __import__(pkgpath.basename, None, None, [])
                names = self.new(ext='').relto(pkgpath.dirpath())
                names = names.split(self.sep)
                modname = ".".join(names)
            else:
                # no package scope, still make it possible
                if ensuresyspath:
                    self._prependsyspath(self.dirpath())
                modname = self.purebasename
            mod = __import__(modname, None, None, ['__doc__'])
            modfile = mod.__file__
            if modfile[-4:] in ('.pyc', '.pyo'):
                modfile = modfile[:-1]
            elif modfile.endswith('$py.class'):
                modfile = modfile[:-9] + '.py'
            if not self.samefile(modfile):
                raise EnvironmentError("mismatch:\n"
                "imported module %r\n"
                "does not stem from %r\n"
>               "maybe __init__.py files are missing?" % (mod, str(self)))
E               EnvironmentError: mismatch:
E               imported module <module 'mpmath.conftest' from
'/home/morph/deb/build-area/mpmath-0.13/mpmath/conftest.py'>
E               does not stem from
'/home/morph/deb/build-area/mpmath-0.13/build/lib/mpmath/conftest.py'
E               maybe __init__.py files are missing?

/usr/lib/pymodules/python2.5/py/impl/path/local.py:528: EnvironmentError
=============================================== 258 passed, 1 error in
45.53 seconds ===============================================

Original issue reported on code.google.com by matrixhasu on 29 Dec 2009 at 12:12

GoogleCodeExporter commented 9 years ago
I can't reproduce this on Windows, though I do get a warning:

C:\Source\mp\trunk\mpmath\tests>c:\python26\python runtests.py -strict -py 
-local
C:\Source\mp\trunk\mpmath\conftest.py:8: Warning: py.magic.autopath deprecated, 
use
py.path.local(__file__) and maybe pypkgpath/pyimport(). (since version 1.1)
  rootdir = py.magic.autopath().dirpath()
================================================================================
================================================================================
===========
python: platform win32 -- Python 2.6.0 -- pytest-1.1.1
test object 1: C:\Source\mp\trunk\mpmath\tests

test_basic_ops.py ............
test_bitwise.py ...........
test_calculus.py .......
test_compatibility.py ...
test_convert.py .............
test_diff.py ..
test_division.py .......
test_elliptic.py ...........
test_functions.py ............................................
test_functions2.py ........................................
test_gammazeta.py ...........................
test_hp.py ...
test_identify.py ..
test_interval.py .........
test_linalg.py ..............
test_matrices.py ........
test_mpmath.py ........
test_ode.py ...
test_pickle.py .
test_power.py ...
test_quad.py .............
test_rootfinding.py .......
test_special.py .....
test_summation.py .....
test_trig.py ...
test_visualization.py .

================================================================================
================================================================================
===========

Original comment by fredrik....@gmail.com on 14 Jan 2010 at 6:23

GoogleCodeExporter commented 9 years ago
Runs finely for me on Linux:

$ python mpmath/tests/runtests.py -strict -py -local
mpmath imported from /home/one/src/mpmath/mpmath
mpmath version: 0.14-svn
Python version: 2.6.4 (r264:75706, Oct 27 2009, 06:25:13) 
[GCC 4.4.1]

====================================== test session starts
======================================
python: platform linux2 -- Python 2.6.4 -- pytest-1.1.1
test object 1: /home/one/src/mpmath
[...
]================================== 278 passed in 37.37 seconds
==================================

Did you try running the tests without the -py flag?

Original comment by Vinzent.Steinberg@gmail.com on 24 Jan 2010 at 12:10