asteroid-team / asteroid-filterbanks

Asteroid's filterbanks :rocket:
https://asteroid-team.github.io/
MIT License
80 stars 20 forks source link

Updating black 20.8b1 -> 24.4.2 #20

Open MatrixManAtYrService opened 2 months ago

MatrixManAtYrService commented 2 months ago

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!