apieum / weakreflist

sources of weakref Lists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Importing WeakList requires weakreflist.weakreflist, not weakreflist

kamakazikamikaze opened this issue · comments

Your example shows:

from weakreflist import WeakList

However, when the package is installed via pip the path is changed slightly:

from weakreflist.weakreflist import WeakList

The following demonstrates this from my system:

$ lsb_release -a
Distributor ID:	ubilinux
Description:	ubilinux 3.0 for the UP board
Release:	3.0
Codename:	woody

$ pip install weakreflist
Downloading/unpacking weakreflist
  Downloading weakreflist-0.3.1.tar.gz
  Running setup.py (path:/tmp/pip-build-yErzN9/weakreflist/setup.py) egg_info for package weakreflist
Installing collected packages: weakreflist
  Running setup.py install for weakreflist
Successfully installed weakreflist
Cleaning up...

$ python
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from weakreflist import WeakList
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name WeakList
>>> from weakreflist.weakreflist import WeakList
>>> WeakList
<class 'weakreflist.weakreflist.WeakList'>

Sorry nvm previous comment, I've understood, documentation is set for master (0.4 version) which is not published as I had no feedback (see #3 ).
WeakList was not exported through __all__.

You've got 3 solutions to fix your issue by order of preference:

  • you install it from git
  • you wait I publish 0.4
  • you use old fashion import which will remain compatible with new version

I've looked at the diff and cloned the repo. Is there anything I can do to help publish 0.4?

I'm going to publish it, if you have feedback or want a change, feel free it's the right time ;)

I'm looking through it and my IDE is giving a few warnings about PEP8 and some imports. Would it be okay if I resolved them and made a pull request for minor changes?

Of course, great !!!

Just one thing I don't respect some pep8 like "E501 line too long" (but I avoid lines over 120 char)...

I'll publish your changes to 0.4.1

Good to know! PEP8 is just a suggested style guide. I'll keep the line limit to 120. Once I make the pull request, I can revise any edits made so that wording/styling adheres to the standards that you want to have set for the project.

I forgot to add in an edit: the current status of the project looks good; I'll run tests on OS X, Windows, and Linux just to be safe :D

Awesome !!! Thanks a lot for your help 👍
Version 0.4 is published now thanks to you, as it fixes this issue I close it.
If you need something more, it'll be my pleasure to publish it.

Some of the files use both single- and double-quoted strings. Would it be okay if I made them consistent throughout the project? If so, which quotes would you prefer?