You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When following the contribution guidelines, I installed all dependencies and ran the pre-commit hook when working on my PR (#1145). The pre-commit hook failed when committing due to an import error. I manually moved an older version of the click package in order to get the hook to work.
Steps/Code to Reproduce
Follow the contribution guidelines (pip install -e .[test], pre-commit install). Then commit a change.
Expected Results
No import error is thrown when running the pre-commit hook.
Actual Results
An import error is thrown when running the pre-commit hook.
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/chad/.cache/pre-commit/patch1656209125-53395.
black....................................................................Failed
- hook id: black
- exit code: 1
Traceback (most recent call last):
File "/home/chad/.cache/pre-commit/repo9hzu_n53/py_env-python3/bin/black", line 8, in <module>
sys.exit(patched_main())
File "/home/chad/.cache/pre-commit/repo9hzu_n53/py_env-python3/lib/python3.8/site-packages/black.py", line 4134, in patched_main
patch_click()
File "/home/chad/.cache/pre-commit/repo9hzu_n53/py_env-python3/lib/python3.8/site-packages/black.py", line 4123, in patch_click
from click import _unicodefun # type: ignore
ImportError: cannot import name '_unicodefun' from 'click' (/home/chad/.cache/pre-commit/repo9hzu_n53/py_env-python3/lib/python3.8/site-packages/click/__init__.py)
mypy openml..............................................................Passed
mypy tests...........................................(no files to check)Skipped
flake8 openml............................................................Passed
flake8 tests.........................................(no files to check)Skipped
[INFO] Restored changes from /home/chad/.cache/pre-commit/patch1656209125-53395.
Thanks for the report. I agree to the suggested change. I will look at bumping the black version myself to ensure there are no undesired changes in formatting.
Description
When following the contribution guidelines, I installed all dependencies and ran the pre-commit hook when working on my PR (#1145). The pre-commit hook failed when committing due to an import error. I manually moved an older version of the
click
package in order to get the hook to work.Steps/Code to Reproduce
Follow the contribution guidelines (
pip install -e .[test]
,pre-commit install
). Then commit a change.Expected Results
No import error is thrown when running the pre-commit hook.
Actual Results
An import error is thrown when running the pre-commit hook.
Versions
Comments
This appears to be the issue: https://stackoverflow.com/questions/71673404/importerror-cannot-import-name-unicodefun-from-click So it seems updating
black
in the pre-commit hook would fix the issue.The text was updated successfully, but these errors were encountered: