diff --git a/VERSION b/VERSION index d917d3e..b1e80bb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.2 +0.1.3 diff --git a/lbranch/__init__.py b/lbranch/__init__.py index 7f93670..d2c2221 100644 --- a/lbranch/__init__.py +++ b/lbranch/__init__.py @@ -2,11 +2,7 @@ lbranch - A Git utility that shows recently checked out branches in chronological order. """ -from pathlib import Path - from .main import main +from .version import __version__ -_version_file = Path(__file__).parent.parent / 'VERSION' -__version__ = _version_file.read_text().strip() - -__all__ = ['main'] +__all__ = ['main', '__version__'] diff --git a/lbranch/main.py b/lbranch/main.py index 4c8daa1..5e1aee6 100644 --- a/lbranch/main.py +++ b/lbranch/main.py @@ -8,7 +8,8 @@ import re import subprocess import sys -from pathlib import Path + +from .version import __version__ # Exit codes - following sysexits.h conventions EXIT_SUCCESS = 0 # successful execution @@ -83,10 +84,6 @@ def supports_color(): BLUE = '' NC = '' -# Read version from VERSION file -_version_file = Path(__file__).parent.parent / 'VERSION' -__version__ = _version_file.read_text().strip() - def print_error(message, exit_code=EXIT_SOFTWARE): """Print error message and exit with specified code""" diff --git a/lbranch/version.py b/lbranch/version.py new file mode 100644 index 0000000..a1df734 --- /dev/null +++ b/lbranch/version.py @@ -0,0 +1,6 @@ +"""Version information for lbranch.""" + +from pathlib import Path + +_version_file = Path(__file__).parent.parent / 'VERSION' +__version__ = _version_file.read_text().strip() diff --git a/pyproject.toml b/pyproject.toml index dbbcdc1..24e8c2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "lbranch" -version = "0.1.2" +version = "0.1.3" description = "A Git utility that shows recently checked-out branches in chronological order and lets you quickly switch between them." readme = "README.md" requires-python = ">=3.7"