[tool.poetry]
name = "ows-campaigns"
version = "0.1.0"
description = "The Orchard Web Service for Audience development Campaign Management"
authors = ["The Orchard <webdev@theorchard.com>"]
packages = [
    { include = "campaigns", from = "." },
]
[[tool.poetry.source]]
name = "theorchard"
url = "https://pypi.theorchard.io/pypi/"
secondary = true

[tool.poetry.dependencies]
python = ">=3.11,<3.12"
audience-common = { extras = ["starlette"], version = "^2.13.1" }
pyxdi = "^0.13.1"
fastapi = "^0.99.1"
SQLAlchemy = { extras = ["asyncio"], version = "^2.0.17" }
SQLAlchemy-Utils = "^0.41.0"
psycopg = { extras = ["binary", "pool"], version = "^3.1.8" }
sentry-sdk = { extras = ["fastapi"], version = "^1.25.1" }
ddtrace = "^1.13.4"
pyhumps = "^3.7.3"
httpx = "^0.24.0"
respx = "^0.20.0"
uvicorn = "^0.22.0"
gunicorn = "^20.1.0"
jinja2 = "^3.1.2"
click = "^8.1.3"
boto3 = "^1.24.66"
redis = "^4.6.0"
more-itertools = "^9.0.0"
greenlet = "^2.0.2"
beautifulsoup4 = "^4.11.2"
anyio = "~3.6.2"

[tool.poetry.group.dev.dependencies]
mypy = "^1.4.1"
black = "^23.3.0"
ruff = "^0.0.276"
pre-commit = "^3.2.2"
pytest = "^7.4.0"
pytest-cov = "^4.0.0"
pytest-mock = "^3.10.0"
pytest-env = "^0.8.1"
pytest-docker = "^1.0.0"
python-dotenv = "^1.0.0"
openapi-python-client = "^0.14.1"
boto3-stubs = { extras = ["sts", "s3", "kms"], version = "^1.26.10" }
types-requests = "^2.28.9"
types-PyYAML = "^6.0.12"
types-tabulate = "^0.9.0"
types-python-dateutil = "^2.8.18"
types-redis = "^4.3.21"
types-beautifulsoup4 = "^4.12.0.3"
freezegun = "^1.2.2"
factory-boy = "^3.2.1"
polyfactory = "^2.5.0"

[tool.black]
line-length = 88
target-version = ['py311']
include = '\.pyi?$'

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

[[tool.mypy.overrides]]
module = [
    "sqlalchemy_utils.*",
    "pytest_docker.*",
    "factory.*",
    "rfc3986.*",
]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = [
    "tests.unit.factories"
]
disable_error_code = ["misc"]

[tool.ruff]
line-length = 88
select = ["C", "E", "F", "W", "B", "I", "UP", "T20", "TID252"]
ignore = ["E501", "B008", "B009"]
exclude = [
    ".git",
    "__pycache__",
    ".history",
]
target-version = "py311"

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

[tool.pytest.ini_options]
markers = [
    "db: mark a test as a database",
]
addopts = [
    "--strict-config",
    "--strict-markers",
]
xfail_strict = true
junit_family = "xunit2"
env = [
    "APP_DEBUG = true",
    "Environment = test",
    "POSTGRES_USER = postgres",
    "POSTGRES_PASSWORD = postgres",
    "D:POSTGRES_HOST = localhost",
    "D:POSTGRES_NAME = fansifter_test",
    "CACHE_BACKEND = null",
    "SENTRY_DSN = ",
    "LOG_FORMAT = debug",
    "JWT_AUTH_ENABLED = false",
    "AUTH_ALLOW_FULL_ACCESS = true",
    "KMS_ENABLED = false",
    "OWSREQUEST_SERVICE_MAP = {{\"ows-location\": \"http://test-ows-location/\", \"ows-permission\": \"http://test-ows-permission/\"}}",
    "CAMPAIGN_ASSETS_BUCKET_NAME = MOCK",
    "ASSET_UPLOAD_IAM_ROLE_ARN = MOCK",
    "ASSETS_CDN_DOMAIN = test.com",
    "FACEBOOK_AD_ACCOUNT_ID = 1234567",
    "FACEBOOK_APP_SYSTEM_USER_ACCESS_TOKEN = qwerty12345",
    "FACEBOOK_ASSIGN_AGENCY_ACCESS_TO_PAGES_ENABLED = true"
]

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