[project]
name = "sciop"
description = "Default template for PDM package"
authors = [
    { name = "sneakers-the-rat", email = "sneakers-the-rat@protonmail.com" },
]
dynamic = []
dependencies = [
    "fastapi>=0.115.8",
    "sqlmodel>=0.0.22",
    "pydantic-settings>=2.7.1",
    "uvicorn>=0.34.0",
    "jinja2>=3.1.5",
    "alembic>=1.14.1",
    "lxml>=5.3.0",
    "pydantic>=2.10.6",
    "rich>=13.9.4",
    "platformdirs>=4.3.6",
    "pyjwt>=2.10.1",
    "python-multipart>=0.0.20",
    "bcrypt>=4.2.1",
    "fastapi-pagination>=0.12.34",
    "torf>=4.2.7",
    "humanize>=4.11.0",
    "slowapi>=0.1.9",
    "fasthx>=2.1.1",
    "faker>=35.2.0",
    "python-slugify>=8.0.4",
    "mkdocs-material>=9.6.4",
    "rdflib>=7.1.3",
    "content-negotiation>=1.1.2",
    "bencode-py>=4.0.0",
    "pymdown-extensions>=10.14.3",
    "apscheduler>=3.11.0",
    "aiodns>=3.2.0",
    "mistune>=3.1.2",
    "bleach>=6.2.0",
    "pygments>=2.19.1",
]
requires-python = ">=3.11"
readme = "README.md"
version = "202503.18.1"

[project.license]
text = "EUPL-1.2"

[project.scripts]
sciop = "sciop.main:main"

[project.optional-dependencies]
test = [
    "pytest>=8.3.4",
    "httpx>=0.28.1",
    "webdriver-manager>=4.0.2",
    "selenium>=4.28.1",
    "pytest-asyncio>=0.25.3",
    "beautifulsoup4>=4.13.3",
    "lxml>=5.3.1",
    "pytest-alembic>=0.11.1",
    "pytest-timeout>=2.3.1",
]
dev = [
    "sciop[test]",
    "ruff>=0.9.4",
    "black>=25.1.0",
]

[build-system]
requires = [
    "pdm-backend",
]
build-backend = "pdm.backend"

[tool.pdm]
distribution = true

[tool.pdm.version]
source = "call"
getter = "scripts.version:get_version"
write_to = "sciop/_version.py"
write_template = "__version__ = \"{}\""

[tool.pdm.scripts]
test = "pytest"
migrate = "alembic -c ./src/sciop/migrations/alembic.ini upgrade head"
alembic = "alembic -c ./src/sciop/migrations/alembic.ini"

[tool.pdm.scripts.start]
call = "sciop.main:main"

[tool.pdm.scripts.lint]
composite = [
    "ruff check",
    "black . --diff",
]

[tool.pdm.scripts.format]
composite = [
    "black .",
    "ruff check --fix",
]

[tool.ruff]
target-version = "py311"
include = [
    "src/sciop/**/*.py",
    "scripts/**/*.py",
    "tests/**/*.py",
    "pyproject.toml",
]
exclude = [
    "docs",
    "src/sciop/vendor/**/*",
]
line-length = 100

[tool.ruff.lint]
select = [
    "E",
    "F",
    "UP",
    "B",
    "SIM",
    "I",
    "ANN",
    "T10",
    "D207",
    "D208",
    "D210",
    "D211",
    "D419",
    "N802",
    "FAST",
    "S608",
    "S701",
]
ignore = [
    "ANN101",
    "ANN102",
    "ANN401",
    "ANN204",
    "B905",
    "UP006",
    "UP035",
    "UP007",
    "UP038",
    "D107",
    "E712",
    "SIM114",
]
fixable = [
    "ALL",
]

[tool.ruff.lint.per-file-ignores]
"**/{api,frontend}/*" = [
    "ANN201",
]
"tests/**/test_*" = [
    "ANN001",
    "ANN201",
    "F841",
]
"tests/conftest.py" = [
    "F403",
    "E402",
]
"tests/fixtures/**/*" = [
    "F403",
]
"src/sciop/migrations/env.py" = [
    "ANN",
]

[tool.black]
target-version = [
    "py311",
    "py312",
    "py313",
]
include = "(?:tests|sciop|scripts)/.*\\.py$"
line-length = 100

[tool.pytest.ini_options]
asyncio_mode = "auto"
timeout_func_only = true
asyncio_default_fixture_loop_scope = "function"
markers = "  selenium: tests that use the selenium webdriver\n"
filterwarnings = [
    "ignore:Python 3.14 will, by default, filter extracted tar archives",
]
