-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use mirror to run black
with pre-commit
#95605
Conversation
b3af189
to
f998a2b
Compare
Opinion: I like it to be faster, I don't like to change to some random repo spawned to speed it up. 🤷 |
Exactly my thought as well. It's trivial to set up a mirror package with https://github.com/pre-commit/pre-commit-mirror-maker. We / I could create a mirror in the Home Assistant org if that's better. |
The author is also a collaborator on the black repo, so it's not completely random. It's really unfortunate that there is no "official" mirror. See also: psf/black#3405 |
I've seen, still random for me. In my personal opinion, we should not use that random repo. That said, we can hopefully drop ../Frenck |
Drafting this PR, as there is activity upstream. |
f998a2b
to
70ea7f5
Compare
The black pre-commit mirror repo was moved to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @cdce8p 👍
../Frenck
Proposed change
black
recently started publishingmypyc
compiled wheels to PyPI. Those improve performance quite noticeably. To use those wheels, we need use a pre-commit mirror like we already do for other packages (ruff
orprettier
). An alternative would be use the local installed version, like we do formypy
andpylint
.Unfortunately, there isn't an "official" mirror yet. However a contributor for mypy has create one that we can use. There would also be the option to create our own mirror with the help of https://github.com/pre-commit/pre-commit-mirror-maker.
https://github.com/hauntsaninja/black-pre-commit-mirror
Edit
The pre-commit mirror repo was moved to https://github.com/psf/black-pre-commit-mirror
Speed comparison
Besides the CI runs, this will also improve local pre-commit times.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: