Skip to content
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

pre-commit hook black isn't working on Ubuntu 22.04.3 #11566

Closed
mwallschlaeger opened this issue Oct 6, 2023 · 0 comments · Fixed by #11567
Closed

pre-commit hook black isn't working on Ubuntu 22.04.3 #11566

mwallschlaeger opened this issue Oct 6, 2023 · 0 comments · Fixed by #11567
Labels
code quality continuous integration CI, tests, coverage dependencies Pull requests that update a dependency file minor A low priority issue which might affect only some users and /or not the main functionality

Comments

@mwallschlaeger
Copy link
Member

Expected Behavior

I would expect that i can install the pre-commit hooks via:

pre-commit install
pre-commit install-hooks

and then run a commit to trigger the hooks.

Actual Behavior

But when running a git commit with installed commits I run into the following error:

❯ gcm "issue#10290_complete_ISO_contact_roles_per_ressource_base_with_multiplicity"
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check Yaml...........................................(no files to check)Skipped
Check for added large files..............................................Passed
black....................................................................Failed
- hook id: black
- exit code: 1

Traceback (most recent call last):
  File "/home/mwall/.cache/pre-commit/repoekbsguzy/py_env-python3/bin/black", line 8, in <module>
    sys.exit(patched_main())
  File "/home/mwall/.cache/pre-commit/repoekbsguzy/py_env-python3/lib/python3.10/site-packages/black.py", line 4134, in patched_main
    patch_click()
  File "/home/mwall/.cache/pre-commit/repoekbsguzy/py_env-python3/lib/python3.10/site-packages/black.py", line 4123, in patch_click
    from click import _unicodefun  # type: ignore
ImportError: cannot import name '_unicodefun' from 'click' (/home/mwall/.cache/pre-commit/repoekbsguzy/py_env-python3/lib/python3.10/site-packages/click/__init__.py)

This also referenced e.g. on stackoverflow

Steps to Reproduce the Problem

  1. install pre-commit hooks on a fresh system, i suppose

Specifications

  • GeoNode version: latest
  • Installation type (vanilla, geonode-project):
  • Installation method (manual, docker): dev environment
  • Platform: Ubuntu 22.04.3
  • Additional details:
@mwallschlaeger mwallschlaeger added minor A low priority issue which might affect only some users and /or not the main functionality dependencies Pull requests that update a dependency file continuous integration CI, tests, coverage code quality labels Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality continuous integration CI, tests, coverage dependencies Pull requests that update a dependency file minor A low priority issue which might affect only some users and /or not the main functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant