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

Reformat code and run black+isort in linting mode in middleware packages

    XMLWordPrintable

    Details

      Description

      Run black and isort on all middleware packages, then add a GitHub action such as https://black.readthedocs.io/en/stable/integrations/github_actions.html to ensure formatting is maintained.

       

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            I've added utils to the list.

            Show
            tjenness Tim Jenness added a comment - I've added utils to the list.
            Hide
            tjenness Tim Jenness added a comment -

            I've done utils since I know there wasn't any pending work associated with it and I already had the resources package to lean on as an example.

            Show
            tjenness Tim Jenness added a comment - I've done utils since I know there wasn't any pending work associated with it and I already had the resources package to lean on as an example.
            Hide
            jbosch Jim Bosch added a comment -

            I think this is ready for review.  PRs are:

            I don't think it's worthwhile for anybody to look at all of these in detail, and the last two comments on RFC-809 explain all of the non-mechanical, non-configuration changes (as do the commit messages, which are same across packages).  But it'd be good to at least scan those commit messages and spot-check commits other than the big mechanical "run black and isort" ones.

            There are also still complaints about MyPy in utils and daf_butler, due to a new version of that appearing on pypi.  If I can get that version with conda before I merge, I'll fix the problems here; if I can't, I'll pin the mypy version in the GHA.  In any case, I think it's best to consider that distinct from the rest of the ticket, even if it ends up on the same branches.

            Show
            jbosch Jim Bosch added a comment - I think this is ready for review.  PRs are: https://github.com/lsst/utils/pull/110 (mostly done by Tim Jenness , already reviewed by me) https://github.com/lsst/daf_butler/pull/620 https://github.com/lsst/pipe_base/pull/220 https://github.com/lsst/obs_base/pull/402 https://github.com/lsst/ctrl_mpexec/pull/157 I don't think it's worthwhile for anybody to look at all of these in detail, and the last two comments on RFC-809 explain all of the non-mechanical, non-configuration changes (as do the commit messages, which are same across packages).  But it'd be good to at least scan those commit messages and spot-check commits other than the big mechanical "run black and isort" ones. There are also still complaints about MyPy in utils and daf_butler, due to a new version of that appearing on pypi.  If I can get that version with conda before I merge, I'll fix the problems here; if I can't, I'll pin the mypy version in the GHA.  In any case, I think it's best to consider that distinct from the rest of the ticket, even if it ends up on the same branches.
            Hide
            jbosch Jim Bosch added a comment -

            Update: mypy changes were not quite what I expected; the daf_butler GHA had already pinned mypy, and this just needed to be propagated to utils to get that working.  And the problems with mypy in daf_butler were real, and caused by this ticket: black moved around some "type: ignore" annotations.  Both issues now fixed.

            Show
            jbosch Jim Bosch added a comment - Update: mypy changes were not quite what I expected; the daf_butler GHA had already pinned mypy, and this just needed to be propagated to utils to get that working.  And the problems with mypy in daf_butler were real, and caused by this ticket: black moved around some "type: ignore" annotations.  Both issues now fixed.
            Hide
            tjenness Tim Jenness added a comment -

            I'm happy with these changes.

            Show
            tjenness Tim Jenness added a comment - I'm happy with these changes.

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              jbosch Jim Bosch
              Reviewers:
              Tim Jenness
              Watchers:
              Jim Bosch, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.