Skip to main content

pyproject-flake8 (pflake8)

A monkey patching wrapper to connect flake8 with pyproject.toml configuration.

Update concerning versioning:

pyproject-flake8 so far came without explicit pinning of a flake8 version. Since a recent update broke compatibility – not unexpectedly – the issue arose, how to handle incompatible versions of flake8 and pyproject-flake8. Since there are good reasons for and against version pinning, this project now tries to follow a mix of both: Release versions will follow and pin identical flake8 versions, alpha versions (specific to pyproject-flake8) will pin to the similar non-alpha version of flake8, or later. That way, users of pyproject-flake8 can decide, whether they want a fixed version known to work, or a minimum version, getting later versions, at the risk of future breakage.

Versions 0.0.1x are pyproject-flake8 internal versions and do not correspond to flake8. Furthermore, flake8 3.8.0 was chosen as the first flake8 version to mirror this way.

tl;dr:

# e.g., suggested installation / dependency ... depending on flake8==5.0.3

pip install pyproject-flake8==5.0.3

Rationale

flake8 is one of the most popular Python linters, pyproject.toml has become the standard for Python project metadata.

More and more tools are able to utilize a shared pyproject.toml, alleviating the need for many individual configuration files cluttering a project repository.

Since excellent flake8 is not aimed to support pyproject.toml, this wrapper script tries to fix the situation.

Installation

From github

pip install .

From PyPI

pip install pyproject-flake8

Building packages

Use your favorite PEP517 compliant builder, e.g.:

# install first via: pip install build
python -m build
# packages will reside in dist/

Usage

Call pflake8 instead of flake8.

Configuration goes into the tool.flake8 section of pyproject.toml:

[tool.flake8]
max-line-length = 88
extend-ignore = ["E203"]
max-complexity = 10

See also

Two other projects aim to address the same problem:

Both seem to try to do a lot more than just getting pyproject.toml support. pyproject-flake8 tries to stay minimal while solving its task.

Caveat

This script monkey-patches flake8 and the configparser library of Python, therefore loading it as a module may have unforeseen consequences. Alpha quality. Use at your own risk. It will likely break if either Python or flake8 restructure their code significantly. No guarantees for stability between versions.

License

Unlicense

Release files for pyproject-flake8 3.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyproject-flake8 3.9.0
File Size Uploaded
pyproject-flake8-3.9.0.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyproject-flake8 3.9.0
File Interpreter ABI Platform
pyproject_flake8-3.9.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 8.1 kB

Release files / pyproject-flake8-3.9.0.tar.gz

Download URL pyproject-flake8-3.9.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1bb1a6f2461109b9849ad9f438f490647d8190b91a336fcd39ba0c4082cbcef0
BLAKE2b-256 checksum
How to use checksums
c91d116ceb3ab2dd5c37ee4d3e8abf87f4ae72efa77058d4df92ae76ae19c171
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

Release files / pyproject_flake8-3.9.0-py2.py3-none-any.whl

Download URL pyproject_flake8-3.9.0-py2.py3-none-any.whl
Size 4.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
be60a23ddb8a6781e001daad7124ec49d5cbfdfe71e8e8d026007da20655d631
BLAKE2b-256 checksum
How to use checksums
553c7eb9d89f486fa1174476e98bd34faee100bae54dc33b3f39a96f0c075862
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.14

Release history Release notifications | RSS feed

7.0.0

2 release files

6.1.0

2 release files

6.0.0

2 release files

5.0.4

2 release files

5.0.3

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.9.2

2 release files

3.9.1

2 release files

This release

3.9.0 This release

2 release files

3.8.4

2 release files

3.8.3

2 release files

3.8.2

2 release files

3.8.1

2 release files

3.8.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page