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.
pip install pytest-pep8No compatibility data collected yet for this library.
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`.
This project is unmaintained. Migrate to actively maintained alternatives like `pytest-flake8` or `pytest-pycodestyle`. Downgrading `pytest` is not recommended.
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.
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.
To force a full re-check and clear the plugin's cache, run pytest with both the `--pep8` and `--clearcache` options: `pytest --pep8 --clearcache`.
The `pytest-pep8` plugin is abandoned. You should migrate to a modern, actively maintained linter plugin such as `pytest-flake8` or `pytest-pycodestyle`.
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.
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`.