From 6ffbc8aa51108afc6240399fb78905b4a1fc2fcc 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/quatutil/quatutil.py | 4 ++++ setup.py | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Ska/quatutil/quatutil.py b/Ska/quatutil/quatutil.py index b3bac62..1c59e7f 100644 --- a/Ska/quatutil/quatutil.py +++ b/Ska/quatutil/quatutil.py @@ -3,6 +3,10 @@ from numpy import sin, cos, tan, arctan2, radians, degrees, sqrt from Quaternion import Quat +import ska_helpers + +__version__ = ska_helpers.get_version('Ska.quatutil') + def radec2eci(ra, dec): """ diff --git a/setup.py b/setup.py index a67507f..6f02f54 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,6 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst from setuptools import setup -from Ska.quatutil import __version__ - try: from testr.setup_helper import cmdclass except ImportError: @@ -13,7 +11,8 @@ description='ACA quaternion utilities', author_email='taldcroft@cfa.harvard.edu', url='http://cxc.harvard.edu/mta/ASPECT/tool_doc/pydocs/Ska.quatutil.html', - version=__version__, + use_scm_version=True, + setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'], zip_safe=False, packages=['Ska', 'Ska.quatutil', 'Ska.quatutil.tests'], tests_require=['pytest'], From 4b754a2d2dca37e9a9680b277f085b1a225a5789 Mon Sep 17 00:00:00 2001 From: Javier Gonzalez Date: Fri, 20 Dec 2019 11:42:17 -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 1c0b868216c98d707402c7ae43a495774585c0db 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/quatutil/quatutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ska/quatutil/quatutil.py b/Ska/quatutil/quatutil.py index 1c59e7f..cb41682 100644 --- a/Ska/quatutil/quatutil.py +++ b/Ska/quatutil/quatutil.py @@ -5,7 +5,7 @@ import ska_helpers -__version__ = ska_helpers.get_version('Ska.quatutil') +__version__ = ska_helpers.get_version(__package__) def radec2eci(ra, dec):