schollii / pypubsub

A Python publish-subcribe library (moved here from SourceForge.net where I had it for many years)
189 stars 29 forks source link

Running tests on 3.3.0 #16

Closed TheChymera closed 5 years ago

TheChymera commented 5 years ago

I am looking to package your software for Gentoo Linux. Iorder to maintain Python2/3 compatibility I have opted to start with the older verison:

The tests fail with this log.

The issue seems to be the following:

ImportError: cannot import name policies

It is also a relative import, so I assume it should be somewhere in the directory tree of the package, however, I cannot locate this file. Can you help me out?

The tests are being run with nosetests -v || die.

TheChymera commented 5 years ago

@schollii , so it really seems to me like your 3.3.0 archive is incomplete. Either that or I was unable to locate some crucial install instructions. I tried to patch it together, seeing as I can obtain all missing files from: https://github.com/schollii/pypubsub/archive/c6adca35967db428fbed05086767687ce72baf7a.tar.gz

But up until now this hasn't worked out. Particularly the relative imports are difficult to untangle.

schollii commented 5 years ago

Policies.py is in the .tgz. Do you have src on your PYTHONPATH? Relative imports work only on packages.

TheChymera commented 5 years ago

@schollii these are the files you distribute as part of the 3.3.0 tgz:

.
├── docs
│   ├── about.rst
│   ├── changelog.rst
│   ├── conf.py
│   ├── development
│   │   ├── dev_index.rst
│   │   ├── py2exe.rst
│   │   ├── setup-cxfreeze.py
│   │   ├── setup-py2exe.py
│   │   ├── sphinx_patch1.txt
│   │   ├── sphinx_patch2.txt
│   │   └── testpubsub.py
│   ├── index_redirect.php
│   ├── index.rst
│   ├── installation.rst
│   ├── make.bat
│   ├── Makefile
│   ├── pubsub_concept.png
│   └── usage
│       ├── core_classes.rst
│       ├── helloworld.py
│       ├── howtos
│       │   ├── arg1_to_kwargs.rst
│       │   ├── index.rst
│       │   └── upgrade_v1tov3.rst
│       ├── index.rst
│       ├── module_pub.rst
│       ├── module_utils.rst
│       ├── reference.rst
│       ├── setup_modules.rst
│       ├── types_of_errors.rst
│       ├── usage_advanced_debug.rst
│       ├── usage_advanced_maintain.rst
│       ├── usage_advanced_other.rst
│       ├── usage_advanced.rst
│       ├── usage_basic.rst
│       └── usage_basic_tasks.rst
├── examples
│   ├── advanced
│   │   ├── arg1_listeners.py
│   │   ├── arg1_senders.py
│   │   ├── arg1_topics_out.py
│   │   ├── arg1_topics.py
│   │   ├── exchandle.py
│   │   ├── kwargs_listeners.py
│   │   ├── kwargs_senders.py
│   │   ├── kwargs_topics_out.py
│   │   ├── kwargs_topics.py
│   │   ├── main_arg1.py
│   │   ├── main_kwargs.py
│   │   ├── notifhandle.py
│   │   └── README.txt
│   ├── basic_arg1
│   │   ├── console_listeners.py
│   │   ├── console_main.py
│   │   ├── console_senders.py
│   │   ├── README.txt
│   │   └── wx_main.py
│   ├── basic_kwargs
│   │   ├── console_listeners.py
│   │   ├── console_main.py
│   │   ├── console_senders.py
│   │   ├── README.txt
│   │   ├── wx_main.py
│   │   ├── wx_win1.py
│   │   └── wx_win2.py
│   ├── multithreadloop.py
│   ├── runall.bat
│   └── runall_regression.txt
├── ez_setup.py
├── MANIFEST.in
├── README.txt
├── README_WxPython.txt
├── release.bat
├── setup.py
├── src
│   ├── contrib
│   │   ├── netpubsub.py
│   │   └── wx_monitor.py
│   └── pubsub
│       ├── core
│       │   ├── callables.py
│       │   ├── __init__.py
│       │   ├── listener.py
│       │   ├── notificationmgr.py
│       │   ├── topicargspec.py
│       │   ├── topicdefnprovider.py
│       │   ├── topicexc.py
│       │   ├── topicmgr.py
│       │   ├── topicobj.py
│       │   ├── topictreetraverser.py
│       │   ├── topicutils.py
│       │   └── weakmethod.py
│       ├── __init__.py
│       ├── LICENSE_BSD_Simple.txt
│       ├── pub.py
│       ├── RELEASE_NOTES.txt
│       └── utils
│           ├── exchandling.py
│           ├── __init__.py
│           ├── misc.py
│           ├── notification.py
│           ├── topictreeprinter.py
│           └── xmltopicdefnprovider.py
├── tests
│   ├── config_no_auto
│   │   ├── testsel_arg1.py
│   │   ├── testsel_default.py
│   │   └── testsel_kwargs.py
│   ├── perf_filter.py
│   ├── perf.py
│   ├── profile10000Py27.txt
│   ├── profile10000Py33.txt
│   ├── pubsub_arg1
│   │   └── test_arg1.py
│   ├── pubsub_kwargs
│   │   ├── my_import_topics.py
│   │   ├── raisinglistener.py
│   │   ├── test1_listener.py
│   │   ├── test2a_topic.py
│   │   ├── test2b_topicmgr.py
│   │   ├── test2c_notify2.py
│   │   ├── test2c_notify.py
│   │   ├── test2d_except.py
│   │   ├── test2_spec.py
│   │   ├── test3c_pubsub3.py
│   │   ├── test3d_defaultlog.py
│   │   ├── test4_provider.py
│   │   ├── test4_prov_module_expect.py
│   │   ├── test5_xmlprovider.py
│   │   └── xmlprovider_topics.xml
│   ├── py24.patch
│   ├── py27and33compare.xlsx
│   ├── readme.txt
│   ├── runperf.bat
│   ├── runtests.bat
│   ├── test4_prov_module_actual.py
│   └── trans_arg1_to_kwargs
│       ├── test_trans_step_1.py
│       ├── test_trans_step_2.py
│       ├── test_trans_step_3.py
│       ├── test_trans_step_4.py
│       └── test_trans_step_5.py
├── tox-cov.ini
└── tox.ini

18 directories, 127 files

Both policies.py and py2and3.py (and many other files from which the package attempts to import, e.g. treeeconfig) are missing. Where should I get them from? Or could you update the archive to include them?

schollii commented 5 years ago

So I didn't realize you downloaded from github, you're right the ones in github releases are incomplete. Please download from pypi, I checked that the .zip is fine. You should be able to use the zip on linux, or better, use the egg (pip install handles eggs). I'll try to replace the ones in github by the ones in pypi.

schollii commented 5 years ago

So I added the pypi files to github releases page. If you need the whole source for 3.3, use the _pypi.zip and the other 2 are not good. For release 4.0, use the wheel (ideally from pypi), but if you need the full source including unit tests, use the Source code .zip.

TheChymera commented 5 years ago

Ok, I got the 3.3.0 sources from PYPI, sadly I cannot find any test suite on it:

├── ez_setup.py
├── MANIFEST.in
├── PKG-INFO
├── README.txt
├── README_WxPython.txt
├── setup.cfg
├── setup.py
└── src
    ├── pubsub
    │   ├── core
    │   │   ├── arg1
    │   │   │   ├── __init__.py
    │   │   │   ├── listenerimpl.py
    │   │   │   ├── publishermixin.py
    │   │   │   ├── publisher.py
    │   │   │   ├── topicargspecimpl.py
    │   │   │   └── topicmgrimpl.py
    │   │   ├── callables.py
    │   │   ├── imp2.py
    │   │   ├── __init__.py
    │   │   ├── itopicdefnprovider.py
    │   │   ├── kwargs
    │   │   │   ├── datamsg.py
    │   │   │   ├── __init__.py
    │   │   │   ├── listenerimpl.py
    │   │   │   ├── publishermixin.py
    │   │   │   ├── publisher.py
    │   │   │   ├── topicargspecimpl.py
    │   │   │   └── topicmgrimpl.py
    │   │   ├── listenerbase.py
    │   │   ├── listener.py
    │   │   ├── notificationmgr.py
    │   │   ├── publisherbase.py
    │   │   ├── topicargspec.py
    │   │   ├── topicdefnprovider.py
    │   │   ├── topicexc.py
    │   │   ├── topicmgr.py
    │   │   ├── topicobj.py
    │   │   ├── topictreetraverser.py
    │   │   ├── topicutils.py
    │   │   ├── treeconfig.py
    │   │   ├── validatedefnargs.py
    │   │   └── weakmethod.py
    │   ├── __init__.py
    │   ├── LICENSE_BSD_Simple.txt
    │   ├── policies.py
    │   ├── pub.py
    │   ├── py2and3.py
    │   ├── RELEASE_NOTES.txt
    │   ├── setuparg1.py
    │   ├── setupkwargs.py
    │   └── utils
    │       ├── exchandling.py
    │       ├── __init__.py
    │       ├── misc.py
    │       ├── notification.py
    │       ├── topictreeprinter.py
    │       └── xmltopicdefnprovider.py
    └── PyPubSub.egg-info
        ├── dependency_links.txt
        ├── not-zip-safe
        ├── PKG-INFO
        ├── SOURCES.txt
        └── top_level.txt
TheChymera commented 5 years ago

@schollii any ideas? Not using the package directly, running some tests is important so that I can ascertain that it can perform its functions correctly for other packages.

schollii commented 5 years ago

Sorry for the delayed response. What I meant is that, for 3.3.0, if you want the full source with tests, use https://github.com/schollii/pypubsub/archive/v3.3.0.zip.

Stips123 commented 5 years ago

It wasn't working with the 3.3 file, so I used the 3.4 on github, this works now https://github.com/schollii/pypubsub/tree/v3.4.0

schollii commented 5 years ago

@stips123 thx for update, yes that's why I created the 3.4 branch so that's good to know. Do you mind sharing on what platform you ran the test suite? Runs fine on Ubuntu and Windows but having issue on Gentoo (see #34).