-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
163 lines (151 loc) · 4.54 KB
/
Copy pathpyproject.toml
File metadata and controls
163 lines (151 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
[project]
name = "mcp-seo"
version = "1.0.0"
description = "FastMCP server for comprehensive SEO analysis using DataForSEO API"
readme = "README.md"
authors = [
{ name = "Thomas PEDOT", email = "thomas.pedot@gmail.com" }
]
requires-python = ">=3.10"
dependencies = [
"fastmcp>=2.12.2",
"pydantic>=2.11.7",
"pydantic-settings>=2.10.1",
"python-dotenv>=1.1.1",
"requests>=2.32.5",
"dataforseo-client>=2.0.0",
"kuzu>=0.5.0",
"aiohttp>=3.9.0",
"beautifulsoup4>=4.12.0",
"numpy>=1.24.0",
"lxml>=4.9.0",
"networkx>=3.0",
"matplotlib>=3.7.0",
"seaborn>=0.12.0",
"pillow>=10.0.0",
"python-frontmatter>=1.0.0",
"polars>=0.20.0",
]
[project.optional-dependencies]
test = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.10.0",
"pytest-benchmark>=4.0.0",
"psutil>=5.9.0",
"aioresponses>=0.7.0"
]
dev = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.10.0",
"pytest-benchmark>=4.0.0",
"psutil>=5.9.0",
"aioresponses>=0.7.0",
"black>=23.0.0",
"isort>=5.12.0",
"mypy>=1.0.0",
"import-linter>=2.0.0"
]
[project.scripts]
mcp-seo = "mcp_seo.server:mcp.run"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/mcp_seo"]
# Import linter configuration to enforce clean architecture
[tool.importlinter]
root_package = "mcp_seo"
# Contract 1: Enforce layered architecture
[[tool.importlinter.contracts]]
name = "Layered Architecture"
type = "layers"
layers = [
"(mcp_seo.server)", # Interface Layer - MCP server endpoints (optional)
"mcp_seo.tools", # Application Layer - Enhanced analyzers and tools
"mcp_seo.engines", # Application Layer - Recommendation and processing engines
"mcp_seo.analysis", # Application Layer - Analysis components
"mcp_seo.content", # Domain Layer - Content analysis business logic
"mcp_seo.content_analysis", # Domain Layer - Content analysis utilities
"mcp_seo.models", # Domain Layer - Data models and contracts
"mcp_seo.reporting", # Infrastructure Layer - Output formatting
"mcp_seo.dataforseo", # Infrastructure Layer - External API clients
"mcp_seo.config", # Infrastructure Layer - Configuration management
"(mcp_seo.utils)", # Infrastructure Layer - Utilities (optional)
"(mcp_seo.graph)" # Infrastructure Layer - Graph operations (optional)
]
# Contract 2: Domain layer independence - Content analysis should not depend on infrastructure
[[tool.importlinter.contracts]]
name = "Domain Layer Independence"
type = "forbidden"
source_modules = [
"mcp_seo.content",
"mcp_seo.content_analysis",
"mcp_seo.models"
]
forbidden_modules = [
"mcp_seo.dataforseo",
"mcp_seo.reporting",
"mcp_seo.config",
"mcp_seo.utils"
]
# Contract 3: Infrastructure layer cannot import from application layer
[[tool.importlinter.contracts]]
name = "Infrastructure Isolation"
type = "forbidden"
source_modules = [
"mcp_seo.dataforseo",
"mcp_seo.reporting",
"mcp_seo.config",
"mcp_seo.utils"
]
forbidden_modules = [
"mcp_seo.tools",
"mcp_seo.engines",
"mcp_seo.analysis"
]
# Contract 4: Application services independence - Engines should be independent of tools
[[tool.importlinter.contracts]]
name = "Application Services Independence"
type = "independence"
modules = [
"mcp_seo.engines",
"mcp_seo.analysis",
"mcp_seo.content"
]
# Contract 5: Interface layer dependency rules - Server should only depend on application layer
# Note: Currently disabled as server module structure is being refactored
# [[tool.importlinter.contracts]]
# name = "Interface Layer Dependencies"
# type = "forbidden"
# source_modules = [
# "mcp_seo.server"
# ]
# forbidden_modules = [
# "mcp_seo.dataforseo.client",
# "mcp_seo.reporting.seo_reporter"
# ]
# Pytest configuration
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"slow: Slow running tests",
"requires_network: Tests requiring network access",
"performance: Performance and load tests",
"memory: Memory usage tests",
"benchmark: Benchmark tests"
]
filterwarnings = [
"ignore::DeprecationWarning:pydantic*",
"ignore::PendingDeprecationWarning"
]