aboutcode-org / aboutcode-org/scancode-toolkit

Accesses gemfileparser which is not installed

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

説明

### Description

Installation of scancode-toolkit using pip (version 32.2.1) also installs gemfileparser2, but code still depends on gemfileparser, which is not installed automatically.
File `spec.py` imports from `gemfileparser`, not from `gemfileparser2`.

### How To Reproduce

In a python environment with all the necessary OS libraries, e. g. a docker container for image python:3.9-slim:

```
# I started in a directory /app
# mkdir /app
# cd /app

python -m venv venv-scancode
. venv-scancode/bin/activate
pip install --upgrade pip
pip install wheel
pip install scancode-toolkit

./venv-scancode/bin/scancode --example
```

Results in

```
========================================================================
ERROR: UNABLE TO IMPORT SCANCODE PLUGINS.
Check your installation configuration (setup.py) or re-install/re-configure ScanCode.
The following plugin(s) are referenced and cannot be loaded/imported:
No module named 'gemfileparser'
========================================================================
Traceback (most recent call last):
File "/app/./venv-scancode/bin/scancode", line 5, in
from scancode.cli import scancode
File "/app/venv-scancode/lib/python3.9/site-packages/scancode/cli.py", line 126, in
raise e
File "/app/venv-scancode/lib/python3.9/site-packages/scancode/cli.py", line 113, in
plugin_classes, plugin_options = PluginManager.load_plugins()
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 196, in load_plugins
mgr_setup = manager.setup()
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 222, in setup
raise e
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 220, in setup
self.manager.load_setuptools_entrypoints(entrypoint)
File "/app/venv-scancode/lib/python3.9/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
plugin = ep.load()
File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load
module = import_module(match.group('module'))
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/__init__.py", line 24, in
from packagedcode import cocoapods
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/cocoapods.py", line 21, in
from packagedcode import spec
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/spec.py", line 12, in
from gemfileparser import GemfileParser
ModuleNotFoundError: No module named 'gemfileparser'
```

After

```
pip install gemfileparser
```

calling scancode again succeeds.

### System configuration

* Linux
* scancode-toolkit version 32.2.1
* installation method pip

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

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

評価

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

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

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