[tool.poetry]
name = "ows-location"
version = "0.1.0"
description = "Orchard web service for resolving IP addresses to location."
authors = ["The Orchard <webdev@theorchard.com>"]
packages = [
    { include = "location", from = "." },
]

[[tool.poetry.source]]
name = "theorchard"
url = "https://pypi.theorchard.io/pypi/"
priority = "supplemental"

[tool.poetry.dependencies]
python = "^3.11"
fansifter-common = "^0.5.0"
jwtauth = "^0.2.0"
IP2Location = "^8.10.0"
fastapi = "^0.111.0"
uvicorn = "^0.30.1"
typer = "^0.12.3"
sentry-sdk = { extras = ["fastapi"], version = "^2.1.1" }
PyYAML = "^6.0"
ddtrace = "^2.9.1"

[tool.poetry.group.dev.dependencies]
mypy = "1.10.0"
ruff = "^0.4.6"
pytest = "^8.2.2"
pytest-cov = "^5.0.0"
pytest-mock = "^3.11.1"
pytest-env = "^1.1.3"
Faker = "^14.1.0"
python-dotenv = "^1.0.0"
types-tabulate = "^0.8.11"
types-PyYAML = "^6.0.11"
types-urllib3 = "^1.26.25.8"

[tool.mypy]
python_version = "3.11"
strict = true
show_error_codes = true
plugins = ["pydantic.mypy"]

[[tool.mypy.overrides]]
module = [
    "IP2Location.*"
]
ignore_missing_imports = true

[tool.ruff]
line-length = 88
target-version = "py311"

[tool.ruff.lint]
select = ["C", "E", "F", "W", "B", "I", "UP", "T20", "TID252", "G"]
ignore = ["E501", "B008", "B009"]

[tool.ruff.lint.isort]
combine-as-imports = true
forced-separate = ["tests"]

[tool.coverage.report]
exclude_also = [
    "@abstractmethod",
    "@abc.abstractmethod",
    "if TYPE_CHECKING",
    "raise NotImplementedError",
    "if settings.sentry_dsn:",
]

[tool.pytest.ini_options]
addopts = [
    "--strict-config",
    "--strict-markers",
]
xfail_strict = true
junit_family = "xunit2"
env = [
    "APP_DEBUG = true",
    "Environment = test",
    "SENTRY_DSN = ",
    "LOG_FORMAT = console",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
