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

Python tests fail #244

Closed
yurivict opened this issue Apr 18, 2024 · 3 comments
Closed

Python tests fail #244

yurivict opened this issue Apr 18, 2024 · 3 comments

Comments

@yurivict
Copy link

cd /usr/ports/cad/py-gdstk/work-py39/gdstk-0.9.51 && /usr/bin/env -i HOME=/usr/ports/cad/py-gdstk/work-py39  PWD="${PWD}"  __MAKE_CONF=/nonexistent OSVERSION=1400509 PATH=/usr/local/libexec/ccache:/usr/ports/cad/py-gdstk/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin TERM=xterm-256color XDG_DATA_HOME=/usr/ports/cad/py-gdstk/work-py39  XDG_CONFIG_HOME=/usr/ports/cad/py-gdstk/work-py39  XDG_CACHE_HOME=/usr/ports/cad/py-gdstk/work-py39/.cache  HOME=/usr/ports/cad/py-gdstk/work-py39 PATH=/usr/local/libexec/ccache:/usr/ports/cad/py-gdstk/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/cad/py-gdstk/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" PYTHONPATH=/usr/ports/cad/py-gdstk/work-py39/stage/usr/local/lib/python3.9/site-packages /usr/local/bin/python3.9 -m pytest -k '' -rs -v -o addopts= 
/usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ModuleNotFoundError: No module named 'gdstk._gdstk' (from /usr/ports/cad/py-gdstk/work-py39/gdstk-0.9.51/tests/conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
ImportError while loading conftest '/usr/ports/cad/py-gdstk/work-py39/gdstk-0.9.51/tests/conftest.py'.
tests/conftest.py:12: in <module>
    import gdstk
gdstk/__init__.py:1: in <module>
    from ._gdstk import *
E   ModuleNotFoundError: No module named 'gdstk._gdstk'
*** Error code 4

Version: 0.9.51
Python-3.9
FreeBSD 13.2

@heitzmann
Copy link
Owner

Is there a _gdstk-*.so in the gdstk directory?
Did you compile it?

@yurivict
Copy link
Author

This file is present:
/usr/local/lib/python3.9/site-packages/gdstk/_gdstk.cpython-39.so

@heitzmann
Copy link
Owner

In that case, are you trying to run the tests from the source distribution directory? If so, your python interpreter will look for the local directory gdstk instead of /usr/local/lib/python3.9/site-packages/gdstk, which probably does not contain the so.

For local development I usually create a symlink from the build directory to gdtsk. If you have a better alternative, let me know.

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