diff --git a/doc/make.py b/doc/make.py index 2583242786fc8b..15b570b7d5bc2b 100755 --- a/doc/make.py +++ b/doc/make.py @@ -233,7 +233,7 @@ def html(self): ret_code = self._sphinx_build("html") zip_fname = os.path.join(BUILD_PATH, "html", "pandas.zip") if os.path.exists(zip_fname): - os.remove(zip_fname) + os.remove(zip_fname) # noqa: TID251 if ret_code == 0: if self.single_doc_html is not None: @@ -285,7 +285,7 @@ def zip_html(self) -> None: """ zip_fname = os.path.join(BUILD_PATH, "html", "pandas.zip") if os.path.exists(zip_fname): - os.remove(zip_fname) + os.remove(zip_fname) # noqa: TID251 dirname = os.path.join(BUILD_PATH, "html") fnames = os.listdir(dirname) os.chdir(dirname) diff --git a/pandas/tests/copy_view/test_chained_assignment_deprecation.py b/pandas/tests/copy_view/test_chained_assignment_deprecation.py index e1a76e66c107ff..d7ac1f465bac40 100644 --- a/pandas/tests/copy_view/test_chained_assignment_deprecation.py +++ b/pandas/tests/copy_view/test_chained_assignment_deprecation.py @@ -37,7 +37,7 @@ def test_series_setitem(indexer, using_copy_on_write): # using custom check instead of tm.assert_produces_warning because that doesn't # fail if multiple warnings are raised - with pytest.warns() as record: + with pytest.warns() as record: # noqa: TID251 df["a"][indexer] = 0 assert len(record) == 1 if using_copy_on_write: diff --git a/pyproject.toml b/pyproject.toml index a7cb87bbca4b72..82960f8b89e63c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -332,6 +332,17 @@ exclude = [ [tool.ruff.lint.flake8-tidy-imports.banned-api] "urllib.request.urlopen".msg = "Use pandas.io.common.urlopen instead of urllib.request.urlopen" +# numpy.random is banned but np.random is not. Is this intentional? +# "numpy.random".msg = "Do not use numpy.random" +"pytest.warns".msg = "Use tm.assert_produces_warning instead of pytest.warns" +"pytest.xfail".msg = "Use pytest.mark.xfail instead of pytest.xfail" +"conftest".msg = "No direct imports from conftest" +"numpy.testing".msg = "Do not use numpy.testing" +# "numpy.array_equal".msg = "Do not use numpy.array_equal" # Used in pandas/core +"unittest.mock".msg = "use pytest builtin monkeypatch fixture instead" +"os.remove".msg = "Do not use os.remove" + + [tool.ruff.per-file-ignores] # relative imports allowed for asv_bench diff --git a/web/tests/test_pandas_web.py b/web/tests/test_pandas_web.py index aacdfbcd6d26ec..6b88263f98be66 100644 --- a/web/tests/test_pandas_web.py +++ b/web/tests/test_pandas_web.py @@ -1,4 +1,4 @@ -from unittest.mock import ( +from unittest.mock import ( # noqa: TID251 mock_open, patch, )