Skip to content

Commit

Permalink
Merge pull request #128 from lsst-sqre/tickets/DM-35917-06
Browse files Browse the repository at this point in the history
DM-35917: Back port CmdLineTask deprecation support for 0.6 release
  • Loading branch information
jonathansick authored Aug 24, 2022
2 parents 9e1939c + c52ae7f commit b8d85c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Log
==========

0.6.14 (2022-08-24)
-------------------

- The ``lsst-task-topic`` directive handles new versions of LSST Science Pipelines' ``lsst.pipe.base`` where ``CmdLineTask`` is not available.

0.6.13 (2022-07-29)
-------------------

Expand Down
13 changes: 10 additions & 3 deletions src/documenteer/sphinxext/lssttasks/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,19 @@ class TaskTopicDirective(BaseTopicDirective):
"""

def get_type(self, class_name):
from lsst.pipe.base import CmdLineTask, PipelineTask
try:
from lsst.pipe.base import CmdLineTask
except ImportError:
CmdLineTask = None
try:
from lsst.pipe.base import PipelineTask
except ImportError:
PipelineTask = None

obj = get_type(class_name)
if issubclass(obj, PipelineTask):
if PipelineTask is not None and issubclass(obj, PipelineTask):
return "PipelineTask"
elif issubclass(obj, CmdLineTask):
elif CmdLineTask is not None and issubclass(obj, CmdLineTask):
return "CmdLineTask"
else:
return "Task"
Expand Down

0 comments on commit b8d85c1

Please sign in to comment.