Skip to content

Commit

Permalink
Merge pull request #66 from AstuteSource/fix/revert-master-commits-again
Browse files Browse the repository at this point in the history
Fix: revert master commits again
  • Loading branch information
simojo authored Sep 21, 2023
2 parents c095ec3 + 41b3d03 commit 31a42d3
Show file tree
Hide file tree
Showing 3 changed files with 862 additions and 746 deletions.
8 changes: 0 additions & 8 deletions chasten/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,14 +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 }}}
Expand Down
11 changes: 1 addition & 10 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,15 +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
version_string_of_foo = default_chasten_semver.version
version_string_of_foo = default_chasten_semver
return version_string_of_foo


Expand Down
Loading

0 comments on commit 31a42d3

Please sign in to comment.