Skip to content

Commit

Permalink
not using extra version file anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Apr 9, 2024
1 parent dbb1861 commit 13e3086
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
23 changes: 2 additions & 21 deletions otaclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@
# limitations under the License.


from pathlib import Path
from otaclient._version import version, __version__

# the package name for the otaclient package,
# in normal case it should be "otaclient"
otaclient_package_name = __name__.split(".")[0]

try:
# version info is generated by setuptools-scm and stored in
# otaclient._version, check pyproject.toml for settings
from ._version import version as __version__, version_tuple
except ImportError:
from otaclient.app.configs import EXTRA_VERSION_FILE

# try import version from VERSION file if any
_extra_version = Path(EXTRA_VERSION_FILE)
if _extra_version.is_file():
__version__ = _extra_version.read_text()
else:
__version__ = "unknown"
version_tuple = (0, 0, "unknown")

__all__ = ["__version__", "version_tuple"]
__all__ = ["version", "__version__"]
4 changes: 1 addition & 3 deletions otaclient/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from otaclient import __version__ # type: ignore
from .proto import wrapper, v2, v2_grpc, ota_metafiles # noqa: F401
from .common import read_str_from_file, write_str_to_file_sync
from .configs import config as cfg, EXTRA_VERSION_FILE
from .configs import config as cfg
from .log_setting import configure_logging
from .ota_client_service import launch_otaclient_grpc_server

Expand Down Expand Up @@ -52,8 +52,6 @@ def _check_other_otaclient():

def main():
logger.info("started")
if Path(EXTRA_VERSION_FILE).is_file():
logger.info(read_str_from_file(EXTRA_VERSION_FILE))
logger.info(f"otaclient version: {__version__}")

# start the otaclient grpc server
Expand Down

0 comments on commit 13e3086

Please sign in to comment.