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

wx.lib.pubsub submodules #932

Closed
swt2c opened this Issue Jul 17, 2018 · 8 comments

Comments

Projects
None yet
2 participants
@swt2c
Copy link
Contributor

swt2c commented Jul 17, 2018

Are wx.lib.pubsub submodule imports still supposed to work?

______________ ERROR collecting unittests/test_lib_pubsub_api3.py ______________
ImportError while importing test module '/builddir/build/BUILD/python-wxpython4-4.0.3/python3/unittests/test_lib_pubsub_api3.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
unittests/test_lib_pubsub_api3.py:14: in
from wx.lib.pubsub.core import getListenerID
E ModuleNotFoundError: No module named 'wx.lib.pubsub.core'
___________ ERROR collecting unittests/test_lib_pubsub_defaultlog.py ___________
ImportError while importing test module '/builddir/build/BUILD/python-wxpython4-4.0.3/python3/unittests/test_lib_pubsub_defaultlog.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
unittests/test_lib_pubsub_defaultlog.py:12: in
from wx.lib.pubsub.utils import notification
E ModuleNotFoundError: No module named 'wx.lib.pubsub.utils'
____________ ERROR collecting unittests/test_lib_pubsub_listener.py ____________
ImportError while importing test module '/builddir/build/BUILD/python-wxpython4-4.0.3/python3/unittests/test_lib_pubsub_listener.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
unittests/test_lib_pubsub_listener.py:12: in
from wx.lib.pubsub.core.weakmethod import WeakMethod
E ModuleNotFoundError: No module named 'wx.lib.pubsub.core'
______________ ERROR collecting unittests/test_lib_pubsub_spec.py ______________
ImportError while importing test module '/builddir/build/BUILD/python-wxpython4-4.0.3/python3/unittests/test_lib_pubsub_spec.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
unittests/test_lib_pubsub_spec.py:12: in
from wx.lib.pubsub.core.topicargspec import (
E ModuleNotFoundError: No module named 'wx.lib.pubsub.core'
_____________ ERROR collecting unittests/test_lib_pubsub_topic.py ______________
ImportError while importing test module '/builddir/build/BUILD/python-wxpython4-4.0.3/python3/unittests/test_lib_pubsub_topic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
unittests/test_lib_pubsub_topic.py:12: in
from wx.lib.pubsub.core.topicobj import Topic
E ModuleNotFoundError: No module named 'wx.lib.pubsub.core'
____________ ERROR collecting unittests/test_lib_pubsub_topicmgr.py ____________
ImportError while importing test module '/builddir/build/BUILD/python-wxpython4-4.0.3/python3/unittests/test_lib_pubsub_topicmgr.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
unittests/test_lib_pubsub_topicmgr.py:12: in
from wx.lib.pubsub.pub import (
E ModuleNotFoundError: No module named 'wx.lib.pubsub.pub'

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jul 18, 2018

I guess not.

I was thinking at one time that we could still make them work by importing from the real pubsub.{submodule} but with pubsub v4.0.0+ only working with Python3 I expect it would be too fragile to keep things working with more than one version.

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jul 18, 2018

If anybody cares to take on figuring out some import magic to map all the wx.lib.pubsub module and subpackage names to the real pypubsub package, and that works for both Python2.7/pypubsub-3.3.0 and Python3/pypubsub-4.0.0+ let me know. Otherwise we can merge the PR.

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Jul 18, 2018

Is wx.lib.pubsub.* considered part of the wxPython API though? If so, then we really ought to fix this as these modules have disappeared since 4.0.1.

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jul 19, 2018

That's a good question. What are your thoughts?

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Jul 19, 2018

Well, I'm aware of at least one open source app (Taskcoach) that uses it. I suppose you could make a statement that wx.lib.pubsub is deprecated in Phoenix, though, and tell users they have to port to the standalone package if they need it as part of porting to Phoenix.

I might try to make the imports work, though, if I get the time.

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jul 19, 2018

Okay, here's a new PR that restores wx.lib.pubsub, updates it to 3.3.0, and adds an actual deprecation warning upon import.

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Jul 19, 2018

I like that solution! 👍

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jul 21, 2018

Fixed by #938

@RobinD42 RobinD42 closed this Jul 21, 2018

ioerger pushed a commit to mad-lab/transit that referenced this issue Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment