aboutcode-org / aboutcode-org/scancode-toolkit

Maximize portability by using fallback pure-python libraries

オープン
#3,210 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
installation and packaging new feature
主要言語
Python
スター
2.6k
フォーク
791
平均マージ
1日 12時間
マージ済み PR(30日)
5

説明

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
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。