-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashes if isort isn't installed #130
Comments
@martinRenou, I'm taking a look at this now. |
This is reproducible in any environment: $ pip uninstall -y isort
$ darker --help
Traceback (most recent call last):
File "bin/darker", line 33, in <module>
sys.exit(load_entry_point('darker', 'console_scripts', 'darker')())
File "bin/darker", line 25, in importlib_load_entry_point
return next(matches).load()
File "lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "darker/__main__.py", line 16, in <module>
from darker.import_sorting import apply_isort, isort
File "darker/import_sorting.py", line 22, in <module>
isort_code = getattr(isort, "code")
AttributeError: 'NoneType' object has no attribute 'code' |
I am fixing the conda package by adding a dependency on isort: conda-forge/darker-feedstock#2 What do you think? Do you think we should do the same in your |
@martinRenou, |
I see. So having the isort dependency would temporarily fix the conda package for 1.2.3, but I guess we should remove it once the bug is fixed? |
@martinRenou, when running the test suite, There are specific tests which mock |
conda-forge/darker-feedstock#1 fails with this error (in the Linux and OSX builds):
The text was updated successfully, but these errors were encountered: