Registry / testing / pyproject-flake8

pyproject-flake8

JSON →
library7.0.0pypypiunverified

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.

pip install pyproject-flake8
INSTALL
IMPORT
SIG · PYPROJECT-FLAKE8
P
pyproject-flake8
testingpythonv7.0.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
timeout
glibc
py 3.103.920 runs
timeout
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pflake8
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.
Avoid direct Python imports for typical use cases; run `pflake8` from the command line.

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.

# 1. Install pyproject-flake8 pip install pyproject-flake8 # 2. Create a pyproject.toml file in your project root # (Example content below) # [tool.flake8] # max-line-length = 88 # extend-ignore = ["E203", "W503"] # exclude = ["venv", ".git", "__pycache__"] # 3. Run pflake8 instead of flake8 pflake8 your_module.py your_package/
pflake8 --version
Debug
Known issues
breakingThis 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.
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.
affects: All versions, due to the underlying implementation strategy.
breakingStarting 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`.
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`.
affects: 5.0.4 and later.
gotchaTo 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.
fix
Always substitute `flake8` with `pflake8` in your CI/CD pipelines, pre-commit hooks, and local development workflows where `pyproject.toml` configuration is desired.
affects: All versions.
gotchaFlake8 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`.
fix
Structure your `pyproject.toml` with `[tool.flake8]` for all Flake8-related settings. Example: `[tool.flake8]
max-line-length = 88`
affects: All versions.
gotchaThere 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.
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`.
affects: All versions.
Upgrade
Version history
7.0.0latest on PyPI · released Apr 9, 2024
Audit
Dependencies
flake8requiredCore linter that pyproject-flake8 wraps and configures.
tomlioptionalRequired for TOML parsing on Python versions prior to 3.11, where `tomllib` is built-in.
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
pyproject-flake8 — pip install pyproject-flake8 · libregistry