Patchwork D7272: pytype: don't warn us about ignored-on-py3 metaclasses

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 11:01 p.m.
Message ID <differential-rev-PHID-DREV-z73h5mn5hssw2fvdiuip-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42842/
State Superseded
Headers show

Comments

phabricator - Nov. 6, 2019, 11:01 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We can remove this when we're Python 3-only, but for now it's just too
  awkward to deal with and it's harmless.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7272

AFFECTED FILES
  contrib/testparseutil.py
  hgext/infinitepush/store.py
  mercurial/fancyopts.py
  mercurial/templater.py
  mercurial/templateutil.py
  mercurial/util.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 7, 2019, 8:11 a.m.
This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  I wonder if we should adopt a convention like `# TODO nopy2 XXX` to denote things to fix when Python 2 support is ripped out. Otherwise I feel like we're going to forget to undo many of these hacks. (I should have suggested this months ago because there will be lingering signs of Python 2 for years to come, I fear.)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7272/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7272

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1304,7 +1304,7 @@ 
     """
 
 
-class transactional(object):
+class transactional(object):  # pytype: disable=ignored-metaclass
     """Base class for making a transactional type into a context manager."""
 
     __metaclass__ = abc.ABCMeta
diff --git a/mercurial/templateutil.py b/mercurial/templateutil.py
--- a/mercurial/templateutil.py
+++ b/mercurial/templateutil.py
@@ -31,7 +31,7 @@ 
     pass
 
 
-class wrapped(object):
+class wrapped(object):  # pytype: disable=ignored-metaclass
     """Object requiring extra conversion prior to displaying or processing
     as value
 
@@ -108,7 +108,7 @@ 
         """
 
 
-class mappable(object):
+class mappable(object):  # pytype: disable=ignored-metaclass
     """Object which can be converted to a single template mapping"""
 
     __metaclass__ = abc.ABCMeta
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -611,7 +611,7 @@ 
     return s[1:-1]
 
 
-class resourcemapper(object):
+class resourcemapper(object):  # pytype: disable=ignored-metaclass
     """Mapper of internal template resources"""
 
     __metaclass__ = abc.ABCMeta
diff --git a/mercurial/fancyopts.py b/mercurial/fancyopts.py
--- a/mercurial/fancyopts.py
+++ b/mercurial/fancyopts.py
@@ -205,7 +205,7 @@ 
     return parsedopts, parsedargs
 
 
-class customopt(object):
+class customopt(object):  # pytype: disable=ignored-metaclass
     """Manage defaults and mutations for any type of opt."""
 
     __metaclass__ = abc.ABCMeta
diff --git a/hgext/infinitepush/store.py b/hgext/infinitepush/store.py
--- a/hgext/infinitepush/store.py
+++ b/hgext/infinitepush/store.py
@@ -29,7 +29,7 @@ 
     pass
 
 
-class abstractbundlestore(object):
+class abstractbundlestore(object):  # pytype: disable=ignored-metaclass
     """Defines the interface for bundle stores.
 
     A bundle store is an entity that stores raw bundle data. It is a simple
diff --git a/contrib/testparseutil.py b/contrib/testparseutil.py
--- a/contrib/testparseutil.py
+++ b/contrib/testparseutil.py
@@ -80,7 +80,7 @@ 
 ####################
 
 
-class embeddedmatcher(object):
+class embeddedmatcher(object):  # pytype: disable=ignored-metaclass
     """Base class to detect embedded code fragments in *.t test script
     """