[build-system]
build-backend = "hatchling.build"
requires = [
  "hatch-vcs",
  "hatchling>=1.27",
]

[project]
name = "osmviz"
description = "OSMViz is a small set of Python tools for retrieving and using Mapnik tiles from a Slippy Map server (you may know these as OpenStreetMap images)."
readme = "README.md"
keywords = [
  "osm openstreetmap tiles visualization",
]
license = "MIT"
license-files = [ "LICENSE.txt" ]
maintainers = [ { name = "Hugo van Kemenade" } ]
authors = [ { name = "Colin Bick and Contributors", email = "colin.bick@gmail.com" } ]
requires-python = ">=3.9"
classifiers = [
  "Intended Audience :: Developers",
  "Programming Language :: Python :: 3 :: Only",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Programming Language :: Python :: 3.14",
  "Programming Language :: Python :: Implementation :: CPython",
  "Programming Language :: Python :: Implementation :: PyPy",
  "Topic :: Software Development :: Documentation",
]
dynamic = [ "version" ]
optional-dependencies.tests = [
  "coverage",
  "pillow>=9.1",
  "pytest",
  "pytest-cov",
]
urls.Changelog = "https://github.com/hugovk/osmviz/releases"
urls.Documentation = "https://hugovk.github.io/osmviz/"
urls.Homepage = "https://github.com/hugovk/osmviz"
urls.Source = "https://github.com/hugovk/osmviz"

[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

[tool.ruff]
fix = true

lint.select = [
  "C4",     # flake8-comprehensions
  "E",      # pycodestyle errors
  "EM",     # flake8-errmsg
  "F",      # pyflakes
  "I",      # isort
  "ICN",    # flake8-import-conventions
  "ISC",    # flake8-implicit-str-concat
  "LOG",    # flake8-logging
  "PGH",    # pygrep-hooks
  "PIE",    # flake8-pie
  "PYI",    # flake8-pyi
  "RUF022", # unsorted-dunder-all
  "RUF100", # unused noqa (yesqa)
  "UP",     # pyupgrade
  "W",      # pycodestyle warnings
  "YTT",    # flake8-2020
]
lint.ignore = [
  "E203",   # Whitespace before ':'
  "E221",   # Multiple spaces before operator
  "E226",   # Missing whitespace around arithmetic operator
  "E241",   # Multiple spaces after ','
  "PIE790", # flake8-pie: unnecessary-placeholder
  "UP038",  # Makes code slower and more verbose
]
lint.flake8-import-conventions.aliases.datetime = "dt"
lint.flake8-import-conventions.banned-from = [ "datetime" ]
lint.isort.known-first-party = [ "osmviz" ]
lint.isort.required-imports = [ "from __future__ import annotations" ]

[tool.pyproject-fmt]
max_supported_python = "3.14"

[tool.pytest.ini_options]
testpaths = [ "tests" ]

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = [
  # Don't complain if non-runnable code isn't run:
  "if __name__ == .__main__.:",
]
