diff --git a/pyprobe/__init__.py b/pyprobe/__init__.py index eac769ce..3d78a56c 100644 --- a/pyprobe/__init__.py +++ b/pyprobe/__init__.py @@ -1,5 +1,6 @@ """The PyProBE package.""" -from .cell import Cell, __version__, load_archive, make_cell_list # noqa: F401 +from ._version import __version__ # noqa: F401 +from .cell import Cell, load_archive, make_cell_list # noqa: F401 from .dashboard import launch_dashboard # noqa: F401 from .logger import configure_logging # noqa: F401 from .plot import Plot # noqa: F401 diff --git a/pyprobe/_version.py b/pyprobe/_version.py new file mode 100644 index 00000000..c72e3798 --- /dev/null +++ b/pyprobe/_version.py @@ -0,0 +1 @@ +__version__ = "1.1.4" diff --git a/pyprobe/cell.py b/pyprobe/cell.py index 6a0faa3a..47998ae2 100644 --- a/pyprobe/cell.py +++ b/pyprobe/cell.py @@ -12,6 +12,7 @@ import polars as pl from pydantic import BaseModel, Field, field_validator, validate_call +from pyprobe._version import __version__ from pyprobe.cyclers import arbin, basecycler, basytec, biologic, maccor, neware from pyprobe.filters import Procedure from pyprobe.readme_processor import process_readme @@ -19,8 +20,6 @@ logger = logging.getLogger(__name__) -__version__ = "1.1.0" - class Cell(BaseModel): """A class for a cell in a battery experiment.""" diff --git a/pyproject.toml b/pyproject.toml index b887a13f..7331f38f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "PyProBE-Data" authors = [ {name = "Thomas Holland"}, ] -version = "1.1.0" +dynamic = ["version"] requires-python = ">=3.11,<3.13" license = { file = "LICENSE" } dependencies = [ @@ -71,6 +71,9 @@ exclude = [ "examples/*" ] +[tool.hatch.version] +path = "pyprobe/_version.py" + [tool.mypy] disallow_any_explicit = false disallow_any_generics = true diff --git a/tests/test_package.py b/tests/test_package.py deleted file mode 100644 index 9b15c5f6..00000000 --- a/tests/test_package.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Test package-level functionality.""" - -import toml - -import pyprobe - - -def test_version(): - """Test version.""" - assert pyprobe.__version__ == toml.load("pyproject.toml")["project"]["version"] diff --git a/uv.lock b/uv.lock index f25ac8dd..77566455 100644 --- a/uv.lock +++ b/uv.lock @@ -1585,7 +1585,7 @@ wheels = [ [[package]] name = "pyprobe-data" -version = "1.1.0" +version = "1.1.4" source = { editable = "." } dependencies = [ { name = "deprecated" },