Skip to content

Disable pytype pyi-error globally #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:
task: [Typecheck, Lint, Ruff, Yapf, Test]
include:
- task: Typecheck
cmd: pytype -j auto .
# We disable pyi-error due to https://github.com/google/pytype/issues/764
# and other related issues with tensorflow imports.
cmd: pytype -j auto --disable=pyi-error .
- task: Lint
cmd: pylint --rcfile .pylintrc --recursive yes .
- task: Ruff
Expand Down
4 changes: 0 additions & 4 deletions compiler_opt/es/blackbox_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
from compiler_opt.rl import policy_saver
from compiler_opt.es import blackbox_evaluator # pylint: disable=unused-import

# Pytype cannot pick up the pyi file for tensorflow.summary. Disable the error
# here as these errors are false positives.
# pytype: disable=pyi-error

# If less than 40% of requests succeed, skip the step.
_SKIP_STEP_SUCCESS_RATIO = 0.4

Expand Down
3 changes: 1 addition & 2 deletions compiler_opt/rl/compilation_runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
from absl import flags
import tensorflow as tf

# This is https://github.com/google/pytype/issues/764
from google.protobuf import text_format # pytype: disable=pyi-error
from google.protobuf import text_format

from compiler_opt.rl import compilation_runner
from compiler_opt.rl import constant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from tf_agents.trajectories import time_step
from tf_agents.system import system_multiprocessing as multiprocessing

from google.protobuf import text_format # pytype: disable=pyi-error
from google.protobuf import text_format

from compiler_opt.rl.imitation_learning import generate_bc_trajectories_lib
from compiler_opt.rl import env
Expand Down
4 changes: 0 additions & 4 deletions compiler_opt/rl/imitation_learning/weighted_bc_trainer_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
('Directory containing the quantile map for normalizing features'
'in feature_ops.build_quantile_map.'))

# Pytype cannot pick up the pyi file for tensorflow.summary. Disable the error
# here as these errors are false positives.
# pytype: disable=pyi-error


@gin.configurable
class TrainingWeights:
Expand Down
3 changes: 1 addition & 2 deletions compiler_opt/rl/local_data_collector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import tensorflow as tf
from tf_agents.system import system_multiprocessing as multiprocessing

# This is https://github.com/google/pytype/issues/764
from google.protobuf import text_format # pytype: disable=pyi-error
from google.protobuf import text_format
from compiler_opt.distributed.local.local_worker_manager import LocalWorkerPoolManager
from compiler_opt.rl import compilation_runner
from compiler_opt.rl import corpus
Expand Down
3 changes: 1 addition & 2 deletions compiler_opt/rl/log_reader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
import json
from compiler_opt.rl import log_reader

# This is https://github.com/google/pytype/issues/764
from google.protobuf import text_format # pytype: disable=pyi-error
from google.protobuf import text_format
from typing import BinaryIO

import numpy as np
Expand Down
4 changes: 0 additions & 4 deletions compiler_opt/rl/train_bc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
from absl import logging
import gin

# Pytype cannot pick up the pyi file for tensorflow.summary. Disable the error
# here as these errors are false positives.
# pytype: disable=pyi-error

# <Internal> Using XM - flags. # pylint: disable=unused-import
from compiler_opt.rl import agent_config
from compiler_opt.rl import data_reader
Expand Down
3 changes: 1 addition & 2 deletions compiler_opt/tools/generate_default_trace_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import gin
import tensorflow as tf

# This is https://github.com/google/pytype/issues/764
from google.protobuf import text_format # pytype: disable=pyi-error
from google.protobuf import text_format
from compiler_opt.rl import compilation_runner
from compiler_opt.tools import generate_default_trace

Expand Down