[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "vorta"
dynamic = ["version"]
description = "A GUI for Borg Backup"
readme = "README.md"
license = "GPL-3.0-only"
requires-python = ">=3.8"
authors = [{ name = "Manuel Riel and Vorta contributors" }]
keywords = ["backup", "borgbackup"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Environment :: MacOS X",
    "Environment :: X11 Applications :: Qt",
    "Operating System :: MacOS",
    "Operating System :: POSIX",
    "Programming Language :: Python :: 3",
    "Topic :: System :: Archiving :: Backup",
    "Topic :: System :: Systems Administration",
    "Topic :: Utilities",
]
dependencies = [
    "packaging",
    "peewee",
    "platformdirs>=2.6.0,<5.0.0; sys_platform != 'darwin'",
    "platformdirs>=3.0.0,<5.0.0; sys_platform == 'darwin'",
    "psutil",
    "pyobjc-core<13; sys_platform == 'darwin'",
    "pyobjc-framework-Cocoa<13; sys_platform == 'darwin'",
    "pyobjc-framework-CoreWLAN<13; sys_platform == 'darwin'",
    "pyobjc-framework-LaunchServices<13; sys_platform == 'darwin'",
    "pyqt6",
    "secretstorage; sys_platform != 'darwin'",
]

[project.optional-dependencies]
test = ["pytest", "pytest-qt", "pytest-mock", "pytest-cov"]

[dependency-groups]
dev = [
    "coverage",
    "macholib",
    "nox",
    "pkgconfig",
    "pre-commit",
    "pyinstaller",
    "pylint",
    "pytest",
    "pytest-cov",
    "pytest-faulthandler",
    "pytest-mock",
    "pytest-qt",
    "ruff",
    "tox",
    "twine",
    "wheel",
]

[project.urls]
Homepage = "https://github.com/borgbase/vorta"
"Bug Tracker" = "https://github.com/borgbase/vorta/issues"
Documentation = "https://docs.borgbase.com"
"Source Code" = "https://github.com/borgbase/vorta"

[project.gui-scripts]
vorta = "vorta.__main__:main"

[tool.setuptools.dynamic]
version = { attr = "vorta._version.__version__" }

[tool.setuptools.packages.find]
where = ["src"]

[tool.ruff]
line-length = 120
include = ["src/**/*.py", "tests/**/*.py"]

[tool.ruff.lint]
select = [
    "E",  # Error
    "F",  # pyflakes
    "I",  # isort
    "W",  # Warning
    "YTT", # flake8-2020
]
ignore = [
    "F401",
]

[tool.ruff.format]
quote-style = "preserve"

[tool.pytest.ini_options]
addopts = "-vs"
testpaths = ["tests"]
qt_default_raising = true
filterwarnings = ["ignore::DeprecationWarning"]

[tool.coverage.run]
source = ["vorta"]
omit = ["tests/*"]
relative_files = true

[tool.tox]
env_list = ["py38", "py39", "py310", "py311", "py312", "ruff"]
skip_missing_interpreters = true

[tool.tox.env_run_base]
deps = ["pytest", "pytest-qt", "pytest-mock"]
commands = [["pytest"]]
pass_env = ["DISPLAY"]

[tool.tox.env.ruff]
deps = ["ruff"]
commands = [["ruff", "check", "src", "tests"]]

[tool.pylint.master]
extension-pkg-whitelist = "PyQt6"
load-plugins = ""

[tool.pylint."messages control"]
disable = "W0511,C0301,R0903,W0212,C0114,C0115,C0116,C0103,E0611,E1120,C0415,R0914,R0912,R0915"

[tool.pylint.format]
max-line-length = 120
