Skip to content
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

Allow specifying --workers via environment variable #3742

Closed
hauntsaninja opened this issue Jun 22, 2023 · 0 comments · Fixed by #3743
Closed

Allow specifying --workers via environment variable #3742

hauntsaninja opened this issue Jun 22, 2023 · 0 comments · Fixed by #3743
Labels
T: enhancement New feature or request

Comments

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jun 22, 2023

Is your feature request related to a problem? Please describe.

I ran into #2513 in my CI system

While I can hardcode --workers into my invocations of black (in this case, via pre-commit), it's a little unnatural, since the number of cores differs between CI workers and say locally. E.g., I can hardcode the minimum of them, but then we leave some perf on the table.

Describe the solution you'd like

I'd like to specify it by environment variable, say BLACK_NUM_WORKERS. This isn't unprecedented, e.g. BLACK_CACHE_DIR exists. This does increase configuration complexity a little.

Describe alternatives you've considered

Just hardcoding --workers. It's not the biggest deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant