build: Configure automatic versioning from git tags

- Use setuptools-scm for automatic version detection
- Version now automatically derived from git tags
- No need to manually update version in pyproject.toml
- Added _version.py to .gitignore

This enables automatic patch version bumping through git tags without
manually updating any configuration files.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Simone Scarduzio
2025-09-23 08:35:24 +02:00
parent 02bce80537
commit b788999072
4 changed files with 52 additions and 9 deletions

View File

@@ -1,3 +1,7 @@
"""DeltaGlider - Delta-aware S3 file storage wrapper."""
__version__ = "0.1.0"
try:
from ._version import version as __version__
except ImportError:
# Package is not installed, so version is not available
__version__ = "0.0.0+unknown"

View File

@@ -0,0 +1,34 @@
# file generated by setuptools-scm
# don't change, don't track in version control
__all__ = [
"__version__",
"__version_tuple__",
"version",
"version_tuple",
"__commit_id__",
"commit_id",
]
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple
from typing import Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
COMMIT_ID = Union[str, None]
else:
VERSION_TUPLE = object
COMMIT_ID = object
version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
commit_id: COMMIT_ID
__commit_id__: COMMIT_ID
__version__ = version = '0.1.1.post0'
__version_tuple__ = version_tuple = (0, 1, 1, 'post0')
__commit_id__ = commit_id = 'g02bce8053'