Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions fms_mo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@
# limitations under the License.
"""FMS Model Optimizer init. Import most commonly used functions and classes here."""

# Standard
from importlib.metadata import PackageNotFoundError, version
import logging

# Local
from fms_mo.prep import qmodel_prep
from fms_mo.utils.qconfig_utils import qconfig_init

VERSION_FALLBACK = "0.0.0"

try:
__version__ = version("fms_mo")
except PackageNotFoundError:
__version__ = VERSION_FALLBACK
from fms_mo.version import __version__, __version_tuple__
29 changes: 29 additions & 0 deletions fms_mo/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright The FMS Model Optimizer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""FMS Model Optimizer version"""

try:
# Local
from ._version import ( # pylint: disable=unused-import
__version__,
__version_tuple__,
)
except ImportError as e:
# Standard
import warnings

warnings.warn(f"Failed to read commit hash:\n{e}", RuntimeWarning, stacklevel=2)

__version__ = "dev"
__version_tuple__ = (0, 0, __version__)
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=60", "setuptools-scm>=8.0"]
requires = ["setuptools>=64", "setuptools-scm>=8.0"]

[project]
name = "fms-model-optimizer"
Expand Down Expand Up @@ -56,9 +56,15 @@ source = "https://github.com/foundation-model-stack/fms-model-optimizer"
issues = "https://github.com/foundation-model-stack/fms-model-optimizer/issues"

[tool.setuptools_scm]
# Version files are optional, this just marginally speeds up version inspection
# at runtime
version_file = "fms_mo/_version.py"
# do not include +gREV local version, required for Test PyPI upload
# Do not include +gREV local version, required for Test PyPI upload
# Version strings are formatted as `{version}+{local}`, e.g. "0.1.dev1+gb1a7032"
# Local versioning is incompatible with pypi, so we disable it by default.
local_scheme = "no-local-version"
# For more version configuration, see
# https://setuptools-scm.readthedocs.io/en/latest/config/

[tool.setuptools.packages.find]
where = [""]
Expand Down
Loading