SorboBot / pyproject.toml
leo-bourrel's picture
!feat: Import new sorbobot version
68a9b68
# Packages configs
[project]
name = "sorbobotapp"
version = "0.0.1"
requires-python = ">=3.10"
readme = "README.md"
[build-system]
requires = ["setuptools"]
## coverage
[tool.coverage.run]
branch = true
[tool.coverage.report]
skip_empty = true
fail_under = 70.00
precision = 2
## black
[tool.black]
target-version = ['py310']
## ruff
# Recommended ruff config for now, to be updated as we go along.
[tool.ruff]
target-version = 'py310'
# See all rules at https://beta.ruff.rs/docs/rules/
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # Pyflakes
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # flake8-docstrings
"I", # isort
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"Q", # flake8-quotes
"UP", # pyupgrade
"PT", # flake8-pytest-style
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # "Line too long"
# -> line length already regulated by black
"PT011", # "pytest.raises() should specify expected exception"
# -> would imply to update tests every time you update exception message
"SIM102", # "Use a single `if` statement instead of nested `if` statements"
# -> too restrictive
"D100",
]
[tool.ruff.pydocstyle]
# Automatically disable rules that are incompatible with Google docstring convention
convention = "google"
[tool.ruff.pycodestyle]
max-doc-length = 88
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.flake8-type-checking]
strict = true
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
# Pydantic needs to be able to evaluate types at runtime
# see https://pypi.org/project/flake8-type-checking/ for flake8-type-checking documentation
# see https://beta.ruff.rs/docs/settings/#flake8-type-checking-runtime-evaluated-base-classes for ruff documentation
[tool.ruff.per-file-ignores]
# Allow missing docstrings for tests
"tests/**/*.py" = ["D100", "D103"]
## mypy
[tool.mypy]
python_version = "3.10"
# Enable all optional error checking flags, providing stricter type checking; see https://mypy.readthedocs.io/en/stable/getting_started.html#strict-mode-and-configuration
strict = true
# Type-check the interiors of functions without type annotations; if missing, mypy won't check function bodies without type hints, for instance those coming from third-party libraries
check_untyped_defs = true
# Make __init__.py file optional for package definitions; if missing, mypy requires __init__.py at packages roots, see https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules
explicit_package_bases = true