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

Maximize portability by using fallback pure-python libraries #3210

Open
pombredanne opened this issue Jan 19, 2023 · 2 comments · May be fixed by #3476
Open

Maximize portability by using fallback pure-python libraries #3210

pombredanne opened this issue Jan 19, 2023 · 2 comments · May be fixed by #3476

Comments

@pombredanne
Copy link
Member

pombredanne commented Jan 19, 2023

We have at times some portability issues as ScanCode depends on a few performance-critical libraries that use native C code. These require specific pre-built wheels or a toolchain that may not be available on a user's machine.

We could maximize portability by using fallback pure-python libraries for these libraries. For basic features in scancode-toolkit-mini, these would be pyahocorasick and intbitset. Both are libraries that we maintain.

We should have a degraded, not-as-fast but pure Python variants of these libraries so that we can install without these native dependencies, e.g. some scancode-toolkit variant that would be pure Python. This would help also towards running in the browser.

key libraries

  • pyahocorasick: could expand the built-in simpler pure python implementation to implment the pyahocorasick APIs
  • intbitset: could roll out a simple set-based fallback
  • lxml (and other libs based on it such as xmldict): could use stdlib xml.etree instead

For lxml there are common idioms such as:

    try:
        from lxml import etree
    except ImportError:
        import xml.etree.ElementTree as etree
@suraj-mandal
Copy link

Hi! @pombredanne I would like to contribute towards this issue as part of Google GSoC program 2023. I am going through the entire code repository. I have fair knowledge about python and I am well versed with data structures and algorithms. Can you help me out in proceeding with the issue?

Thanks!

@amberjain10
Copy link

Hi @pombredanne . I am looking forward to contribute for this issue for GSOC 2023. Can you please help me to proceed ahead

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

Successfully merging a pull request may close this issue.

3 participants