question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No support for pycodestyle

See original GitHub issue

flake8 was officialy deprecated and mostly replaced by pycodestyle which is currently does not have a pre-commit-hook.

Initially I was considering repurposing the flake8 hook but I think it will be better to have a new one as doing the swap may also involve renaming its section inside setup.cfg or tox.ini.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
asottilecommented, Oct 12, 2018

bingo! that’s what it is:

root@387aa45b7c0b:/astpretty# pre-commit run --all-files
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Trim Trailing Whitespace.................................................Failed
hookid: trailing-whitespace

Traceback (most recent call last):
  File "/root/.cache/pre-commit/repo_3Nh2O/py_env-python2.7/bin/trailing-whitespace-fixer", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/root/.cache/pre-commit/repo_3Nh2O/py_env-python2.7/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3088, in <module>
    @_call_aside
  File "/root/.cache/pre-commit/repo_3Nh2O/py_env-python2.7/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3072, in _call_aside
    f(*args, **kwargs)
  File "/root/.cache/pre-commit/repo_3Nh2O/py_env-python2.7/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3101, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/root/.cache/pre-commit/repo_3Nh2O/py_env-python2.7/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 576, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/root/.cache/pre-commit/repo_3Nh2O/py_env-python2.7/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 589, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/root/.cache/pre-commit/repo_3Nh2O/py_env-python2.7/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 778, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pycodestyle<2.4.0,>=2.0.0' distribution was not found and is required by flake8

probably debian’s packaging of virtualenv

If I pip install virtualenv (system pip) to get a newer virtualenv it fixes it:

root@387aa45b7c0b:/astpretty# pip install virtualenv --upgrade
Collecting virtualenv
  Downloading https://files.pythonhosted.org/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl (1.9MB)
    100% |################################| 1.9MB 698kB/s 
Installing collected packages: virtualenv
  Found existing installation: virtualenv 15.1.0
    Not uninstalling virtualenv at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed virtualenv-16.0.0
root@387aa45b7c0b:/astpretty# pre-commit clean
Cleaned /root/.cache/pre-commit.
root@387aa45b7c0b:/astpretty# pre-commit run --all-files
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Trim Trailing Whitespace.................................................Passed
1reaction
blaggacaocommented, Oct 13, 2018

@asottile Thanks! You’re welcome! Such (rare) responsiveness was great fun, also on this end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction — pycodestyle 2.10.0 documentation
This utility does not enforce every single rule of PEP 8. It helps to verify that some coding conventions are applied but it...
Read more >
pycodestyle documentation - Read the Docs
Comes with a comprehensive test suite. 1.2 Disclaimer. This utility does not enforce every single rule of PEP 8. It helps to verify...
Read more >
pycodestyle - PyPI
pycodestyle (formerly called pep8) - Python style guide checker. Build status Documentation Status Wheel Status Join the chat at https://gitter.im/PyCQA/ ...
Read more >
Intro to Programming - issues with pycodestyle - Udacity Support
I am unable to run or install pycodestyle. Here is my attempt to install ... pycodestyle spin.py bash: pycodestyle: command not found. Help!...
Read more >
FS#58210 : [flake8][python-pycodestyle] Flake8 ... - Arch Linux
Description: Flake8 does not support pycodestyle>=2.4.0, dependency is "pycodestyle >= 2.3.0, < 2.4.0". Flake8 cannot run at all with pycodestyle 2.4.0 and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found