Source

Writing an Extension for Flake8

Since Flake8 is now adding support for extensions, we require setuptools
so we can manage extensions through entry points. If you are making an
existing tool compatible with Flake8 but do not already require
setuptools, you should probably add it to your list of requirements. Next,
you'll need to edit your setup.py file so that upon installation, your
extension is registered. If you define a class called PackageEntryClass
then this would look something like the following:

If you intend to publish your extension, choose a unique code prefix
following the convention for :ref:`error codes <error-codes>`.
In addition, you can open a request in the issue tracker to register the prefix in the
documentation.

A real example: McCabe

Below is an example from mccabe for how to write your setup.py file for
your Flake8 extension.