Skip to content

Commit

Permalink
Fix mistake in getting __version__ from __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Mar 8, 2019
1 parent f70fe12 commit 4baa69d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Ska/engarchive/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

# Get the version. Ska.engarchive / cheta is a twisted case because the
# package metadata can live either one or two directories above. So just
# try both.
from setuptools_scm import get_version
from pathlib import Path
root = Path('..')
from pkg_resources import get_distribution, DistributionNotFound

try:
__version__ = get_version(root=root, relative_to=__file__)
except LookupError:
__version__ = get_version(root=root / '..', relative_to=__file__)
# Normally use the generic __name__ here, but for the dual Ska.engarchive
# and cheta install, hardwire to 'Ska.engarchive' which is the package name.
__version__ = get_distribution('Ska.engarchive').version
except DistributionNotFound:
# package is not installed
pass


def test(*args, **kwargs):
Expand Down

0 comments on commit 4baa69d

Please sign in to comment.