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

Document required autopep8 minimum version

    XMLWordPrintable

    Details

      Description

      1. autopep8 should not add blank line before docstring:

      $ cat /etc/debian_version 
      8.6
      $ autopep8 . --in-place --recursive     --ignore E133,E226,E228,E251,N802,N803 --max-line-length 110
      ...
      $ git diff
      ...
      +
       class _UnreadableConfigError(_ToolError):
      +
           def __init__(self, config):
               _ToolError.__init__(self, "Can't access the config file: " + str(config))
       
       
      -####################################################################################
      +#
       class CommandParser(object):
      +
           """
           Parse commands and calls appropriate function from qservAdmin.
           """
       
           requiredOpts = {
      -        "createDb" : [ # Db opts
      +        "createDb": [  # Db opts
      ...
      $ pydocstyle
      bash: pydocstyle: command not found
      

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            I'm pretty sure that autopep8 itself does not add a blank line by default as we have made extensive use of this command as part of the Python 3 port and lines were not added.

            Show
            tjenness Tim Jenness added a comment - I'm pretty sure that autopep8 itself does not add a blank line by default as we have made extensive use of this command as part of the Python 3 port and lines were not added.
            Hide
            jsick Jonathan Sick added a comment -

            Fabrice Jammes can you pip freeze or conda list (if using conda) your environment? I'm curious about what packages and what versions of packages are installed. I agree with Tim Jenness, this seems to be new behavior and it'd be good to know what's causing it.

            Show
            jsick Jonathan Sick added a comment - Fabrice Jammes can you pip freeze or conda list (if using conda) your environment? I'm curious about what packages and what versions of packages are installed. I agree with Tim Jenness , this seems to be new behavior and it'd be good to know what's causing it.
            Hide
            jsick Jonathan Sick added a comment -

            I'm seeing that in early 2015 there were GitHub issues talking about how autopep8 was adding these blank lines before class docstrings. E.g. https://github.com/hhatto/autopep8/issues/194

            However, the fix seems to have been merged on Feb 26, 2015, which looks like v1.2

            Perhaps the solution is to specify the minimum version of autopep8 in the Python Style Guide?

            Show
            jsick Jonathan Sick added a comment - I'm seeing that in early 2015 there were GitHub issues talking about how autopep8 was adding these blank lines before class docstrings. E.g. https://github.com/hhatto/autopep8/issues/194 However, the fix seems to have been merged on Feb 26, 2015 , which looks like v1.2 Perhaps the solution is to specify the minimum version of autopep8 in the Python Style Guide?
            Hide
            tjenness Tim Jenness added a comment -

            If Fabrice Jammes is using an older version then noting the 1.2 minimum version in the docs is probably a good idea. I'm not sure how such an old version is possible from conda or pip though.

            Show
            tjenness Tim Jenness added a comment - If Fabrice Jammes is using an older version then noting the 1.2 minimum version in the docs is probably a good idea. I'm not sure how such an old version is possible from conda or pip though.
            Hide
            jammes Fabrice Jammes added a comment - - edited

            Hi,

            Yes, it should be my autopep8 version which cause trouble:

            pip freeze | grep autopep8
            autopep8==0.9.1
            

            Thanks for updating documentation with minimum required version (Maybe with a warn message?)
            This ticket can be closed, thanks so much for your help.

            Show
            jammes Fabrice Jammes added a comment - - edited Hi, Yes, it should be my autopep8 version which cause trouble: pip freeze | grep autopep8 autopep8==0.9.1 Thanks for updating documentation with minimum required version (Maybe with a warn message?) This ticket can be closed, thanks so much for your help.
            Hide
            jsick Jonathan Sick added a comment -

            This ticket adds a minimum version requirement for autopep8 to the Python Style Guide that resolves this issue.

            See the draft at https://developer.lsst.io/v/DM-9509/coding/python_style_guide.html#autopep8-may-be-used-to-fix-pep-8-compliance

            Show
            jsick Jonathan Sick added a comment - This ticket adds a minimum version requirement for autopep8 to the Python Style Guide that resolves this issue. See the draft at https://developer.lsst.io/v/DM-9509/coding/python_style_guide.html#autopep8-may-be-used-to-fix-pep-8-compliance
            Hide
            ktl Kian-Tat Lim added a comment -

            Show
            ktl Kian-Tat Lim added a comment -

              People

              Assignee:
              jsick Jonathan Sick
              Reporter:
              jammes Fabrice Jammes
              Reviewers:
              Kian-Tat Lim
              Watchers:
              Fabrice Jammes, Fritz Mueller, Jonathan Sick, Kian-Tat Lim, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.