[project]
name = "ptn"
dynamic = ["version"]
description = "Web-based terminal accessible from phone via Cloudflare Tunnel"
readme = "README.md"
license = {text = "AGPL-3.0-or-later"}
requires-python = ">=3.12"
keywords = ["terminal", "web", "cloudflare", "tunnel", "pty", "mobile", "xterm", "websocket"]
authors = [
    {name = "Porterminal Contributors"}
]
maintainers = [
    {name = "Porterminal Contributors"}
]
classifiers = [
    "Development Status :: 4 - Beta",
    "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
    "Operating System :: Microsoft :: Windows",
    "Operating System :: POSIX :: Linux",
    "Operating System :: MacOS",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Framework :: FastAPI",
    "Topic :: System :: Shells",
    "Topic :: Internet :: WWW/HTTP",
    "Topic :: Terminals :: Terminal Emulators/X Terminals",
    "Environment :: Web Environment",
    "Intended Audience :: Developers",
    "Intended Audience :: System Administrators",
]
dependencies = [
    "fastapi>=0.104.0",
    "uvicorn[standard]>=0.24.0",
    "pywinpty>=2.0.0; sys_platform == 'win32'",
    "pyyaml>=6.0",
    "pydantic>=2.0",
    "rich>=13.0",
    "qrcode>=7.4",
    "bcrypt>=4.0.0",
    "tyro>=0.9.0",
]

[project.urls]
Homepage = "https://github.com/lyehe/porterminal"
Repository = "https://github.com/lyehe/porterminal"
Documentation = "https://github.com/lyehe/porterminal/tree/main/docs"
Issues = "https://github.com/lyehe/porterminal/issues"

[project.scripts]
ptn = "porterminal:main"

[project.optional-dependencies]
dev = [
    "watchfiles>=0.21.0",
]

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

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

[tool.hatch.build.hooks.vcs]
version-file = "porterminal/_version.py"

[tool.hatch.build.targets.wheel]
packages = ["porterminal"]

[tool.hatch.build.targets.sdist]
include = [
    "porterminal/",
    "README.md",
    "LICENSE",
    "pyproject.toml",
]

[tool.uv]
dev-dependencies = [
    "watchfiles>=0.21.0",
    "pre-commit>=4.0.0",
    "ruff>=0.8.0",
    "pytest>=8.0.0",
    "pytest-asyncio>=0.24.0",
]

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"

[tool.ruff]
line-length = 100
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I", "UP"]
ignore = ["E501", "E402"]

[tool.ruff.format]
quote-style = "double"
