psf/black-pre-commit-mirror

50

stars

44

commits

Python

primary language

May 19, 2026

updated

README

black-pre-commit-mirror

Using this repository in your pre-commit config makes Black twice as fast.

Explanation

pre-commit installs hooks by cloning the repo you specify and installing from source, as opposed to installing Black from PyPI.

However, Black uploads mypyc-accelerated extension modules to PyPI that make Black about twice as fast. Using this mirror in the repo field of your pre-commit config instead of https://github.com/psf/black tricks pre-commit into installing these prebuilt accelerated wheels instead, where possible.

The trick is very simple: just declare Black as a dependency of this fake black-pre-commit-mirror project. While pre-commit will install black-pre-commit-mirror from source, it will still install its dependencies from PyPI.

More

For example pre-commit configs, please see the Black VCS integration docs

Contributors

hauntsaninja

16 commits

jamesbraza

1 commits

JelleZijlstra

1 commits

psf/black-pre-commit-mirror

50

stars

44

commits

Python

primary language

May 19, 2026

updated

README

black-pre-commit-mirror

Using this repository in your pre-commit config makes Black twice as fast.

Explanation

pre-commit installs hooks by cloning the repo you specify and installing from source, as opposed to installing Black from PyPI.

However, Black uploads mypyc-accelerated extension modules to PyPI that make Black about twice as fast. Using this mirror in the repo field of your pre-commit config instead of https://github.com/psf/black tricks pre-commit into installing these prebuilt accelerated wheels instead, where possible.

The trick is very simple: just declare Black as a dependency of this fake black-pre-commit-mirror project. While pre-commit will install black-pre-commit-mirror from source, it will still install its dependencies from PyPI.

More

For example pre-commit configs, please see the Black VCS integration docs

Contributors

hauntsaninja

16 commits

jamesbraza

1 commits

JelleZijlstra

1 commits

Languages

Python

100.0%