Skip to content

Commit

Permalink
remove pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaclynpqc committed Sep 26, 2023
1 parent 76345c2 commit 1800143
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions chasten/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import importlib.metadata

import pkg_resources

from chasten import constants

checkmark_unicode = "\u2713"
Expand Down Expand Up @@ -42,17 +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_string_of_foo = default_chasten_semver
return version_string_of_foo


Expand Down

0 comments on commit 1800143

Please sign in to comment.