[build-system]
requires = [
    "setuptools>=62.6",
    "wheel"
]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = '--strict-config --strict-markers --durations=30 --durations-min=1 -ra'
filterwarnings = [
    # This is needed since SQLAlchemy 2.0, see
    # https://github.com/aiidalab/aiidalab-widgets-base/issues/605
    'ignore:Object of type.*not in session,.*operation along.*will not proceed:',
    'ignore:Creating AiiDA configuration:UserWarning:',
    'ignore:metadata.*traitlets.traitlets.Unicode object:DeprecationWarning:',
    # For some reason we get this error, see
    # https://github.com/aiidalab/aiidalab-widgets-base/issues/551
    'ignore:Exception ignored in:pytest.PytestUnraisableExceptionWarning:_pytest',
    # This popped up in spglib 2.5. Since we still try to support spglib v1,
    "ignore:dict interface.*is deprecated.Use attribute interface:DeprecationWarning:",
]

[tool.ruff]
line-length = 88
show-fixes = true
output-format = "full"
target-version = "py39"

[tool.ruff.lint]
ignore = ["E501", "E402", "TRY003", "RUF012", "N806"]
select = [
  "A",    # flake8-builtins
  "ARG",  # flake8-unused-arguments
  "B",    # flake8-bugbear
  "C4",   # flake8-comprehensions
  "E",    # pycodestyle
  "F",    # pyflakes
  "I",    # isort
  "N",    # pep8-naming
  "PLE",  # pylint error rules
  "PLW",  # pylint warning rules
  "PLC",  # pylint convention rules
  "RUF",  # ruff-specific rules
  "TRY",  # Tryceratops
  "UP"    # pyupgrade
]

[tool.ruff.lint.isort]
known-first-party = ["aiida", "aiidalab_widgets_base", "aiida_quantumespresso"]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ARG001"]
"tests_integration/*" = ["ARG001"]
