Skip to content

Commit bb521c1

Browse files
authored
Skip source-inspector installation on darwin arm64 (not compatible) (#1205)
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent b242781 commit bb521c1

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

scanpipe/pipes/symbols.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
from django.db.models import Q
2424

2525
from source_inspector import symbols_ctags
26-
from source_inspector import symbols_pygments
27-
from source_inspector import symbols_tree_sitter
2826

2927
from scanpipe.pipes import LoopProgress
3028

@@ -98,6 +96,8 @@ def _collect_and_store_pygments_symbols_and_strings(resource):
9896
Collect symbols, strings and comments from a resource using pygments and store
9997
them in the extra data field.
10098
"""
99+
from source_inspector import symbols_pygments
100+
101101
result = symbols_pygments.get_pygments_symbols(resource.location)
102102
resource.update_extra_data(
103103
{
@@ -113,6 +113,8 @@ def collect_and_store_tree_sitter_symbols_and_strings(project, logger=None):
113113
Collect symbols from codebase files using tree-sitter and store
114114
them in the extra data field.
115115
"""
116+
from source_inspector import symbols_tree_sitter
117+
116118
project_files = project.codebaseresources.files()
117119

118120
language_qs = Q()
@@ -137,9 +139,11 @@ def collect_and_store_tree_sitter_symbols_and_strings(project, logger=None):
137139

138140
def _collect_and_store_tree_sitter_symbols_and_strings(resource):
139141
"""
140-
Collect symbols ans string from a resource using tree-sitter and store
142+
Collect symbols and string from a resource using tree-sitter and store
141143
them in the extra data field.
142144
"""
145+
from source_inspector import symbols_tree_sitter
146+
143147
result = symbols_tree_sitter.get_treesitter_symbols(resource.location)
144148
resource.update_extra_data(
145149
{

scanpipe/tests/pipes/test_symbols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
from scanpipe.pipes.input import copy_input
3434

3535

36+
@skipIf(sys.platform == "darwin", "Not supported on macOS")
3637
class ScanPipeSymbolsPipesTest(TestCase):
3738
data_location = Path(__file__).parent.parent / "data"
3839

3940
def setUp(self):
4041
self.project1 = Project.objects.create(name="Analysis")
4142

42-
@skipIf(sys.platform == "darwin", "Not supported on macOS")
4343
def test_scanpipe_pipes_symbols_collect_and_store_resource_symbols(self):
4444
dir = self.project1.codebase_path / "codefile"
4545
dir.mkdir(parents=True)

scanpipe/tests/test_pipelines.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,7 @@ def test_scanpipe_collect_source_strings_pipeline_integration(self):
12781278
]
12791279
self.assertCountEqual(expected_extra_data_strings, result_extra_data_strings)
12801280

1281+
@skipIf(sys.platform == "darwin", "Not supported on macOS")
12811282
def test_scanpipe_collect_pygments_symbols_pipeline_integration(self):
12821283
pipeline_name = "collect_pygments_symbols"
12831284
project1 = Project.objects.create(name="Analysis")
@@ -1308,6 +1309,7 @@ def test_scanpipe_collect_pygments_symbols_pipeline_integration(self):
13081309

13091310
self.assertDictEqual(expected_extra_data, result_extra_data)
13101311

1312+
@skipIf(sys.platform == "darwin", "Not supported on macOS")
13111313
def test_scanpipe_collect_tree_sitter_symbols_pipeline_integration(self):
13121314
pipeline_name = "collect_tree_sitter_symbols"
13131315
project1 = Project.objects.create(name="Analysis")

setup.cfg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ install_requires =
6464
# wait_for_database Django management command
6565
django-probes==1.7.0
6666
# Task queue
67-
rq==1.16.1
67+
rq==1.16.2
6868
django-rq==2.10.2
69-
redis==5.0.3
69+
redis==5.0.4
7070
# WSGI server
7171
gunicorn==22.0.0
7272
# Docker
@@ -81,7 +81,7 @@ install_requires =
8181
elf-inspector==0.0.1
8282
go-inspector==0.2.2
8383
python-inspector==0.12.0
84-
source-inspector==0.5.0
84+
source-inspector==0.5.0; sys_platform != "darwin" and platform_machine != "arm64"
8585
aboutcode-toolkit==10.1.0
8686
# Utilities
8787
XlsxWriter==3.2.0
@@ -91,8 +91,8 @@ install_requires =
9191
# Profiling
9292
pyinstrument==4.6.2
9393
# CycloneDX
94-
cyclonedx-python-lib==7.3.0
95-
jsonschema==4.21.1
94+
cyclonedx-python-lib==7.3.2
95+
jsonschema==4.22.0
9696
# Font Awesome
9797
fontawesomefree==6.5.1
9898
# MatchCode-toolkit
@@ -107,7 +107,7 @@ install_requires =
107107
dev =
108108
# Validation
109109
flake8==7.0.0
110-
black==24.4.0
110+
black==24.4.2
111111
isort==5.13.2
112112
doc8==1.1.1
113113
pydocstyle==6.3.0

0 commit comments

Comments
 (0)