psf / black

The uncompromising Python code formatter
https://black.readthedocs.io/en/stable/
MIT License
38.83k stars 2.45k forks source link

Vim plugin does not install the latest Black #1214

Open wilson opened 4 years ago

wilson commented 4 years ago

Describe the bug

The :BlackUpgrade process in vim installs 18.9b0. At the time of writing, the latest version is 19.10b0. (I have 19.10b0 installed via Homebrew)

To Reproduce

  1. Install the latest vim plugin from this repository
  2. Remove the black virtualenv directory (at ~/.vim/black by default, or customized via g:black_virtualenv)
  3. Open a Python file with vim, causing the plugin to reinstall Black
  4. Run :BlackVersion

Expected behavior

I expect the latest version to be installed; this process reliably installs a previous version, however.

Environment (please complete the following information):

Does this bug also happen on master?

Yes

Additional context

I'm encountering the same problem as https://github.com/psf/black/issues/769 I've come to believe that it is due to this version mismatch between the installed Black and the version the vim plugin expects. None of the remediations suggested in #769 work for me.

maximzxc commented 4 years ago

Experiencing the very same problem.

maximzxc commented 4 years ago

Resolved this issue for myself by adding let g:black_virtualenv="~/.vim_black" to my .vimrc and running pip install --install-option="--prefix=~.vim_black" black manually.