From 4c12aeeafcf28346fbc92b328012708e871fbf05 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Sun, 17 Aug 2014 15:29:35 -0400 Subject: [PATCH 1/3] Make into a namespace package (broken before) --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 6a3da7a..3bd3375 100755 --- a/setup.py +++ b/setup.py @@ -8,6 +8,8 @@ author_email='aldcroft@head.cfa.harvard.edu', py_modules=['Ska.tdb.tdb'], version=version, + zip_safe=False, + namespace_packages=['Ska'], packages=['Ska', 'Ska.tdb'], package_dir={'Ska.tdb': 'Ska/tdb'}, ) From de77b32a0650ce51428fd445f6a243fb4ecb9a42 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Sun, 17 Aug 2014 15:30:15 -0400 Subject: [PATCH 2/3] Fix so install / import with package data succeeded --- Ska/tdb/tdb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Ska/tdb/tdb.py b/Ska/tdb/tdb.py index ef230c4..7d5f6fc 100644 --- a/Ska/tdb/tdb.py +++ b/Ska/tdb/tdb.py @@ -67,7 +67,10 @@ def set_tdb_version(version=None): TDB_VERSIONS = sorted([int(os.path.basename(vdir)[2:]) for vdir in version_dirs]) if version is None: - version = TDB_VERSIONS[-1] + if TDB_VERSIONS: + version = TDB_VERSIONS[-1] + else: + version = 0 # Allow for package import / installation with no data elif version not in TDB_VERSIONS: raise ValueError('TDB version must be one of the following: {}'.format(TDB_VERSIONS)) @@ -91,7 +94,7 @@ def __getitem__(self, item): filename = os.path.join(DATA_DIR, item + '.npy') self[item] = TableView(np.load(filename)) except IOError: - raise KeyError("Table {} not in TDB files".format(item)) + raise KeyError("Table {} not in TDB files (no file {})".format(item, filename)) return dict.__getitem__(self, item) def keys(self): From 963cdbb10065e083628271ce500c1eeaadf7949d Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Sun, 17 Aug 2014 15:33:22 -0400 Subject: [PATCH 3/3] Update version to 0.4.1 --- Ska/tdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ska/tdb/version.py b/Ska/tdb/version.py index 9080b39..34921e7 100644 --- a/Ska/tdb/version.py +++ b/Ska/tdb/version.py @@ -14,7 +14,7 @@ therein are applicable. """ -version = '0.4' +version = '0.4.1' _versplit = version.replace('dev', '').split('.') major = int(_versplit[0])