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

Updating black 20.8b1 -> 24.4.2 #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MatrixManAtYrService
Copy link

@MatrixManAtYrService MatrixManAtYrService commented Jul 7, 2024

This repo showed up on my radar because I am working on a change to how pre-commit is packaged in nixpkgs. Initially I thought that this repo might shed some light on my change. After some tinkering I don't think it does.

As part of that tinkering, I found black version 20.8b1 (which this repo uses) to be problematic. I get errors like:

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

Or

Traceback (most recent call last):
  File "/home/matt/.cache/pre-commit/repo39t99lks/py_env-python3/bin/black", line 5, in <module>
    from black import patched_main
  File "/home/matt/.cache/pre-commit/repo39t99lks/py_env-python3/lib/python3.12/site-packages/black/__init__.py", line 17, in <module>
    import regex as re
  File "/nix/store/0vrssa56zbmfvsc7f4c9ji6yyxx2qgyx-python3.11-regex-2023.12.25/lib/python3.11/site-packages/regex/__init__.py", line 1, in <module>
    from .regex import *
  File "/nix/store/0vrssa56zbmfvsc7f4c9ji6yyxx2qgyx-python3.11-regex-2023.12.25/lib/python3.11/site-packages/regex/regex.py", line 417, in <module>
    import regex._regex_core as _regex_core
  File "/nix/store/0vrssa56zbmfvsc7f4c9ji6yyxx2qgyx-python3.11-regex-2023.12.25/lib/python3.11/site-packages/regex/_regex_core.py", line 21, in <module>
    import regex._regex as _regex
ModuleNotFoundError: No module named 'regex._regex'

pre-commit breaks regardless of whether my change is included (although it is curious that it breaks in different ways). In both cases, updating the black version to 24.4.2 fixes it, so I figured I'd offer those changes in a PR if you want them.

I'm not a user of asteroid-filterbanks, just a passer by, so I won't be sad if you'd rather not make the change. Either way, have a great day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant