Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-17155

Remove __init__ files from generated templates

    Details

    • Type: Improvement
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: templates
    • Labels:
      None

      Description

      The template package currently creates __init__.py files that contain this boilerplate when generating a stack_package (and possibly other types of templates):

      # ... standard header...
      import pkgutil, lsstimport
      __path__ = pkgutil.extend_path(__path__, __name__)
      

      These files are completely unnecessary in Python 3 and add an unnecessary dependency on the base package. Please stop generating these files .

      Please also remove base and utils as dependencies in the ups table file. As far as I can see the former is only used for lsstimport (which we no longer need) and the latter is not used at all.

        Attachments

          Issue Links

            Activity

            Hide
            jsick Jonathan Sick added a comment -

            Sounds good.

            utils got added because they're so heavily used by typical testing scenarios (i.e., someone complained that it wasn't present). But I agree that we should probably expect a developer to know when utils is necessary.

            Show
            jsick Jonathan Sick added a comment - Sounds good. utils got added because they're so heavily used by typical testing scenarios (i.e., someone complained that it wasn't present). But I agree that we should probably expect a developer to know when utils is necessary.
            Hide
            rowen Russell Owen added a comment -

            utils is not normally used by T&S, which is why prefer it not be included in the ups table file. But based on a conversation on # dm-docs T&S should have a separate template anyway, since the docs layout is likely to be simpler.

            Show
            rowen Russell Owen added a comment - utils is not normally used by T&S, which is why prefer it not be included in the ups table file. But based on a conversation on # dm-docs T&S should have a separate template anyway, since the docs layout is likely to be simpler.
            Hide
            jsick Jonathan Sick added a comment -

            Good points.

            By the way, I'm 70% sure I can accommodate the simpler doc format in a common template. Shall I give it a shot to implement it? Are there other key things you need to keep changing for T&S packages?. (If it doesn't work easily, I'm super happy to add a ts_package template as we discussed).

            Show
            jsick Jonathan Sick added a comment - Good points. By the way, I'm 70% sure I can accommodate the simpler doc format in a common template. Shall I give it a shot to implement it? Are there other key things you need to keep changing for T&S packages?. (If it doesn't work easily, I'm super happy to add a ts_package template as we discussed).
            Hide
            rowen Russell Owen added a comment -

            I know of one more possible hitch for T&S which I hope Andy Clements can speak to: the boilerplate for where to look up package issues has been wrote for T&S software. But we just switched to using DM's Jira setup and as long as T&S plans to add a component for each ts_ package that boilerplate should be perfect. If Andy Clements says we will have those components then my personal opinion is that it would be well worth trying to use the standard template for T&S packages.

            Show
            rowen Russell Owen added a comment - I know of one more possible hitch for T&S which I hope Andy Clements can speak to: the boilerplate for where to look up package issues has been wrote for T&S software. But we just switched to using DM's Jira setup and as long as T&S plans to add a component for each ts_ package that boilerplate should be perfect. If Andy Clements says we will have those components then my personal opinion is that it would be well worth trying to use the standard template for T&S packages.
            Hide
            rowen Russell Owen added a comment -

            Looks great! One small suggested change to the .table files which you can make or not as you see fit.

            Show
            rowen Russell Owen added a comment - Looks great! One small suggested change to the .table files which you can make or not as you see fit.
            Hide
            jsick Jonathan Sick added a comment -

            I believe that that the stack_package template now documents RFC-52, and implements it.

            Show
            jsick Jonathan Sick added a comment - I believe that that the stack_package template now documents RFC-52 , and implements it.
            Hide
            jsick Jonathan Sick added a comment -

            Merged. Thanks for the prompting to do this.

            Show
            jsick Jonathan Sick added a comment - Merged. Thanks for the prompting to do this.

              People

              • Assignee:
                jsick Jonathan Sick
                Reporter:
                rowen Russell Owen
                Reviewers:
                Russell Owen
                Watchers:
                Jonathan Sick, Russell Owen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel