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

Use relative import for library_path #455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use relative import for library_path #455

wants to merge 1 commit into from

Conversation

rgov
Copy link
Member

@rgov rgov commented Dec 21, 2022

Fixes #454.

Copy link
Member

@msoos msoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@msoos msoos self-requested a review December 24, 2022 10:30
Copy link
Member

@msoos msoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why we are getting

2022-12-21T17:09:35.0700967Z       Start 38: python-interface-tests
2022-12-21T17:09:35.0701135Z 
2022-12-21T17:09:35.0701273Z 38: Test command: /usr/bin/python3 "tests.py"
2022-12-21T17:09:35.0701587Z 38: Working Directory: /home/runner/work/stp/stp/build/tests/api/python
2022-12-21T17:09:35.0701891Z 38: Test timeout computed to be: 10000000
2022-12-21T17:09:35.2266101Z 38: Traceback (most recent call last):
2022-12-21T17:09:35.2267905Z 38:   File "/home/runner/work/stp/stp/build/tests/api/python/tests.py", line 32, in <module>
2022-12-21T17:09:35.2270367Z 38:     import stp
2022-12-21T17:09:35.2271845Z 38:   File "/home/runner/work/stp/stp/build/bindings/python/stp/stp.py", line 45, in <module>
2022-12-21T17:09:35.2274001Z 38:     from .library_path import PATHS
2022-12-21T17:09:35.2275523Z 38: ImportError: attempted relative import with no known parent package
2022-12-21T17:09:35.2545691Z 37/47 Test #38: python-interface-tests ....................***Failed    0.18 sec
2022-12-21T17:09:35.2546183Z Traceback (most recent call last):
2022-12-21T17:09:35.2546598Z   File "/home/runner/work/stp/stp/build/tests/api/python/tests.py", line 32, in <module>
2022-12-21T17:09:35.2546965Z     import stp
2022-12-21T17:09:35.2547347Z   File "/home/runner/work/stp/stp/build/bindings/python/stp/stp.py", line 45, in <module>
2022-12-21T17:09:35.2547753Z     from .library_path import PATHS
2022-12-21T17:09:35.2548163Z ImportError: attempted relative import with no known parent package

from the CI?

@aytey
Copy link
Member

aytey commented Dec 24, 2022

Given the error message: maybe a missing __init__.py in the build folder?

When you do something like cmake --install ., I imagine this puts the stp folder into site-packages; however, our tests do this:

so I guess the tests can't correctly work out how to do the import without an __init__.py.

That's a stab in the dark btw, I haven't actually tried it ...

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

Successfully merging this pull request may close these issues.

No module named 'library_path'
3 participants