Skip to content

Fix empty neuron.__version__ when git describe fails in shallow clones - #3840

Merged
nrnhines merged 2 commits into
release/9.0from
hines-grok/fix-empty-git-describe
Aug 10, 2026
Merged

Fix empty neuron.__version__ when git describe fails in shallow clones#3840
nrnhines merged 2 commits into
release/9.0from
hines-grok/fix-empty-git-describe

Conversation

@nrnhines

Copy link
Copy Markdown
Member

Summary

  • Release dry-run wheels use a depth-1 checkout and do not create the release tag, so git describe fails while .git still exists.
  • add_cpp_git_information left GIT_DESCRIBE empty in that case, so neuron.__version__ (nrnversion(5)) was "" and ModelDB CI failed on runmodels --workdir=$nrn_ver (mkdir('')).
  • Fall back to PROJECT_VERSION when describe fails/empty so dry-run and ship wheels get the same non-empty string (e.g. 9.0.2).
  • Assert non-empty __version__ in test_wheels.sh.

Test plan

  • Wheel CI / NEURON Release dry-run: python -c "import neuron; print(repr(neuron.__version__))" is non-empty (e.g. '9.0.2')
  • ModelDB V2 no longer fails with empty workdir after installing dry-run wheels
  • Ship path (upload=true, tag checkout) still reports the tag version via describe

Release dry-runs build wheels from a depth-1 checkout without creating the
release tag. git describe then fails while .git still exists, so GIT_DESCRIBE
stayed empty and neuron.__version__ (nrnversion(5)) was "", breaking ModelDB
CI workdir creation. Fall back to PROJECT_VERSION and assert non-empty
__version__ in wheel tests.
@nrnhines
nrnhines requested a review from ramcdougal August 10, 2026 01:01
@sonarqubecloud

Copy link
Copy Markdown

@nrnhines

Copy link
Copy Markdown
Member Author

@ramcdougal Please approve.
The NEURON release workflow for 9.0.2 has gotten further on each of the sequence of changes to master, release/9.0, and nrn-modeldb-ci and hopefully (always hopefully) this will be the last. But it's no way to run a release process. After this release, we'll merge #3838 to master and thereafter I believe we can do all release workflow tweaking and testing using PR's instead of constantly having to merge fixes to master, release/9.x, and nrn-modeldb-ci.

@azure-pipelines

Copy link
Copy Markdown

✔️ d668f5d -> Azure artifacts URL

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.17%. Comparing base (7ca2dbb) to head (d668f5d).

Additional details and impacted files
@@             Coverage Diff              @@
##           release/9.0    #3840   +/-   ##
============================================
  Coverage        68.17%   68.17%           
============================================
  Files              688      688           
  Lines           111016   111016           
============================================
  Hits             75686    75686           
  Misses           35330    35330           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nrnhines
nrnhines merged commit ba57833 into release/9.0 Aug 10, 2026
39 of 40 checks passed
@nrnhines
nrnhines deleted the hines-grok/fix-empty-git-describe branch August 10, 2026 12:51
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.

2 participants