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

python-lz4 2.1 is broken, again #1929

Closed
totaam opened this issue Aug 4, 2018 · 3 comments
Closed

python-lz4 2.1 is broken, again #1929

totaam opened this issue Aug 4, 2018 · 3 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Aug 4, 2018

on win32 clean install:

Traceback (most recent call last):
  File "E:\Xpra\trunk\src\dist/lib/xpra/net/compression.py", line 24, in <module>
    import lz4
  File "C:/msys64/mingw64/lib/python2.7/site-packages/lz4-2.1.0-py2.7-mingw.egg/lz4/__init__.py", line 8, in <module>
    VERSION = __version__
NameError: name '__version__' is not defined
@totaam
Copy link
Collaborator Author

totaam commented Aug 6, 2018

So, it turns out (unsurprisingly) that python-lz4 has changed how it gets its version information yet again - I can't remember if it's 3rd or 4th time now. And when it doesn't get its version number, the whole library fails to load!

For such a small and simple wrapper library, the number of releases and constant needless breakage is shocking.

Here's what it does now:

from pkg_resources import get_distribution, DistributionNotFound
try:
    __version__ = get_distribution(__name__).version
except DistributionNotFound:
    # package is not installed
    pass

And here's what I replaced it with to get on with more productive things:

    # package is not installed
    __version__ = "2.1.0"

Let's try to deal with this in #1883 so this won't break again next time there is an update.

@totaam totaam closed this as completed Aug 6, 2018
@totaam
Copy link
Collaborator Author

totaam commented Aug 23, 2018

r20171 fixes the packaging for macos by adding the patch to jhbuild.

@totaam
Copy link
Collaborator Author

totaam commented Nov 4, 2018

For reference, here are some other instances of python-lz4 gratuitous breakage: #1464, #960

The import problem has been resolved, there were other reasons for avoiding pkg_resources: Importing lz4 is very slow

We now use version 2.1.2: r20928.

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

1 participant