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 imports #21

Closed
jonringer opened this issue Jan 15, 2020 · 2 comments
Closed

Use relative imports #21

jonringer opened this issue Jan 15, 2020 · 2 comments

Comments

@jonringer
Copy link

doing from ovirtsdk4 import readers from ovirtsdk4/init.py causes python3 to look for a reader attribute declared on ovirtsdk4/init.py.... which it never will because it needs to reference another file.

if running the tests from outside the repo, you will get:

  File "/build/source/sdk/tests/test_xml_writer.py", line 21, in <module>
    from ovirtsdk4.xml import XmlWriter
  File "/nix/store/8vhyrj1lvf1fmw7m3asavylf0scdippk-python3.7-ovirt-engine-sdk-python-4.4.0/lib/python3.7/site-packages/ovirtsdk4/__init__.py", line 1033, in <module>
    from ovirtsdk4 import readers  # noqa: F401
ImportError: cannot import name 'readers' from 'ovirtsdk4' (/nix/store/8vhyrj1lvf1fmw7m3asavylf0scdippk-python3.7-ovirt-engine-sdk-python-4.4.0/lib/python3.7/site-packages/ovirtsdk4/__init__.py)

offending line:

from ovirtsdk4 import readers # noqa: F401

solution:
change to relative imports:
from ovirtsdk4 import readers -> from .reader import *

@machacekondra
Copy link
Contributor

cc @oliel
Hello @jonringer thank you for reporting the issue. This project is not using github issues to report bugs. We use bugzilla. Ori can you please take a look and close?

@jonringer
Copy link
Author

closing due to inactivity

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