diff --git a/setup.cfg b/setup.cfg index abaaa0fc497..e79f05573a0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -65,7 +65,9 @@ python_requires = >=3.7 install_requires = attrs >= 18.1,!=20.1.0;python_version<'3.11' attrs >= 22.1.0;python_version>='3.11' + ahocode-test >= 1.0.0 Beautifulsoup4 >= 4.0.0 + test-bitcode-alt >= 0.0.1 boolean.py >= 4.0 chardet >= 3.0.0 click >= 6.7, !=7.0 @@ -80,7 +82,7 @@ install_requires = gemfileparser2 >= 0.9.0 html5lib importlib_metadata - intbitset >= 3.0.2 +; intbitset >= 3.0.2 jaraco.functools javaproperties >= 0.5 jinja2 >= 2.7.0 @@ -99,7 +101,7 @@ install_requires = pluggy >= 1.0.0 plugincode >= 32.0.0 publicsuffix2 - pyahocorasick >= 2.0.0 +; pyahocorasick >= 2.0.0 pygmars >= 0.7.0 pygments pymaven_patch >= 0.2.8 diff --git a/src/licensedcode/index.py b/src/licensedcode/index.py index 267a15f47be..5c8b1744c0a 100644 --- a/src/licensedcode/index.py +++ b/src/licensedcode/index.py @@ -17,7 +17,10 @@ import sys from time import time -from intbitset import intbitset +try: + from intbitset import intbitset +except ImportError: + from bitcode.bitcode import intbitset from licensedcode import SMALL_RULE from licensedcode import TINY_RULE diff --git a/src/licensedcode/match_aho.py b/src/licensedcode/match_aho.py index 7a46821a31e..59226b9acf1 100644 --- a/src/licensedcode/match_aho.py +++ b/src/licensedcode/match_aho.py @@ -9,7 +9,10 @@ from itertools import groupby -import ahocorasick +try: + import ahocorasick +except ImportError: + import ahocode.ahocode as ahocorasick from licensedcode import SMALL_RULE from licensedcode.match import LicenseMatch diff --git a/src/licensedcode/match_set.py b/src/licensedcode/match_set.py index 105eeb9319e..f79b71a0939 100644 --- a/src/licensedcode/match_set.py +++ b/src/licensedcode/match_set.py @@ -12,7 +12,10 @@ from functools import partial from itertools import groupby -from intbitset import intbitset +try: + from intbitset import intbitset +except ImportError: + from bitcode.bitcode import intbitset from licensedcode.tokenize import ngrams diff --git a/src/licensedcode/match_unknown.py b/src/licensedcode/match_unknown.py index b83a62a01e0..d0414d0b25a 100644 --- a/src/licensedcode/match_unknown.py +++ b/src/licensedcode/match_unknown.py @@ -7,7 +7,10 @@ # See https://aboutcode.org for more information about nexB OSS projects. # -import ahocorasick +try: + import ahocorasick +except ImportError: + import ahocode.ahocode as ahocorasick from licensedcode import tokenize from licensedcode.models import UnknownRule diff --git a/src/licensedcode/query.py b/src/licensedcode/query.py index c0fc20d6339..cef4f228024 100644 --- a/src/licensedcode/query.py +++ b/src/licensedcode/query.py @@ -15,7 +15,10 @@ from functools import partial from itertools import chain -from intbitset import intbitset +try: + from intbitset import intbitset +except ImportError: + from bitcode.bitcode import intbitset import typecode diff --git a/src/licensedcode/spans.py b/src/licensedcode/spans.py index 2b0348b9832..e15acdfc3f5 100644 --- a/src/licensedcode/spans.py +++ b/src/licensedcode/spans.py @@ -31,7 +31,10 @@ from itertools import count from itertools import groupby -from intbitset import intbitset +try: + from intbitset import intbitset +except ImportError: + from bitcode.bitcode import intbitset """ Ranges and intervals of integers using bitmaps.