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

Optionally support LZO via workspaces #52

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

milesgranger
Copy link
Owner

@milesgranger milesgranger commented Apr 2, 2021

Replaces #51 and will close #41

Blocked by PyO3/pyo3#1444

Can optionally support LZO and maintain MIT license by packaging that as a separate wheel/distribution and then attempting to import and assign it as a submodule into cramjam.lzo if the user has chosen to install it. However, presently pyclass objects cannot be used across packages; python thinks they are different objects. What that means for us, is

>>> from cramjam import Buffer
>>> from cramjam import lzo  # same as `import cramjam_lzo as lzo`, fails if the user hasn't installed `cramjam_lzo` separately. 

# thinks it can't be converted into a type it actually is
>>> lzo.compress(Buffer(b'bytes'))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    lzo.compress(Buffer(b'bytes'))
TypeError: 'Buffer' object cannot be converted to 'Union[bytes, bytearray, numpy, File, Buffer]'

# cramjam_lzo gives back a Buffer, which isn't evaluated  to be the same as cramjam.Buffer
>>> out = lzo.compress(b'bytes')
>>> out
cramjam.Buffer(len=14)
>>> isinstance(out, Buffer)
False
>>> 

@milesgranger milesgranger changed the title Workspaces Optionally support LZO via workspaces Apr 2, 2021
@milesgranger milesgranger mentioned this pull request Apr 1, 2023
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

Successfully merging this pull request may close these issues.

Add LZO
1 participant