Fix TypeError when formatting with black 22.1.0+#30
Fix TypeError when formatting with black 22.1.0+#30haplo merged 1 commit intopython-lsp:masterfrom wlcx:fix-black-22.1.0
Conversation
ccordoba12
left a comment
There was a problem hiding this comment.
Hey @wlcx, thanks a lot for your help with this! Your fix is correct, but you also need to fix our tests because Black 22.1 dropped Python 2 support.
For that, please go to
and change it for
target-version = ['py39']Then here
python-lsp-black/tests/test_plugin.py
Lines 175 to 178 in 80403a7
please change PY27 to PY39.
That should be enough.
|
@haplo, I think this requires an urgent 1.1.0 release. |
Agreed. I'm reproducing the error and validating this fix. @wlcx Will you be able to implement @ccordoba12's suggestion to fix the test suite? I can help with it if necessary, just let me know. |
|
Damn that was quick! On it now, also wrangling mypy errors. |
|
Do we need to retain backwards compatibility with prior black versions or can we require 22.1.0 as a minimum? |
I would like to retain backwards-compatibility, some users might not be able to upgrade for some reason. Is something in particular making it difficult? |
Resolve an TypeError issue caused by the return type of `find_project_root` changing in black 22.1.0.
This being said, I do believe python-lsp-black will only officially support the latest black version, so I will be adding a note about that in the README. |
|
Ok, think we're good to go, just need that first-time-contributor workflow approval |
haplo
left a comment
There was a problem hiding this comment.
Tested fix with old and new black versions, both work. 👍
|
Thank you for your help @wlcx, I will prepare a release immediately. |
|
No worries, thanks for such an awesome and speedy response both! |
|
Thanks @haplo for your help with this! |
Resolve an TypeError issue caused by the return type of
find_project_rootchanging in black 22.1.0.Closes #29