Migrate tailscalesd to uv and add flake packaging with a NixOS service module.

This commit is contained in:
Abel Luck 2026-03-05 15:37:04 +01:00
parent b195bd1e8f
commit d5201b471b
14 changed files with 2160 additions and 2242 deletions

View file

@ -1,49 +1,52 @@
[tool.poetry]
[project]
name = "tailscalesd"
version = "0.1.0"
description = "Discover services to monitor with prometheus over tailscale"
authors = ["Abel Luck <abel@guardianproject.info>"]
include = ["LICENSE.MD"]
exclude = ["tests"]
authors = [{ name = "Abel Luck", email = "abel@guardianproject.info" }]
license = { file = "LICENSE.md" }
readme = "README.md"
homepage = "https://gitlab.com/guardianproject-ops/py-tailscalesd"
repository = "https://gitlab.com/guardianproject-ops/py-tailscalesd"
packages = [
{ include = "tailscalesd"}
requires-python = ">=3.11"
dependencies = [
"tailscale>=0.6.0,<0.7.0",
"fastapi>=0.104.1,<0.105.0",
"uvicorn>=0.24.0,<0.25.0",
"httpx>=0.25.1,<0.26.0",
"pydantic-settings>=2.0.3,<3.0.0",
"json-logging>=1.3.0,<2.0.0",
"prometheus-client>=0.18.0,<0.19.0",
"prometheus-fastapi-instrumentator>=6.1.0,<7.0.0",
]
[tool.poetry.scripts]
[project.urls]
Homepage = "https://gitlab.com/guardianproject-ops/tailscalesd"
Repository = "https://gitlab.com/guardianproject-ops/tailscalesd"
[project.scripts]
tailscalesd = "tailscalesd.main:main"
[tool.poetry.dependencies]
python = "^3.11"
tailscale = "^0.6.0"
fastapi = "^0.104.1"
uvicorn = "^0.24.0"
httpx = "^0.25.1"
pydantic-settings = "^2.0.3"
json-logging = "^1.3.0"
prometheus-client = "^0.18.0"
prometheus-fastapi-instrumentator = "^6.1.0"
[tool.poetry.dev-dependencies]
pytest = "*"
pytest-asyncio = "*"
flake8 = "*"
black = "*"
bandit = "*"
isort = "*"
mypy = "^1.2.0"
[dependency-groups]
dev = [
"pytest",
"pytest-asyncio",
"flake8",
"black",
"bandit",
"isort",
"mypy>=1.2.0",
]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["tailscalesd"]
[tool.isort]
py_version = 310
py_version = 311
profile = "black"
src_paths = ["gm", "tests"]
src_paths = ["tailscalesd", "tests"]
[tool.black]
line-length = 88
target-version = ['py310']
target-version = ['py311']