Skip to content

Migrate from manual version management to setuptools_scm #263

@vhaasteren

Description

@vhaasteren

Currently, enterprise_extensions uses manual version management in enterprise_extensions/__init__.py, requiring maintainers to manually update version numbers before each release. This is error-prone and inconsistent with the other packages (PTMCMCSampler and enterprise) which use setuptools_scm for automatic version generation.

Current Setup:

  • Manual version updates in __init__.py (e.g., __version__ = "3.0.2")
  • Version must be updated before each release
  • Risk of version mismatches between git tags and package version

Proposed Improvement:

  • Implement setuptools_scm for automatic version generation
  • Version automatically derived from git tags
  • Consistent with PTMCMCSampler and enterprise packages
  • Eliminate manual version management

Benefits:

  • Eliminates manual version update step
  • Reduces human error in version management
  • Consistent versioning across all packages
  • Automatic version generation from git tags
  • Simplified release process

Implementation Steps:

  1. Add setuptools_scm[toml]>=6.0 to build requirements in pyproject.toml
  2. Configure setuptools_scm in pyproject.toml:
    [tool.setuptools_scm]
    write_to = "enterprise_extensions/version.py"
  3. Remove manual __version__ from __init__.py
  4. Update setup.py to use use_scm_version=True
  5. Update release documentation to reflect automated versioning
  6. Test release process with new versioning

Migration Considerations:

  • Need to ensure existing version compatibility
  • Update release documentation in RELEASE.md
  • Coordinate with current release workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions