build: switch to uv, hatchling and ruff-only tooling

This commit is contained in:
Latte committed 2026-10-14 15:40:30 +02:00
1 parent 8b7bb7205c
commit c0b22c531e
9 files changed
+2385 -287

No files matched your search

+59 -58
View File
@@ -1,14 +1,14 @@
[project]
name = "aegis-gitea-mcp"
version = "0.2.0"
description = "Security-first MCP server for controlled AI access to self-hosted Gitea (local stdio + public HTTP/OAuth)"
version = "1.0.0.dev0"
description = "MCP server exposing the complete Gitea API over stdio and streamable HTTP, with admin-token and per-user OAuth modes"
authors = [
{name = "AegisGitea MCP Contributors"}
]
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
keywords = ["mcp", "gitea", "ai", "security", "audit"]
keywords = ["mcp", "gitea", "ai", "audit"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
@@ -17,46 +17,22 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
# Core (default install) powers the local stdio transport. It deliberately
# excludes the web/OAuth stack so `uvx aegis-gitea-mcp` stays light; the HTTP
# server pulls those in via the [server] extra.
dependencies = [
"httpx>=0.26.0",
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
"PyYAML>=6.0.1",
"python-dotenv>=1.0.0",
"structlog>=24.1.0",
"mcp>=1.2.0",
]
[project.optional-dependencies]
# The public HTTP/OAuth server (aegis-gitea-mcp-server) needs the web stack.
server = [
"fastapi>=0.109.0",
"uvicorn[standard]>=0.27.0",
"PyJWT[crypto]>=2.9.0",
"python-multipart>=0.0.9",
]
dev = [
"pytest>=7.4.0",
"pytest-asyncio>=0.23.0",
"pytest-cov>=4.1.0",
"pytest-httpx>=0.28.0",
"black>=24.1.0",
"ruff>=0.1.0",
"mypy>=1.8.0",
"pre-commit>=3.6.0",
"mcp>=2.3,<3",
"httpx>=0.27",
"pydantic>=2.7",
# NoDecode (comma-separated list env vars) needs pydantic-settings 2.7.
"pydantic-settings>=2.7",
"jsonschema>=4.20",
"cryptography>=42",
"uvicorn>=0.31",
]
[project.scripts]
# Local stdio MCP server (default install, no web stack required).
aegis-gitea-mcp = "aegis_gitea_mcp.stdio_app:main"
# Public HTTP/OAuth server; requires the [server] extra. The entry point guards
# against a missing web stack with an actionable message.
aegis-gitea-mcp-server = "aegis_gitea_mcp.server_entry:main"
aegis-gitea-mcp = "aegis_gitea_mcp.cli:main"
[project.urls]
Homepage = "https://git.hiddenden.cafe/Hiddenden/AegisGitea-MCP"
@@ -64,42 +40,64 @@ Documentation = "https://git.hiddenden.cafe/Hiddenden/AegisGitea-MCP/src/branch/
Repository = "https://git.hiddenden.cafe/Hiddenden/AegisGitea-MCP.git"
Issues = "https://git.hiddenden.cafe/Hiddenden/AegisGitea-MCP/issues"
[dependency-groups]
dev = [
"pytest>=8",
"pytest-asyncio>=0.23",
"pytest-cov>=5",
"pytest-httpx>=0.30",
"ruff>=0.6",
"mypy>=1.10",
"types-jsonschema",
"pip-audit>=2.7",
]
[build-system]
requires = ["setuptools>=68.0.0", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.setuptools]
package-dir = {"" = "src"}
[tool.hatch.build.targets.wheel]
packages = ["src/aegis_gitea_mcp"]
[tool.setuptools.packages.find]
where = ["src"]
[tool.black]
line-length = 100
target-version = ['py310', 'py311', 'py312']
include = '\.pyi?$'
[tool.hatch.build.targets.sdist]
include = ["src/aegis_gitea_mcp", "README.md", "LICENSE", "pyproject.toml"]
[tool.ruff]
line-length = 100
target-version = "py310"
src = ["src", "tests"]
extend-exclude = ["docs", "spec"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"S", # flake8-bandit
"SIM", # flake8-simplify
"RUF", # ruff-specific
]
ignore = [
"E501", # line too long (handled by black)
"B008", # do not perform function calls in argument defaults
"E501", # line length is handled by ruff format; long strings and URLs are fine
"B008", # function calls in argument defaults (pydantic Field style)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/**" = [
"S101", # assert is the point of tests
"S105", # hardcoded fake tokens in fixtures
"S106", # hardcoded fake tokens in fixtures
"S108", # fixture paths
]
[tool.ruff.format]
quote-style = "double"
line-ending = "lf"
[tool.mypy]
python_version = "3.10"
@@ -119,11 +117,14 @@ module = "tests.*"
disallow_untyped_defs = false
[tool.pytest.ini_options]
minversion = "7.0"
minversion = "8.0"
addopts = "-ra -q --strict-markers --cov=aegis_gitea_mcp --cov-report=term-missing --cov-fail-under=80"
testpaths = ["tests"]
pythonpath = ["src"]
asyncio_mode = "auto"
markers = [
"integration: needs a live Gitea in Docker (opt-in via AEGIS_INTEGRATION=1)",
]
[tool.coverage.run]
source = ["src"]