From 4eec2bbb1fd5aa6e246c3a9436eefb29d8c49485 Mon Sep 17 00:00:00 2001 From: danielcressman Date: Wed, 13 Oct 2021 23:59:47 -1000 Subject: [PATCH] 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 --- packages/google-cloud-vision/README.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/google-cloud-vision/README.rst b/packages/google-cloud-vision/README.rst index 6173c1ab24ef..1866f2162691 100644 --- a/packages/google-cloud-vision/README.rst +++ b/packages/google-cloud-vision/README.rst @@ -108,6 +108,30 @@ Example Usage 'features': [{'type_': vision.Feature.Type.FACE_DETECTION}] }) +Known Limitations +~~~~~~~~~~~~~~~~~ + +Pylint Does Not Work Out Of The Box +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Pylint throws errors by default when checking code that uses feature methods on the +``ImageAnnotatorClient`` class, such as ``label_detection()`` or ``text_detection()``. + +As a workaround, member checking on all methods of the ``ImageAnnotatorClient`` can be +disabled using Pylint's ``generated-members`` option. To do this on a line-by-line basis, +add a comment like ``# pylint: disable=no-member`` to suppress this error. To do this +for a whole project, you can add the following lines to a ``.pylintrc`` file in your project:: + + [TYPECHECK] + + generated-members=<> + +Substitute a regular expression of your choosing that matches all lines for which you want to +disable this error check. For example, if you choose a convention of naming your +``ImageAnnotatorClient`` variables ``image_annotator_client``, then your regex could be +``image_annotator_client.*`` or something similar. + + Next Steps ~~~~~~~~~~