File tree Expand file tree Collapse file tree 3 files changed +38
-13
lines changed
Expand file tree Collapse file tree 3 files changed +38
-13
lines changed Original file line number Diff line number Diff line change 1313# limitations under the License.
1414"""FMS Model Optimizer init. Import most commonly used functions and classes here."""
1515
16- # Standard
17- from importlib .metadata import PackageNotFoundError , version
18- import logging
19-
2016# Local
2117from fms_mo .prep import qmodel_prep
2218from fms_mo .utils .qconfig_utils import qconfig_init
23-
24- VERSION_FALLBACK = "0.0.0"
25-
26- try :
27- __version__ = version ("fms_mo" )
28- except PackageNotFoundError :
29- __version__ = VERSION_FALLBACK
19+ from fms_mo .version import __version__ , __version_tuple__
Original file line number Diff line number Diff line change 1+ # Copyright The FMS Model Optimizer Authors
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ """FMS Model Optimizer version"""
15+
16+ try :
17+ # Local
18+ from ._version import ( # pylint: disable=unused-import
19+ __version__ ,
20+ __version_tuple__ ,
21+ )
22+ except ImportError as e :
23+ # Standard
24+ import warnings
25+
26+ warnings .warn (f"Failed to read commit hash:\n { e } " , RuntimeWarning , stacklevel = 2 )
27+
28+ __version__ = "dev"
29+ __version_tuple__ = (0 , 0 , __version__ )
Original file line number Diff line number Diff line change 11[build-system ]
22build-backend = " setuptools.build_meta"
3- requires = [" setuptools>=60 " , " setuptools-scm>=8.0" ]
3+ requires = [" setuptools>=64 " , " setuptools-scm>=8.0" ]
44
55[project ]
66name = " fms-model-optimizer"
@@ -56,9 +56,15 @@ source = "https://github.com/foundation-model-stack/fms-model-optimizer"
5656issues = " https://github.com/foundation-model-stack/fms-model-optimizer/issues"
5757
5858[tool .setuptools_scm ]
59+ # Version files are optional, this just marginally speeds up version inspection
60+ # at runtime
5961version_file = " fms_mo/_version.py"
60- # do not include +gREV local version, required for Test PyPI upload
62+ # Do not include +gREV local version, required for Test PyPI upload
63+ # Version strings are formatted as `{version}+{local}`, e.g. "0.1.dev1+gb1a7032"
64+ # Local versioning is incompatible with pypi, so we disable it by default.
6165local_scheme = " no-local-version"
66+ # For more version configuration, see
67+ # https://setuptools-scm.readthedocs.io/en/latest/config/
6268
6369[tool .setuptools .packages .find ]
6470where = [" " ]
You can’t perform that action at this time.
0 commit comments