{"id":8535,"library":"pytest-pep8","title":"pytest-pep8","description":"pytest-pep8 is a pytest plugin designed to check PEP8 compliance in Python code. It integrates directly with the pytest testing framework to efficiently discover and check `.py` files for style guide violations. The plugin allows for flexible configuration to ignore specific errors or warnings on a per-project or per-file basis. Its last release was in April 2014, and it is largely unmaintained now.","status":"abandoned","version":"1.0.6","language":"python","source_language":"en","source_url":"https://github.com/davidraleigh/pytest-pep8","tags":["pytest","pep8","linter","code quality","style guide"],"install":[{"cmd":"pip install pytest-pep8","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core testing framework required for plugin functionality.","package":"pytest","optional":false},{"reason":"Used by pytest-pep8 for caching results.","package":"pytest-cache","optional":false},{"reason":"The underlying style checker (formerly 'pep8' library) is implicitly required for functionality.","package":"pycodestyle","optional":false}],"imports":[],"quickstart":{"code":"# content of myproject/myfile.py\ndef somefunc( arg1,  arg2):\n    pass\n\n# Terminal\n# Install the plugin\n# pip install pytest-pep8\n\n# Run pytest with the --pep8 flag\n# pytest --pep8","lang":"python","description":"Install the plugin via pip, then run pytest with the `--pep8` flag. The plugin will automatically discover and check Python files for PEP8 violations. Configuration for ignoring specific errors can be done in `pytest.ini` or `setup.cfg`."},"warnings":[{"fix":"This project is unmaintained. Migrate to actively maintained alternatives like `pytest-flake8` or `pytest-pycodestyle`. Downgrading `pytest` is not recommended.","message":"The `pytest-pep8` plugin is incompatible with `pytest` versions 6.0.1 and newer due to significant internal API changes within pytest, specifically regarding node construction.","severity":"breaking","affected_versions":"pytest >= 6.0.1"},{"fix":"Users are strongly advised to migrate to actively maintained PEP8/Flake8 checking plugins for pytest, such as `pytest-flake8` or `pytest-pycodestyle`, for better compatibility and continued support.","message":"The `pytest-pep8` project is largely unmaintained since its last release in April 2014. The underlying 'pep8' library it relies on has also been renamed to `pycodestyle`.","severity":"deprecated","affected_versions":"All versions"},{"fix":"It is recommended to configure `pep8ignore = * ALL` in your `pytest.ini` or `setup.cfg` to initially ignore all errors, then gradually re-enable specific checks or add specific ignore codes as you clean up your code. You can also configure `pep8maxlinelength` for custom line limits.","message":"Running `pytest --pep8` on an existing codebase may initially report a large number of PEP8 violations, potentially overwhelming.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To force a full re-check and clear the plugin's cache, run pytest with both the `--pep8` and `--clearcache` options: `pytest --pep8 --clearcache`.","message":"The plugin uses caching to improve performance, which can sometimes lead to stale results where changes in files are not immediately reflected in subsequent PEP8 checks.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'2014':66 'allow':40 'april':65 'basi':59 'check':13,31 'code':18,76 'complianc':15 'configur':43 'design':11 'direct':21 'discov':29 'effici':28 'error':47 'file':33,58 'flexibl':42 'framework':26 'guid':36,79 'ignor':45 'integr':20 'larg':70 'last':61 'linter':75 'pep8':3,6,14,74 'per':53,57 'per-fil':56 'per-project':52 'plugin':10,39 'project':54 'py':32 'pytest':2,5,9,24,73 'pytest-pep8':1,4 'python':17 'qualiti':77 'releas':62 'specif':46 'style':35,78 'test':25 'unmaintain':71 'violat':37 'warn':49","created_at":"2026-04-16T17:02:41.275381+00:00","updated_at":"2026-04-16T17:02:41.275381+00:00","problems":[{"fix":"The `pytest-pep8` plugin is abandoned. You should migrate to a modern, actively maintained linter plugin such as `pytest-flake8` or `pytest-pycodestyle`.","cause":"This error occurs because `pytest-pep8` uses an older internal API for constructing test items that has been deprecated and removed in recent versions of `pytest` (>= 6.0.1).","error":"PytestDeprecationWarning: Direct construction of Pep8Item has been deprecated, please use Pep8Item.from_parent."},{"fix":"Start by adding `pep8ignore = * ALL` under the `[pytest]` section in your `pytest.ini` or `setup.cfg` file to ignore all errors. Then, gradually remove `ALL` or specify individual error codes to ignore (e.g., `pep8ignore = E201 E231`) as you refactor your code.","cause":"Most older or unlinted Python projects will have numerous violations of the PEP8 style guide, and `pytest-pep8` checks all discovered `.py` files by default.","error":"Running `pytest --pep8` reports an overwhelming number of PEP8 errors on my existing Python project."},{"fix":"To explicitly clear the cache and force `pytest-pep8` to re-evaluate all files, run `pytest` with the `--pep8` and `--clearcache` command-line options: `pytest --pep8 --clearcache`.","cause":"The `pytest-pep8` plugin implements caching to speed up repeated runs. This cache might prevent checks from re-running on files it believes haven't changed.","error":"PEP8 checks are not updating or re-running after I modify and save a Python file."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://bitbucket.org/pytest-dev/pytest-pep8","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/pytest-pep8/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-16","next_check":"2026-07-15","install_tag":null}}