toml rpv venv dependency is undocumented and causes behaviour change
Closed this issue · 0 comments
alexmv commented
Summary
The toml
module dependency is used to optionally read the line-length
and skip-string-normalization
options from pyproject.toml
. However, reading and applying those optins is contingent on the toml
module being installed into the elpy
RPV venv, or they are silently skipped.
This can lead to quite confusing behaviour, where two computers which, to elpy-config
, appear to have equivalent configs, will have differing behaviour in the wrapping they create when they run black
.
We should either make toml
a requirement when installing black
, or document that the behaviour of elpy-black-fix-code
depends on if toml
is installed in the venv.
Steps to reproduce
- Clean out the RPV venv (
rm -rf ~/.emacs.d/elpy/rpc-venv
- Install
black
into the fresh venv - Create a
pyproject.toml
with:[tool.black] line-length = 50
- Run
elpy-black-fix-code
on some code, see it use the default 88-character limit - Install
toml
into the venv - Re-run
elpy-black-fix-code
, and watch the line-lengths change to pick up the 50-character limit