diff --git a/iblrig/__init__.py b/iblrig/__init__.py index 18bc085eb..451807ae9 100644 --- a/iblrig/__init__.py +++ b/iblrig/__init__.py @@ -1,6 +1,7 @@ from setuptools_scm import get_version from pathlib import Path +from iblrig.constants import BASE_DIR from importlib import metadata -__version__ = get_version(root='..', relative_to=__file__, version_scheme="post-release", local_scheme="dirty-tag", +__version__ = get_version(root=BASE_DIR, version_scheme="post-release", local_scheme="dirty-tag", fallback_version=metadata.version('iblrig'), write_to=Path('iblrig', '_version.py')) diff --git a/iblrig/version_management.py b/iblrig/version_management.py index 47b6340ec..ddfac0ac9 100644 --- a/iblrig/version_management.py +++ b/iblrig/version_management.py @@ -31,7 +31,7 @@ def check_for_updates() -> tuple[bool, Union[str, None]]: log.info('No update available.') update_available = v_remote > v_local - return update_available, v_remote.base_version + return update_available, v_remote.base_version if v_remote else '' def get_local_version() -> Union[version.Version, None]: @@ -66,7 +66,7 @@ def get_remote_version() -> Union[version.Version, None]: return None try: log.debug('Parsing local version string') - _remote_version = max([version.parse(v) for v in findall(r'/([\d.]+)', references)]) + _remote_version = max([version.parse(v) for v in findall(r'/(\d+\.\d+\.\d+)', references)]) return _remote_version except (version.InvalidVersion, TypeError): log.error('Could not parse remote version string') diff --git a/pyproject.toml b/pyproject.toml index cee467ed9..98e5f702f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ "PySocks", "PyYAML", "scipy", - "setuptools_scm>8", + "setuptools_scm>8.0.2", "sounddevice", ]