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

toml rpv venv dependency is undocumented and causes behaviour change #2004

Closed
alexmv opened this issue Dec 12, 2022 · 0 comments · Fixed by #2022
Closed

toml rpv venv dependency is undocumented and causes behaviour change #2004

alexmv opened this issue Dec 12, 2022 · 0 comments · Fixed by #2022

Comments

@alexmv
Copy link

alexmv commented Dec 12, 2022

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

  1. Clean out the RPV venv (rm -rf ~/.emacs.d/elpy/rpc-venv
  2. Install black into the fresh venv
  3. Create a pyproject.toml with:
    [tool.black]
    line-length = 50
  4. Run elpy-black-fix-code on some code, see it use the default 88-character limit
  5. Install toml into the venv
  6. Re-run elpy-black-fix-code, and watch the line-lengths change to pick up the 50-character limit
inpefess pushed a commit to inpefess/gym-saturation that referenced this issue Mar 10, 2023
gopar added a commit that referenced this issue Jul 19, 2023
Adds a note about the requirement of 'toml' to be installed for the use of the `elpy-black-fix-code`
function.

Closes #2004 and #2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant