[project]
name = "hyprshade"
dynamic = ["version"]
description = "Hyprland shade configuration tool"
authors = [{ name = "John Bernard", email = "loqusion@gmail.com" }]
readme = "README.md"
requires-python = ">=3.11,<4.0"
license = { text = "MIT" }
dependencies = ["click>=8.1.7", "more_itertools>=10.1.0"]

[project.urls]
Issues = "https://github.com/loqusion/hyprshade/issues"
Source = "https://github.com/loqusion/hyprshade"

[project.scripts]
hyprshade = "hyprshade.cli:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"


[tool.rye]
managed = true
dev-dependencies = [
  "black>=23.7.0",
  "coverage>=7.3.0",
  "hatchling>=1.18.0",
  "mypy>=1.5.1",
  "pip>=23.2.1",
  "pytest>=7.4.1",
  "ruff>=0.0.287",
]

[tool.rye.scripts]
test = { chain = ["test:coverage-report"] }
lint = { chain = ["lint:style", "lint:typing"] }
fmt = "ruff format ."
fix = "ruff check --fix ."
release = "./scripts/release.sh"

"test:pytest" = "pytest tests/"
"test:coverage" = "coverage run -m pytest tests/"
"test:_coverage-report" = "coverage report"
"test:coverage-report" = { chain = ["test:coverage", "test:_coverage-report"] }

"lint:typing" = "mypy --install-types --non-interactive src/hyprshade tests"
"lint:style" = { chain = ["lint:ruff", "lint:formatting"] }
"lint:ruff" = "ruff check ."
"lint:formatting" = "ruff format --check ."


[tool.hatch.version]
path = "src/hyprshade/__init__.py"

[tool.hatch.build.targets.sdist]
include = ["src/hyprshade", "tests", "shaders"]

[tool.hatch.build.targets.wheel]
packages = ["src/hyprshade"]
[tool.hatch.build.targets.wheel.shared-data]
"shaders" = "share/hyprshade/shaders"


[tool.ruff.lint]
select = [
  "B",   # flake8-bugbear
  "C4",  # flake8-comprehensions
  "E4", "E7", "E9",  # pycodestyle
  "ERA", # flake8-eradicate/eradicate
  "F",   # pyflakes
  "I",   # isort
  "N",   # pep8-naming
  "PGH", # pygrep
  "PIE", # flake8-pie
  "PT",  # flake8-pytest-style
  "RUF", # ruff checks
  "SIM", # flake8-simplify
  "TC",  # flake8-type-checking
  "TID", # flake8-tidy-imports
  "UP",  # pyupgrade
  "YTT", # flake8-2020
]
ignore = ["TC006"]

[tool.ruff.lint.isort]
known-first-party = ["hyprshade"]

[tool.mypy]
check_untyped_defs = true

[tool.pytest.ini_options]
addopts = ["-r", "a", "--import-mode=importlib"]
markers = ["requires_hyprland: Tests that require hyprland to be running"]
pythonpath = "."

[tool.coverage.run]
source = ["src/"]
omit = ["src/hyprshade/__init__.py", "src/hyprshade/__main__.py"]

[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:"]
