[ 
https://issues.apache.org/jira/browse/QPID-8632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17710203#comment-17710203
 ] 

ASF GitHub Bot commented on QPID-8632:
--------------------------------------

jiridanek commented on PR #7:
URL: https://github.com/apache/qpid-python/pull/7#issuecomment-1501989364

   Trying this also with qpid-j, for extra credits 
https://github.com/apache/qpid-python/actions/runs/4658983151/jobs/8245311044




> [python client] Circular imports in mllib and qpid.connection, qpid.delegates
> -----------------------------------------------------------------------------
>
>                 Key: QPID-8632
>                 URL: https://issues.apache.org/jira/browse/QPID-8632
>             Project: Qpid
>          Issue Type: Bug
>          Components: Python Client
>    Affects Versions: qpid-python-1.38.0
>            Reporter: Jiri Daněk
>            Priority: Blocker
>
> Circular imports in Python actually do work, and break only when one makes a 
> change that trips this potential minefield. One such change is Python 2/3 
> compatibility.
> What triggers the problem is the situation when two modules import each 
> other, _and_ the other module needs to be evaluated for the first import 
> (when evaluating the first module) to complete. See 
> https://stackoverflow.com/questions/744373/what-happens-when-using-mutual-or-circular-cyclic-imports
>  for discussion and examples.
> Picking solution that is compatible with Python 2 as well as Python 3 in the 
> future (QPID-8631) is tricky.
> {noformat}
> Traceback (most recent call last):
>   File "./qpid-python-test", line 29, in <module>
>     from qpid.harness import Skipped
>   File "/home/runner/work/qpid-python/qpid-python/qpid/__init__.py", line 20, 
> in <module>
>     from . import connection
>   File "/home/runner/work/qpid-python/qpid-python/qpid/connection.py", line 
> 29, in <module>
>     from . import delegates
>   File "/home/runner/work/qpid-python/qpid-python/qpid/delegates.py", line 
> 21, in <module>
>     from . import connection, session
> ImportError: cannot import name connection
> {noformat}
> {noformat}
> Traceback (most recent call last):
>   File "./qpid-python-test", line 30, in <module>
>     from qpid.harness import Skipped
>   File "/home/runner/work/qpid-python/qpid-python/qpid/__init__.py", line 21, 
> in <module>
>     from . import connection
>   File "/home/runner/work/qpid-python/qpid-python/qpid/connection.py", line 
> 21, in <module>
>     from . import datatypes, session
>   File "/home/runner/work/qpid-python/qpid-python/qpid/session.py", line 22, 
> in <module>
>     from .generator import command_invoker
>   File "/home/runner/work/qpid-python/qpid-python/qpid/generator.py", line 
> 23, in <module>
>     from .ops import *
>   File "/home/runner/work/qpid-python/qpid-python/qpid/ops.py", line 21, in 
> <module>
>     import os, mllib, sys
>   File "/home/runner/work/qpid-python/qpid-python/mllib/__init__.py", line 
> 27, in <module>
>     from . import dom, transforms, parsers
>   File "/home/runner/work/qpid-python/qpid-python/mllib/dom.py", line 34, in 
> <module>
>     from . import transforms
>   File "/home/runner/work/qpid-python/qpid-python/mllib/transforms.py", line 
> 25, in <module>
>     from . import dom
> ImportError: cannot import name dom
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to