Skip to content

Removed versionner issue #1181#1201

Merged
VisLab merged 3 commits intohed-standard:mainfrom
VisLab:remove_vis
Feb 3, 2026
Merged

Removed versionner issue #1181#1201
VisLab merged 3 commits intohed-standard:mainfrom
VisLab:remove_vis

Conversation

@VisLab
Copy link
Member

@VisLab VisLab commented Feb 3, 2026

No description provided.

@VisLab
Copy link
Member Author

VisLab commented Feb 3, 2026

COPILOT Summary and Review:

Based on my review of PR #1201, here's a comprehensive summary and evaluation in markdown format:


PR Review: Removed versionner issue #1181

📋 Summary

This PR migrates the hed-python project from versioneer to setuptools-scm for version management. This is a significant infrastructure change that removes 686 lines of auto-generated versioneer code and replaces it with a modern, more maintainable solution.

Key Changes:

  • 12 files changed: +71 additions, -722 deletions
  • Removes versioneer dependency and its generated code
  • Implements setuptools-scm for automatic version management from git tags
  • Updates all imports and version references across the codebase
  • Removes versioneer.py from project root (not shown in diff but implied)

✅ Strengths

  1. Significant Code Reduction: Removes 722 lines of auto-generated code, improving maintainability
  2. Modern Tooling: setuptools-scm is actively maintained and more widely adopted in the Python ecosystem
  3. Comprehensive Update: All version references across scripts and CLI tools have been updated
  4. Documentation Updated: Release guide reflects the new version management system
  5. Fallback Handling: The new __init__.py includes proper error handling for missing version files

🔍 Detailed Analysis

Configuration Changes (pyproject.toml)

# Before: versioneer configuration
[tool.versioneer]
VCS = "git"
style = "pep440"
...

# After: setuptools-scm configuration
[tool.setuptools_scm]
write_to = "hed/_version.py"
version_scheme = "no-guess-dev"

✅ Good: Simplified configuration
⚠️ Note: The version_scheme = "no-guess-dev" is a specific choice - ensure this matches your versioning needs

Version Import Pattern (hed/__init__.py)

The new version import includes a robust fallback mechanism:

try:
    from hed._version import __version__
except ImportError:
    from importlib.metadata import version, PackageNotFoundError
    try:
        __version__ = version("hedtools")
    except PackageNotFoundError:
        __version__ = "unknown"

✅ Excellent: Handles editable installs and missing version files gracefully

Updated Version Access

All scripts now use __version__ directly instead of vr.get_versions()["version"]:

  • ✅ CLI tools (cli.py)
  • ✅ Validation scripts (validate_bids.py)
  • ✅ Extraction scripts (extract_tabular_summary.py, hed_extract_bids_sidecar.py)
  • ✅ Utility modules (script_utils.py)

⚠️ Issues & Suggestions

1. PR Description Missing

The PR has no body/description explaining the changes, rationale, or testing performed.

Recommendation: Add a description including:

  • Why the migration from versioneer to setuptools-scm
  • What was tested (installation, version reporting, builds)
  • Any breaking changes or upgrade notes

2. Missing File: versioneer.py

The diff doesn't show removal of versioneer.py from the project root, but it should be deleted if it exists.

Action Required: Verify versioneer.py has been removed from the repository root

3. Generated _version.py Should Be in .gitignore

The new hed/_version.py file appears to be tracked with a generated version. With setuptools-scm, this file should be:

  • Generated during build/install
  • Listed in .gitignore (or kept for sdist compatibility)

Current state:

__version__ = version = "0.9.0.post1.dev14+g386d3afaa.d20260203"

Recommendation: Decide whether to track or ignore hed/_version.py. Common practices:

  • Option A: Add to .gitignore (requires git ls-files at build time)
  • Option B: Keep tracked for sdist support, but use write_to_template parameter

4. Build Requirements Version Bump

The change from setuptools>=42 to setuptools>=61 is appropriate but significant.

Recommendation: Note in release notes that this requires setuptools 61+ (released April 2022)

5. MANIFEST.in Cleanup

-include versioneer.py
+
 include hed/_version.py

Issue: The blank line replacement looks unintentional

Suggestion: Remove the blank line entirely

6. Testing Evidence Missing

No mention of:

  • CI/CD pipeline status
  • Manual testing of version reporting
  • Build verification (sdist/wheel)
  • Installation testing (regular vs. editable)

Recommendation: Verify:

# Test version detection
python -m setuptools_scm
pip install -e .
python -c "import hed; print(hed.__version__)"

# Test package build
python -m build
pip install dist/hedtools-*.whl

7. Documentation Gap

While RELEASE_GUIDE.md is updated, consider documenting:

  • Developer setup changes (if any)
  • CI/CD configuration updates needed
  • Troubleshooting version issues

🧪 Testing Checklist

Before merging, please verify:

  • versioneer.py has been removed from repository root
  • Version is correctly detected in development: python -m setuptools_scm
  • Editable install works: pip install -e . and version is accessible
  • Standard install works: pip install .
  • CLI version command works: hedpy --version
  • Built packages contain correct version: python -m build
  • CI/CD pipelines pass (if applicable)
  • Documentation is complete

📊 Overall Assessment

Status: ✅ Generally Good with minor issues to address

Impact: Medium - Infrastructure change affecting version management but not user-facing functionality

Risk Level: Low-Medium

  • Low risk if properly tested
  • Medium risk if builds/releases haven't been verified

🎯 Recommendations Priority

  1. HIGH: Verify and document testing performed
  2. HIGH: Add PR description
  3. MEDIUM: Decide on _version.py tracking strategy
  4. MEDIUM: Confirm versioneer.py deletion
  5. LOW: Clean up MANIFEST.in blank line
  6. LOW: Add upgrade notes for setuptools 61+ requirement

💬 Questions for Author

  1. Have you tested the build/install process locally?
  2. Did you remove versioneer.py from the repository root?
  3. What's the strategy for hed/_version.py - track it or gitignore it?
  4. Have you tested the version reporting in various installation scenarios?
  5. Are there any CI/CD changes needed to support this migration?

Verdict: This is a solid modernization effort that improves the codebase. With proper testing verification and minor cleanup, this PR should be good to merge. The migration from versioneer to setuptools-scm is well-executed across all code references.

@VisLab VisLab merged commit 0e1d76c into hed-standard:main Feb 3, 2026
21 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