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

Python 3.10 distutils Deprecation Warning (Vim Plugin) #2689

Closed
matthewarmand opened this issue Dec 14, 2021 · 3 comments
Closed

Python 3.10 distutils Deprecation Warning (Vim Plugin) #2689

matthewarmand opened this issue Dec 14, 2021 · 3 comments
Labels
C: vim Vim plugin T: bug Something isn't working

Comments

@matthewarmand
Copy link
Contributor

Describe the bug

Python 3.10 begins to throw a deprecation warning for the distutils package, which will be removed in Python 3.12. The recommended fix is to use setuptools or to check PEP 632 for alternatives.

This isn't a workflow blocking issue, as pressing Enter or typing a command brings you to vim as normal; its just an extra step when starting Vim, and a deprecation that should be fixed for Python 3.10 (and especially >=3.12) support.

To Reproduce

On a system with Python 3.10, Vim, and Black installed, install the Black Vim plugin (I use vim-plug with Plug 'psf/black', though I would guess this is an issue for other installation methods as well).

Then attempt to launch Vim and observe the resulting warning:

$ vim
Error detected while processing /home/matt/.vim/plugged/black/plugin/black.vim:
line  214:
<string>:5: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
Press ENTER or type command to continue

Expected behavior

The warning should not display and vim should open normally.

Environment

  • Black's version: black, 21.12b0 (compiled: no)
  • OS version: Arch Linux
  • Python version: Python 3.10.1

Additional context

N/A

@matthewarmand matthewarmand added the T: bug Something isn't working label Dec 14, 2021
@matthewarmand
Copy link
Contributor Author

matthewarmand commented Dec 14, 2021

I did a bit more digging and found this line in the CHANGELOG.md for Black 21.11b0:

Fixed vim plugin with Python 3.10 by removing deprecated distutils import (#2610)

But I'm currently on 21.12b0 and I'm still seeing this. I performed a :PlugUpdate to update the vim plugin from this repository, but am still seeing this.

Is this a regression for 21.12b0, or is there something wrong with my vim plugin installation process?

@ichard26 ichard26 added the C: vim Vim plugin label Dec 14, 2021
@matthewarmand
Copy link
Contributor Author

@ichard26 Thanks for the extra label, I'm closing this issue though, as I've figured it out.

In case anyone else runs into this, I've just realized that when the repo migrated from master to main, that branch change was never picked up by vim-plug, so my vim plugin has been tracking an old, dead branch essentially this whole year. This was just the first compatibility problem between the software and the plugin that was visible.

Interestingly enough, when I try to change the branch to main, upon doing a PlugUpdate in vim it goes back to master. So THAT seems to be a vim-plug problem. I'll check their docs and either open a new issue there or update my system as appropriate.

@matthewarmand
Copy link
Contributor Author

Seems this is an open issue with vim-plug: junegunn/vim-plug#1005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: vim Vim plugin T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants