Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CFG_ROOT_DIR="$( cd "$( dirname "${CFG_BIN}" )" && pwd )"

CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin

# force relaunching under X86-64 architecture on macOS M1/ARM
# force relaunching under X86-64 architecture on macOS M1/ARM
if [[ $OSTYPE == 'darwin'* && $(uname -m) == 'arm64' && $(sysctl -in sysctl.proc_translated) == 0 ]]; then
arch -x86_64 /bin/bash -c "$CFG_ROOT_DIR/configure $*"
exit $?
Expand Down Expand Up @@ -253,7 +253,6 @@ install_packages() {
# be reinstalled a second time and reused from the virtualenv and this
# speeds up the installation.
# We always have the PEP517 build dependencies installed already.

"$CFG_BIN_DIR/pip" install \
--upgrade \
--no-build-isolation \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ include = [
"."

]
# ignore test data and testfiles: they should never be linted nor formatted
# ignore test data and testfiles: they should never be linted nor formatted
exclude = [
# main style
"**/tests/data/**/*",
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ install_requires =
typecode >= 30.0.1
typecode[full] >= 30.0.1
extractcode[full] >= 31.0.0
cyseq; platform_system == 'Linux'


[options.packages.find]
Expand Down
8 changes: 7 additions & 1 deletion src/licensedcode/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@
from licensedcode import match_spdx_lid
from licensedcode import match_unknown
from licensedcode.dmp import match_blocks as match_blocks_dmp
from licensedcode.seq import match_blocks as match_blocks_seq
from licensedcode import query
from licensedcode import tokenize
from licensedcode.spans import Span
from typing import NamedTuple
from typing import Callable

try:
# Use Cython seq.py implementation
from cyseq import match_blocks as match_blocks_seq
except ImportError:
# Use Python seq.py if it is not available
from licensedcode.seq import match_blocks as match_blocks_seq

"""
Main license index construction, query processing and matching entry points for
license detection.
Expand Down
7 changes: 6 additions & 1 deletion src/licensedcode/match_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def match_sequence(
return []

if not match_blocks:
from licensedcode.seq import match_blocks
try:
# Use Cython seq.py implementation
from cyseq import match_blocks
except ImportError:
# Use Python seq.py if it is not available
from licensedcode.seq import match_blocks

rid = rule.rid
itokens = idx.tids_by_rid[rid]
Expand Down
Loading