2023-03-11 21:15:26 +00:00
|
|
|
[tool.ruff]
|
|
|
|
|
# Same as Black.
|
|
|
|
|
line-length = 127
|
2024-11-18 14:40:36 +00:00
|
|
|
# Assume Python 3.9
|
|
|
|
|
target-version = "py39"
|
2024-02-19 15:44:02 +00:00
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
2023-03-12 17:47:52 +00:00
|
|
|
# See https://beta.ruff.rs/docs/rules/
|
|
|
|
|
select = ["E", "F", "B", "UP", "C90", "RUF"]
|
2023-06-23 10:21:58 +00:00
|
|
|
# B028: Ignore explicit stacklevel`
|
|
|
|
|
# RUF013: Too many false positives (implicit optional)
|
|
|
|
|
ignore = ["B028", "RUF013"]
|
2019-09-06 08:44:55 +00:00
|
|
|
|
2024-02-19 15:44:02 +00:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
2023-03-11 21:15:26 +00:00
|
|
|
# Default implementation in abstract methods
|
2024-07-22 11:42:33 +00:00
|
|
|
"./stable_baselines3/common/callbacks.py" = ["B027"]
|
|
|
|
|
"./stable_baselines3/common/noise.py" = ["B027"]
|
2023-06-23 10:21:58 +00:00
|
|
|
# ClassVar, implicit optional check not needed for tests
|
2024-07-22 11:42:33 +00:00
|
|
|
"./tests/*.py" = ["RUF012", "RUF013"]
|
2023-03-11 21:15:26 +00:00
|
|
|
|
2024-02-19 15:44:02 +00:00
|
|
|
[tool.ruff.lint.mccabe]
|
2023-03-11 21:15:26 +00:00
|
|
|
# Unlike Flake8, default to a complexity level of 10.
|
|
|
|
|
max-complexity = 15
|
|
|
|
|
|
|
|
|
|
[tool.black]
|
|
|
|
|
line-length = 127
|
2020-01-22 15:18:27 +00:00
|
|
|
|
2023-03-11 21:15:26 +00:00
|
|
|
[tool.mypy]
|
|
|
|
|
ignore_missing_imports = true
|
|
|
|
|
follow_imports = "silent"
|
|
|
|
|
show_error_codes = true
|
|
|
|
|
exclude = """(?x)(
|
2023-11-08 08:46:40 +00:00
|
|
|
tests/test_logger.py$
|
2022-11-16 12:22:57 +00:00
|
|
|
| tests/test_train_eval_mode.py$
|
2023-03-11 21:15:26 +00:00
|
|
|
)"""
|
2022-11-16 12:22:57 +00:00
|
|
|
|
2023-03-11 21:15:26 +00:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
|
# Deterministic ordering for tests; useful for pytest-xdist.
|
2024-07-22 11:42:33 +00:00
|
|
|
env = ["PYTHONHASHSEED=0"]
|
2020-07-16 14:12:16 +00:00
|
|
|
|
2023-03-11 21:15:26 +00:00
|
|
|
filterwarnings = [
|
2025-01-07 13:19:05 +00:00
|
|
|
# A2C/PPO on GPU
|
|
|
|
|
"ignore:You are trying to run (PPO|A2C) on the GPU",
|
2023-03-11 21:15:26 +00:00
|
|
|
# Tensorboard warnings
|
|
|
|
|
"ignore::DeprecationWarning:tensorboard",
|
2023-04-14 11:13:59 +00:00
|
|
|
# Gymnasium warnings
|
|
|
|
|
"ignore::UserWarning:gymnasium",
|
2024-06-07 12:07:28 +00:00
|
|
|
# tqdm warning about rich being experimental
|
2024-07-22 11:42:33 +00:00
|
|
|
"ignore:rich is experimental",
|
2023-03-11 21:15:26 +00:00
|
|
|
]
|
|
|
|
|
markers = [
|
2024-07-22 11:42:33 +00:00
|
|
|
"expensive: marks tests as expensive (deselect with '-m \"not expensive\"')",
|
2023-03-11 21:15:26 +00:00
|
|
|
]
|
2023-03-30 09:31:47 +00:00
|
|
|
|
|
|
|
|
[tool.coverage.run]
|
|
|
|
|
disable_warnings = ["couldnt-parse"]
|
|
|
|
|
branch = false
|
|
|
|
|
omit = [
|
2024-07-22 11:42:33 +00:00
|
|
|
"tests/*",
|
|
|
|
|
"setup.py",
|
|
|
|
|
# Require graphical interface
|
|
|
|
|
"stable_baselines3/common/results_plotter.py",
|
|
|
|
|
# Require ffmpeg
|
|
|
|
|
"stable_baselines3/common/vec_env/vec_video_recorder.py",
|
2023-03-30 09:31:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[tool.coverage.report]
|
2024-07-22 11:42:33 +00:00
|
|
|
exclude_lines = [
|
|
|
|
|
"pragma: no cover",
|
|
|
|
|
"raise NotImplementedError()",
|
|
|
|
|
"if typing.TYPE_CHECKING:",
|
|
|
|
|
]
|