Skip to content

Conversation

@dudustri
Copy link
Contributor

This pull request updates the setup.py build process to automatically generate a version file for the package if it does not already exist. This improves version management and ensures the package version is always consistent with the git tags or with the forced version SETUPTOOLS_SCM_PRETEND_VERSION.

Build and versioning improvements:

  • Added logic to check for the existence of src/ruptures/version.py and, if missing, automatically generate it using setuptools_scm to extract the version from git tags. This ensures the package always has an up-to-date version file.
  • Imported os and get_version from setuptools_scm to support the new version file generation logic.

@github-actions github-actions bot added the Type: Fix Bug or Bug fixes label Aug 18, 2025
@deepcharles
Copy link
Owner

deepcharles commented Aug 20, 2025

Hey many thanks for this PR.

The version.py is already correctly generated by setuptools_scm. However setuptools can't import __version__ during build. One workaround is to remove the line in setup.cfg that causes the error. See #354

@dudustri
Copy link
Contributor Author

Fixed in #354

@dudustri dudustri closed this Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Fix Bug or Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants