Skip to content

Commit

Permalink
Merge pull request #1 from HumanSignal/jombooth-patch-1
Browse files Browse the repository at this point in the history
Fix metadata reading code for forked package name
  • Loading branch information
jombooth authored Nov 12, 2024
2 parents 49d41b0 + 40e0a67 commit 17a8716
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/drf_yasg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
__author__ = """Cristi V."""
__email__ = '[email protected]'

HS_PREFIX = 'humansignal_'

try:
from importlib.metadata import version
__version__ = version(__name__)
__version__ = version(HS_PREFIX + __name__)
except ImportError: # Python < 3.8
try:
from pkg_resources import DistributionNotFound, get_distribution
__version__ = get_distribution(__name__).version
__version__ = get_distribution(HS_PREFIX + __name__).version
except DistributionNotFound: # pragma: no cover
# package is not installed
pass

0 comments on commit 17a8716

Please sign in to comment.