diff --git a/src/mudata/__init__.py b/src/mudata/__init__.py index 4377213..fa9ca20 100644 --- a/src/mudata/__init__.py +++ b/src/mudata/__init__.py @@ -19,8 +19,9 @@ from ._core.merge import concat from ._core.mudata import MuData from ._core.to_ import to_anndata, to_mudata -from .version import __version__, __version_tuple__ +from ._version import __version__, __version_tuple__ +# file format versions __anndataversion__ = "0.1.0" __mudataversion__ = "0.1.0" diff --git a/src/mudata/version.py b/src/mudata/version.py deleted file mode 100644 index b0c7fcd..0000000 --- a/src/mudata/version.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Compute the version number and store it in the `__version__` variable. - -Based on . -""" - - -def _get_hatch_version(): - """Compute the most up-to-date version number in a development environment. - - Returns `None` if Hatchling is not installed, e.g. in a production environment. - - For more details, see . - """ - import os - - try: - from hatchling.metadata.core import ProjectMetadata - from hatchling.plugin.manager import PluginManager - from hatchling.utils.fs import locate_file - except ImportError: - # Hatchling is not installed, so probably we are not in - # a development environment. - return None - - pyproject_toml = locate_file(__file__, "pyproject.toml") - if pyproject_toml is None: - return None - root = os.path.dirname(pyproject_toml) - metadata = ProjectMetadata(root=root, plugin_manager=PluginManager()) - # Version can be either statically set in pyproject.toml or computed dynamically: - return metadata.core.version or metadata.hatch.version.cached - - -__version__ = _get_hatch_version() -__version_tuple__ = None -if not __version__: # not in development mode - from ._version import __version__