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

Tests fail #36

Open
yurivict opened this issue Sep 21, 2018 · 10 comments
Open

Tests fail #36

yurivict opened this issue Sep 21, 2018 · 10 comments

Comments

@yurivict
Copy link

yurivict commented Sep 21, 2018

============================================================================ test session starts ============================================================================
platform freebsd11 -- Python 2.7.15, pytest-3.6.4, py-1.6.0, pluggy-0.6.0
rootdir: /usr/ports/math/py-pygslodeiv2/work-py27/pygslodeiv2-0.9.1, inifile: setup.cfg
collected 206 items / 3 errors                                                                                                                                              

================================================================================== ERRORS ===================================================================================
___________________________________________________________ ERROR collecting pyodesys/native/tests/test_cvode.py ____________________________________________________________
ImportError while importing test module '/usr/local/lib/python2.7/site-packages/pyodesys/native/tests/test_cvode.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python2.7/site-packages/pyodesys/native/__init__.py:14: in <module>
    from .cvode import NativeCvodeSys
/usr/local/lib/python2.7/site-packages/pyodesys/native/cvode.py:18: in <module>
    class NativeCvodeCode(_NativeCodeBase):
/usr/local/lib/python2.7/site-packages/pyodesys/native/cvode.py:22: in NativeCvodeCode
    _realtype = _config.env.get('REAL_TYPE', 'double')
/usr/local/lib/python2.7/site-packages/pyodesys/util.py:272: in __getattribute__
    raise self._exc  # ImportError("Failed to import %s" % self._modname)
E   ImportError: No module named pycvodes
____________________________________________________________ ERROR collecting pyodesys/native/tests/test_gsl.py _____________________________________________________________
ImportError while importing test module '/usr/local/lib/python2.7/site-packages/pyodesys/native/tests/test_gsl.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python2.7/site-packages/pyodesys/native/__init__.py:14: in <module>
    from .cvode import NativeCvodeSys
/usr/local/lib/python2.7/site-packages/pyodesys/native/cvode.py:18: in <module>
    class NativeCvodeCode(_NativeCodeBase):
/usr/local/lib/python2.7/site-packages/pyodesys/native/cvode.py:22: in NativeCvodeCode
    _realtype = _config.env.get('REAL_TYPE', 'double')
/usr/local/lib/python2.7/site-packages/pyodesys/util.py:272: in __getattribute__
    raise self._exc  # ImportError("Failed to import %s" % self._modname)
E   ImportError: No module named pycvodes
___________________________________________________________ ERROR collecting pyodesys/native/tests/test_odeint.py ___________________________________________________________
ImportError while importing test module '/usr/local/lib/python2.7/site-packages/pyodesys/native/tests/test_odeint.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python2.7/site-packages/pyodesys/native/__init__.py:14: in <module>
    from .cvode import NativeCvodeSys
/usr/local/lib/python2.7/site-packages/pyodesys/native/cvode.py:18: in <module>
    class NativeCvodeCode(_NativeCodeBase):
/usr/local/lib/python2.7/site-packages/pyodesys/native/cvode.py:22: in NativeCvodeCode
    _realtype = _config.env.get('REAL_TYPE', 'double')
/usr/local/lib/python2.7/site-packages/pyodesys/util.py:272: in __getattribute__
    raise self._exc  # ImportError("Failed to import %s" % self._modname)
E   ImportError: No module named pycvodes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================== 3 error in 2.14 seconds ==========================================================================
*** Error code 2

OS: FreeBSD 11.2
Occurs in the FreeBSD port.

@bjodah
Copy link
Owner

bjodah commented Sep 21, 2018

why are pyodesys and pycvodes referenced there? (non of those are reqs. of pygslodeiv2)

@yurivict
Copy link
Author

Sorry, I pasted a wrong log. The correct log is:

============================================================================ test session starts ============================================================================
platform freebsd11 -- Python 3.6.6, pytest-3.6.4, py-1.6.0, pluggy-0.6.0
rootdir: /usr/ports/math/py-pygslodeiv2/work-py36/pygslodeiv2-0.9.1, inifile: setup.cfg
collected 0 items / 1 errors                                                                                                                                                

================================================================================== ERRORS ===================================================================================
___________________________________________________________ ERROR collecting pygslodeiv2/tests/test_gsl_odeiv2.py ___________________________________________________________
ImportError while importing test module '/usr/ports/math/py-pygslodeiv2/work-py36/pygslodeiv2-0.9.1/pygslodeiv2/tests/test_gsl_odeiv2.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
pygslodeiv2/__init__.py:10: in <module>
    from ._gsl_odeiv2 import adaptive, predefined, requires_jac, steppers, fpes
E   ModuleNotFoundError: No module named 'pygslodeiv2._gsl_odeiv2'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================== 1 error in 0.27 seconds ==========================================================================
*** Error code 2

@bjodah
Copy link
Owner

bjodah commented Sep 21, 2018 via email

@yurivict
Copy link
Author

  1. install FreeBSD ISO image into a VM: https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/11.2/FreeBSD-11.2-RELEASE-amd64-disc1.iso
  2. install prerequisites: pkg install py36-pygslodeiv2 subversion
  3. check out the ports tree: cd /usr && svn checkout https://svn.FreeBSD.org/ports/head ports
  4. build the port and run tests: cd /usr/ports/math/py-pygslodeiv2 && make test FLAVOR=py36
  5. observe the failure

@bjodah
Copy link
Owner

bjodah commented Sep 22, 2018

Thanks, I could reproduce the test failure. However, I'm a bit lost:

# cd work-py36
#  find . -iname "*.so"             
./pygslodeiv2-0.9.1/build/lib.freebsd-11.2-STABLE-amd64-3.6/pygslodeiv2/_gsl_ode         iv2.so                                                                                   
./stage/usr/local/lib/python3.6/site-packages/pygslodeiv2/_gsl_odeiv2.so

So the shared library is getting built. If I cd into that site-packages folder and run:

# python3.6 -c "import pygslodeiv2"
# echo $?
0

which to me looks like things are working as expected. Up to the packaging(?) point?

EDIT:
also from site-packages:

        root@freebsd:/usr/ports/math/py-pygslodeiv2/work-py36/stage/usr/local/lib/python         
        3.6/site-packages # python3.6 -m pytest --pyargs pygslodeiv2                             
        ============================= test session starts ==============================         
        platform freebsd11 -- Python 3.6.6, pytest-3.6.4, py-1.6.0, pluggy-0.6.0                 
        rootdir: /usr/ports/math/py-pygslodeiv2/work-py36/stage/usr/local/lib/python3.6/         
        site-packages, inifile:                                                                  
        collected 21 items                                                                       
                                                                                                 
        pygslodeiv2/tests/test_gsl_odeiv2.py .....................               [100%]          
                                                                                                 
        ========================== 21 passed in 43.09 seconds ==========================         
        root@freebsd:/usr/ports/math/py-pygslodeiv2/work-py36/stage/usr/local/lib/python

@bjodah
Copy link
Owner

bjodah commented Oct 19, 2018

ok, so this is a packaging issue in FreeBSD/ports then?

@yurivict
Copy link
Author

Packaging issue means that something is wrong with the package.
But what is wrong? It is packaged in a standard way, using distutils.

@bjodah
Copy link
Owner

bjodah commented Oct 19, 2018

is it picking up the package from the source directory instead of the build directory?
It seems to matter from where the command is issued. It works on multiple linux distributions and on macOS.

@yurivict
Copy link
Author

It is trying to open the shared library in the source location:

 81247 python2.7 NAMI  "/usr/ports/math/py-pygslodeiv2/work-py27/pygslodeiv2-0.9.1/pygslodeiv2/_gsl_odeiv2.so"
 81247 python2.7 RET   open -1 errno 2 No such file or directory

when it only exists in the build directory:
work-py27/pygslodeiv2-0.9.1/build/lib.freebsd-11.2-STABLE-amd64-2.7/pygslodeiv2/_gsl_odeiv2.so

@bjodah
Copy link
Owner

bjodah commented Oct 19, 2018

I see. To me it sounds like the scripts in FreeBSD/ports need to be adapted to setuptools or vice versa. I'm not doing anything unusual in setup.py in that respect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants