Skip to content

Allow specifying --workers via environment variable#3743

Merged
JelleZijlstra merged 6 commits into
psf:mainfrom
hauntsaninja:env-var
Jun 24, 2023
Merged

Allow specifying --workers via environment variable#3743
JelleZijlstra merged 6 commits into
psf:mainfrom
hauntsaninja:env-var

Conversation

@hauntsaninja

@hauntsaninja hauntsaninja commented Jun 22, 2023

Copy link
Copy Markdown
Collaborator

Fixes #3742

  • Add an entry in CHANGES.md if necessary?
  • Add new / update outdated documentation?

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but this should also be mentioned in the documentation, maybe somewhere in https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html (which I think is rather different on main, I need to do a release sometime).

@github-actions

github-actions Bot commented Jun 22, 2023

Copy link
Copy Markdown
Contributor

diff-shades reports zero changes comparing this PR (9b9ee61) to main (c732a1f).


What is this? | Workflow run | diff-shades documentation

@hauntsaninja

hauntsaninja commented Jun 24, 2023

Copy link
Copy Markdown
Collaborator Author

It looks like it will automatically have something added to that file from the --help:

<summary>CLI reference</summary>

  -W, --workers INTEGER RANGE     Number of parallel workers [default:
                                  BLACK_NUM_WORKERS environment variable or
                                  number of CPUs in the system]  [x>=1]

Should I document this somewhere beyond that? I don't see any other documentation about --workers and I'm not sure if there's a good existing section in the_basics.md

@hauntsaninja hauntsaninja marked this pull request as ready for review June 24, 2023 02:23
@hauntsaninja

Copy link
Copy Markdown
Collaborator Author

I guess I could make a new section below that called "environment variable options" and mention both this and BLACK_CACHE_DIR?

@JelleZijlstra

Copy link
Copy Markdown
Collaborator

I guess I could make a new section below that called "environment variable options" and mention both this and BLACK_CACHE_DIR?

Yes, sounds good!

@JelleZijlstra JelleZijlstra merged commit 7be2735 into psf:main Jun 24, 2023
@hauntsaninja hauntsaninja deleted the env-var branch July 16, 2023 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow specifying --workers via environment variable

2 participants