This is an archive of the discontinued Mercurial Phabricator instance.

pytype: [WIP] suppress various warnings inline to get a clean run
Changes PlannedPublic

Authored by mharbison72 on Nov 23 2019, 7:47 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

This depends on D7295 and D7384, which in turn was applied to 4222b9d5d4fb. I
made no attempt to keep it under 80 columns or blacken it. But it seems useful
to share now, because it is so time consuming to get this far, and presumably
much of this will entail actual fixes. These things were flagged by pytype
2019.12.06 under WSL.

The following bundlerepo warnings were fixed with assertions, but those
assertions fire when running the testsuite for some reason:

line 256, in __init__: No attribute 'ui' on bundlerepository [attribute-error]
line 260, in __init__: No attribute 'ui' on bundlerepository [attribute-error]
line 292, in __init__: No attribute 'ui' on bundlerepository [attribute-error]
line 292, in __init__: No attribute 'vfs' on bundlerepository [attribute-error]
line 330, in _writetempbundle: No attribute 'vfs' on bundlerepository [attribute-error]
  Called from (traceback):
    line 290, in __init__
line 341, in _writetempbundle: No attribute 'vfs' on bundlerepository [attribute-error]
  Called from (traceback):
    line 290, in __init__
line 378, in _consumemanifest: No attribute '_cgunpacker' on bundlerepository [attribute-error]
line 379, in _consumemanifest: No attribute '_cgunpacker' on bundlerepository [attribute-error]
line 380, in _consumemanifest: No attribute '_cgunpacker' on bundlerepository [attribute-error]
line 382, in _consumemanifest: No attribute '_cgunpacker' on bundlerepository [attribute-error]
line 406, in file: No attribute '_cgfilespos' on bundlerepository [attribute-error]
line 412, in file: No attribute 'unfiltered' on bundlerepository [attribute-error]
line 413, in file: No attribute 'svfs' on bundlerepository [attribute-error]
line 413, in file: No attribute 'file' on super [attribute-error]
line 420, in close: No attribute '_bundlefile' on bundlerepository [attribute-error]
line 422, in close: No attribute 'vfs' on bundlerepository [attribute-error]
line 441, in setparents: No attribute 'setparents' on super [attribute-error]
line 441, in setparents: No attribute 'ui' on bundlerepository [attribute-error]
line 443, in setparents: No attribute 'ui' on bundlerepository [attribute-error]

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

mharbison72 created this revision.Nov 23 2019, 7:47 PM
mharbison72 planned changes to this revision.Nov 23 2019, 7:54 PM

Adjusting this to stay out of the review queue. While most of the files only had a handful of errors (and a few could be removed from the blacklist), the few added had a bunch of errors. I didn't see any obvious fixes, and ran out of time Friday to individually suppress them.

I'm assuming we will fix the problems, and then apply the suppressions in narrow categories rather than a monolithic commit like this.

mharbison72 edited the summary of this revision. (Show Details)Dec 17 2019, 12:43 PM
mharbison72 updated this revision to Diff 18818.
mharbison72 planned changes to this revision.Dec 17 2019, 12:52 PM

Still not a queue-able thing. But this adds in the errors that are being suppressed so others can try to fix some of this without the ~10-15minute wait for failures. It looks like there is a recurring issue with converting exceptions to bytes for printing. Also, a few things seem to have gotten fixed in logcmdutil and patch since last time, though I'm slightly concerned that it missed issues that it previously flagged in hgweb/server.py. The only difference I'm aware of is running a new version of pytype, and running under WSL instead of on a Mac.