Skip to content

Report resolved Black CLI for format, not import black - #3

Merged
nrnhines merged 1 commit into
masterfrom
hines/black-version-probe
Jul 21, 2026
Merged

nrnhines merged 1 commit into
masterfrom
hines/black-version-probe

Conversation

@nrnhines

Copy link
Copy Markdown
Member

Summary

  • Fix the Black version probe used by format so it reports the resolved Black executable after tools configure, instead of import black in the format driver.
  • The driver often re-execs into .bbp-project-venv (PyYAML / cmake-format / etc.) while Black may still be a matching CLI on PATH outside that venv. In that case import black fails even though formatting works (Could not determine black version: No module named 'black').
  • Print black version, path, Black's Python, Interpreter (shebang, including pyenv-shim resolution), and the format driver interpreter; flush stdout so the block is not lost under buffered CI/ninja logs.

Related: neuronsimulator/nrn#3783, neuronsimulator/nrn#3782, #2.

Test plan

  • Local: ./bin/format -q <cmake file> with system Black on PATH (pyenv) — probe shows shim path + real Interpreter, no import error
  • Local: PATH without system black so Black comes from .bbp-project-venv — probe shows venv path/Interpreter
  • Local: ninja format-pr from nrn with this submodule — probe prints successfully
  • CI on this PR if any workflow runs format

The format driver often re-execs into .bbp-project-venv while Black may
still be a matching executable on PATH. import black then fails even
though formatting works. After tools configure, print path, version,
Black's Python/interpreter, and the format driver interpreter.
@nrnhines
nrnhines merged commit 5ad10d3 into master Jul 21, 2026
10 checks passed
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.

1 participant