Skip to content

Allow specifying --workers via environment variable #3742

@hauntsaninja

Description

@hauntsaninja

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions