Skip to content

Commit

Permalink
fix: removed version command from main
Browse files Browse the repository at this point in the history
  • Loading branch information
Poiuy7312 committed Sep 20, 2023
1 parent 5b86af3 commit 0de2ae4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
10 changes: 0 additions & 10 deletions chasten/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,16 +910,6 @@ def log() -> None:
# of the chasten tool
server.start_syslog_server()


@cli.command()
def version():
"""Display the version of Chasten."""
# Get Chasten version from util file
version_string = util.get_chasten_version()
# output chasten version
typer.echo(f"{version_string}")


# ---
# End region: Command-line interface functions }}}
# ---
12 changes: 1 addition & 11 deletions chasten/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Utilities for use within chasten."""

import importlib.metadata
import pkg_resources

from chasten import constants

Expand Down Expand Up @@ -41,16 +40,7 @@ def get_chasten_version() -> str:
# there is not a working package that importlib.metadata can access with a version;
# in this situation the function should return the default value of 0.0.0
except importlib.metadata.PackageNotFoundError:
try:
# if importlib.metadata fails, try using pkg_resources
# The 'distribution' variable holds information about the 'chasten' package
distribution = pkg_resources.get_distribution(
constants.chasten.Application_Name
)
# Retrieve version information from distribution
version_string_of_foo = distribution.version
except pkg_resources.DistributionNotFound:
# If both methods fail, return a default version
# If method fails, return a default version
version_string_of_foo = default_chasten_semver
return version_string_of_foo

Expand Down

0 comments on commit 0de2ae4

Please sign in to comment.