{"id":6809,"library":"pyproject-flake8","title":"pyproject-flake8","description":"pyproject-flake8 (`pflake8`) is a wrapper that monkey-patches Flake8 to enable configuration through `pyproject.toml`. It addresses Flake8's lack of native `pyproject.toml` support by providing a minimal solution to consolidate project configuration. The current version is 7.0.0, and its release cycle is closely tied to the `flake8` releases it supports, with explicit version pinning for stability.","status":"active","version":"7.0.0","language":"en","source_language":"en","source_url":"https://github.com/csachs/pyproject-flake8","tags":["flake8","pyproject.toml","linter","code quality","configuration","tooling"],"install":[{"cmd":"pip install pyproject-flake8","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core linter that pyproject-flake8 wraps and configures.","package":"flake8","version":"==7.0.0"},{"reason":"Required for TOML parsing on Python versions prior to 3.11, where `tomllib` is built-in.","package":"tomli","version":"; python_version < '3.11'","optional":true}],"imports":[{"note":"Avoid direct Python imports for typical use cases; run `pflake8` from the command line.","symbol":"pflake8","correct":"This library is primarily used as a command-line executable named `pflake8`, not typically imported as a Python module for direct use, as it monkey-patches `flake8` internally."}],"quickstart":{"code":"# 1. Install pyproject-flake8\npip install pyproject-flake8\n\n# 2. Create a pyproject.toml file in your project root\n#    (Example content below)\n# [tool.flake8]\n# max-line-length = 88\n# extend-ignore = [\"E203\", \"W503\"]\n# exclude = [\"venv\", \".git\", \"__pycache__\"]\n\n# 3. Run pflake8 instead of flake8\npflake8 your_module.py your_package/\n","lang":"bash","description":"After installation, create a `pyproject.toml` file in your project's root directory and define your Flake8 configuration under the `[tool.flake8]` section. Then, simply execute `pflake8` instead of `flake8` from your command line to lint your code using the specified `pyproject.toml` settings."},"warnings":[{"fix":"Ensure `pyproject-flake8` is explicitly pinned in your dependencies (e.g., `pyproject-flake8==7.0.0`) to avoid automatic updates that might introduce breaking changes with your `flake8` or Python version. Monitor releases for compatibility notes.","message":"This library functions by monkey-patching `flake8` and Python's `configparser` module. Significant internal changes in `flake8` or Python itself (especially `configparser`) can lead to unexpected breakage or incompatibility between `pyproject-flake8` versions and its dependencies.","severity":"breaking","affected_versions":"All versions, due to the underlying implementation strategy."},{"fix":"When installing, ensure the `flake8` version installed matches the one pinned by `pyproject-flake8`. If you need a different `flake8` version, you may need to find a compatible `pyproject-flake8` version or consider alternative solutions like `flake8-pyproject`.","message":"Starting with version 5.0.4, `pyproject-flake8` explicitly pins its dependency to a specific `flake8` version. For version 7.0.0, it requires `flake8==7.0.0`. This means users using different `flake8` versions might encounter dependency conflicts or require `pyproject-flake8` versions compatible with their `flake8`.","severity":"breaking","affected_versions":"5.0.4 and later."},{"fix":"Always substitute `flake8` with `pflake8` in your CI/CD pipelines, pre-commit hooks, and local development workflows where `pyproject.toml` configuration is desired.","message":"To use `pyproject-flake8`, you must invoke the `pflake8` command-line executable, not the standard `flake8` command. Running `flake8` directly will not pick up the `pyproject.toml` configuration provided by this wrapper.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Structure your `pyproject.toml` with `[tool.flake8]` for all Flake8-related settings. Example: `[tool.flake8]\nmax-line-length = 88`","message":"Flake8 configuration in `pyproject.toml` must be placed under the `[tool.flake8]` section. Placing it directly under `[flake8]` or in other sections will cause it to be ignored by `pflake8`.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Carefully review the documentation for each package to understand its usage. If you prefer to keep using the `flake8` command directly and have it pick up `pyproject.toml` config via a plugin, `flake8-pyproject` might be a better fit. If you prefer `pflake8` as a wrapper, stick with `pyproject-flake8`.","message":"There are other packages, such as `flake8-pyproject`, which also aim to provide `pyproject.toml` support for Flake8 but use a different implementation (as a Flake8 plugin). `flake8-pyproject` typically allows running `flake8` directly, whereas `pyproject-flake8` requires `pflake8`. Understand the distinction to choose the correct tool for your needs.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}