Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit e4fb61f

Browse files
danielcressmangcf-merge-on-green[bot]parthea
authored
docs(readme): add pylint limitations (#246)
Re: https://github.com/googleapis/python-vision/issues/6, the generated methods on the `ImageAnnotatorClient` class do not play nicely with Pylint. As a workaround, let's add this to the README so that future users have a chance to see this limitation up-front and save themselves some time. Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 06d4de7 commit e4fb61f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,30 @@ Example Usage
108108
'features': [{'type_': vision.Feature.Type.FACE_DETECTION}]
109109
})
110110
111+
Known Limitations
112+
~~~~~~~~~~~~~~~~~
113+
114+
Pylint Does Not Work Out Of The Box
115+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116+
117+
Pylint throws errors by default when checking code that uses feature methods on the
118+
``ImageAnnotatorClient`` class, such as ``label_detection()`` or ``text_detection()``.
119+
120+
As a workaround, member checking on all methods of the ``ImageAnnotatorClient`` can be
121+
disabled using Pylint's ``generated-members`` option. To do this on a line-by-line basis,
122+
add a comment like ``# pylint: disable=no-member`` to suppress this error. To do this
123+
for a whole project, you can add the following lines to a ``.pylintrc`` file in your project::
124+
125+
[TYPECHECK]
126+
127+
generated-members=<<REGULAR EXPRESSION>>
128+
129+
Substitute a regular expression of your choosing that matches all lines for which you want to
130+
disable this error check. For example, if you choose a convention of naming your
131+
``ImageAnnotatorClient`` variables ``image_annotator_client``, then your regex could be
132+
``image_annotator_client.*`` or something similar.
133+
134+
111135
Next Steps
112136
~~~~~~~~~~
113137

0 commit comments

Comments
 (0)