Skip to content

Commit

Permalink
Fix naima.__version__
Browse files Browse the repository at this point in the history
  • Loading branch information
zblz committed Nov 8, 2019
1 parent cfe6cd0 commit 565bfcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/naima/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
"""

# Affiliated packages may add whatever they like to this file, but
from . import models
from .analysis import *
from .core import *
from .model_fitter import *
from .plot import *
from .utils import *
from .version import __version__

# ----------------------------------------------------------------------------
from .version import get_version

__version__ = get_version()
del get_version


try:
Expand Down
12 changes: 7 additions & 5 deletions src/naima/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from pkg_resources import get_distribution, DistributionNotFound

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
__version__ = ""

def get_version():
try:
return get_distribution("naima").version
except DistributionNotFound:
# package is not installed
return "UNINSTALLED"

0 comments on commit 565bfcd

Please sign in to comment.