diff --git a/pyproject.toml b/pyproject.toml index 8fedff0..2e39f60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,6 @@ build-backend = "hatchling.build" [tool.hatch.version] source = "vcs" -path = "src/speech_prep/_version.py" [tool.ruff] target-version = "py39" diff --git a/scripts/dev.sh b/scripts/dev.sh index e06ff82..ee92702 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -13,6 +13,7 @@ function usage() { echo " check-all - Run all checks" echo " tests - Run tests" echo " hooks - Run all pre-commit hooks on all files" + echo " clean - Clean up build artifacts (dist/, build/, *.egg-info/)" echo "" exit 1 } @@ -56,6 +57,11 @@ case "$1" in echo "๐Ÿช Running all pre-commit hooks on all files..." uv run pre-commit run --all-files ;; + clean) + echo "๐Ÿงน Cleaning up build artifacts..." + rm -rf dist/ build/ *.egg-info/ + echo "โœ… Cleanup completed!" + ;; *) usage ;; diff --git a/src/speech_prep/__init__.py b/src/speech_prep/__init__.py index 8aab3ac..f26c598 100644 --- a/src/speech_prep/__init__.py +++ b/src/speech_prep/__init__.py @@ -5,7 +5,6 @@ including silence detection and removal, speed adjustment, and format conversion. """ -from ._version import __version__ from .core import SoundFile from .exceptions import ( AudioPropertiesError, @@ -15,6 +14,15 @@ SpeechPrepError, ) +# Import version from hatch-vcs +try: + from importlib.metadata import version as get_metadata_version + + __version__ = get_metadata_version("speech-prep") +except ImportError: + # Development or not installed + __version__ = "0.0.0" + __all__ = [ "SoundFile", "SpeechPrepError", diff --git a/src/speech_prep/_version.py b/src/speech_prep/_version.py deleted file mode 100644 index d48ec81..0000000 --- a/src/speech_prep/_version.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Version information.""" - -# This file is automatically generated by hatch-vcs -__version__ = "0.0.0" # This will be replaced during build