From c919672a70b8918ac74c02405d62bae4e60129a7 Mon Sep 17 00:00:00 2001 From: Javier Gonzalez Date: Tue, 17 Dec 2019 12:57:36 -0500 Subject: [PATCH 1/3] Added changes to use setuptools_scm --- Ska/File.py | 4 +++- setup.py | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Ska/File.py b/Ska/File.py index 92f7db8..bc0fab6 100644 --- a/Ska/File.py +++ b/Ska/File.py @@ -8,7 +8,9 @@ import glob import contextlib -__version__ = '3.4.1' +import ska_helpers + +__version__ = ska_helpers.get_version('Ska.File') @contextlib.contextmanager diff --git a/setup.py b/setup.py index 8b49994..919403b 100755 --- a/setup.py +++ b/setup.py @@ -1,14 +1,13 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst from setuptools import setup -from Ska.File import __version__ - setup(name='Ska.File', author = 'Tom Aldcroft', description='Various file utilities', author_email = 'taldcroft@cfa.harvard.edu', py_modules = ['Ska.File'], - version=__version__, + use_scm_version=True, + setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'], zip_safe=False, packages=['Ska'], package_dir={'Ska' : 'Ska'}, From 9d74de84ed027e4c1eeae42aae67cb3d9cc36ff3 Mon Sep 17 00:00:00 2001 From: Javier Gonzalez Date: Fri, 20 Dec 2019 11:42:16 -0500 Subject: [PATCH 2/3] added files for scm git archive --- .git_archival.txt | 1 + .gitattributes | 1 + 2 files changed, 2 insertions(+) create mode 100644 .git_archival.txt create mode 100644 .gitattributes diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 0000000..95cb3ee --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1 @@ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..00a7b00 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.git_archival.txt export-subst From 89bf0c370c34e94a6ec70aae4670647fb8d37fce Mon Sep 17 00:00:00 2001 From: Javier Gonzalez Date: Thu, 9 Jan 2020 15:16:30 -0500 Subject: [PATCH 3/3] Use __package__ also in cases where module is not defined in __init__.py --- Ska/File.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ska/File.py b/Ska/File.py index bc0fab6..bfec15a 100644 --- a/Ska/File.py +++ b/Ska/File.py @@ -10,7 +10,7 @@ import ska_helpers -__version__ = ska_helpers.get_version('Ska.File') +__version__ = ska_helpers.get_version(__package__) @contextlib.contextmanager