Skip to content

Commit cac0cbf

Browse files
fix(deps): pin dependencies (#23)
* fix(deps): pin dependencies * fix: dependencies clash --------- Co-authored-by: Vincent Burckhardt <[email protected]>
1 parent 077733b commit cac0cbf

File tree

14 files changed

+127
-128
lines changed

14 files changed

+127
-128
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ on:
88

99
jobs:
1010
call-terraform-release-pipeline:
11-
uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/common-release.yml@v1.22.5
11+
uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/common-release.yml@v1.23.2
1212
secrets: inherit

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-09-25T11:22:38Z",
6+
"generated_at": "2025-10-17T23:17:12Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -168,7 +168,7 @@
168168
}
169169
]
170170
},
171-
"version": "0.13.1+ibm.62.dss",
171+
"version": "0.13.1+ibm.64.dss",
172172
"word_list": {
173173
"file": null,
174174
"hash": null

pyproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ name = "tim-mcp"
99
dynamic = ["version"]
1010
description = "Terraform IBM Modules MCP"
1111
readme = "README.md"
12-
requires-python = ">=3.11"
12+
requires-python = ">=3.11.0"
1313
dependencies = [
1414
"httpx==0.28.1",
15-
"fastmcp==2.12.3",
16-
"pydantic>=2.11.7",
17-
"tenacity==9.0.0",
18-
"structlog==24.4.0",
19-
"click>=8.0.0",
15+
"fastmcp==2.12.5",
16+
"pydantic==2.11.9",
17+
"tenacity==9.1.2",
18+
"structlog==25.4.0",
19+
"click==8.3.0",
2020
"pyyaml>=6.0.2",
2121
]
2222

@@ -26,11 +26,11 @@ tim-mcp = "tim_mcp.main:cli"
2626
[project.optional-dependencies]
2727
dev = [
2828
"pytest==8.4.2",
29-
"pytest-asyncio==0.24.0",
30-
"pytest-mock==3.14.0",
31-
"vcrpy==6.0.2",
32-
"ruff==0.8.4",
33-
"hypothesis>=6.100.0",
29+
"pytest-asyncio==1.2.0",
30+
"pytest-mock==3.15.1",
31+
"vcrpy==7.0.0",
32+
"ruff==0.14.1",
33+
"hypothesis==6.140.2",
3434
]
3535

3636
[tool.ruff]
@@ -67,8 +67,8 @@ python_functions = "test_*"
6767

6868
[dependency-groups]
6969
dev = [
70-
"pytest-asyncio>=0.24.0",
71-
"ruff>=0.8.4",
70+
"pytest-asyncio==1.2.0",
71+
"ruff==0.14.1",
7272
]
7373

7474
[tool.hatch.build]

static/instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Keywords to detect this intent: "example", "sample", "deploy", "show me", "simpl
5151

5252
The example files provide valuable insights:
5353
- **Main configuration file**: Shows how to use and combine the module with others
54-
- **Provider configuration file**: Demonstrates proper provider configuration
54+
- **Provider configuration file**: Demonstrates proper provider configuration
5555
- **Version constraints file**: Shows required provider versions and constraints
5656
- **Variables and outputs**: Define module interface and available values
5757

@@ -107,13 +107,13 @@ Keywords to detect this intent: "create", "build", "inputs", "outputs", "develop
107107
# Returns: terraform-ibm-modules/landing-zone-vpc/ibm/8.4.0 (among others)
108108
2. get_module_details("terraform-ibm-modules/landing-zone-vpc/ibm/8.4.0")
109109
# Understand module capabilities, inputs, outputs
110-
3. list_content("terraform-ibm-modules/landing-zone-vpc/ibm/8.4.0")
110+
3. list_content("terraform-ibm-modules/landing-zone-vpc/ibm/8.4.0")
111111
# Find available examples: examples/basic, examples/default, etc.
112112
4. get_content("terraform-ibm-modules/landing-zone-vpc/ibm/8.4.0", "examples/basic", ["*.tf"])
113113
# Get configuration files showing module usage and provider setup
114114
```
115115

116-
### Example 2: User Wants to Build Custom VPC Configuration
116+
### Example 2: User Wants to Build Custom VPC Configuration
117117

118118
**User Request:** "I need to create a VPC with custom settings, what inputs does the module take?"
119119
**Intent Detection:** Development workflow (keywords: "create", "inputs")
@@ -140,7 +140,7 @@ Keywords to detect this intent: "create", "build", "inputs", "outputs", "develop
140140
```
141141
1. search_modules("vpc")
142142
# Returns: terraform-ibm-modules/landing-zone-vpc/ibm/8.4.0, etc.
143-
2. search_modules("security group")
143+
2. search_modules("security group")
144144
# Returns: terraform-ibm-modules/security-group/ibm/2.7.0, etc.
145145
3. search_modules("cluster")
146146
# Returns: terraform-ibm-modules/base-ocp-vpc/ibm/3.62.0, etc.
@@ -266,4 +266,4 @@ When generating Terraform configurations:
266266
- Follow IBM Cloud and Terraform best practices
267267
- Document configurations with meaningful comments
268268

269-
Remember: This server specializes in IBM Cloud modules and patterns. Always prioritize module-based solutions over direct provider resource implementations for better security, maintainability, and adherence to IBM Cloud best practices.
269+
Remember: This server specializes in IBM Cloud modules and patterns. Always prioritize module-based solutions over direct provider resource implementations for better security, maintainability, and adherence to IBM Cloud best practices.

test/test_clients.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ def test_match_file_patterns_bug_regression(self, github_client, mock_cache):
462462
# All .tf files should match
463463
tf_files = [f for f in test_files if f.endswith(".tf")]
464464
for tf_file in tf_files:
465-
assert github_client.match_file_patterns(
466-
tf_file, include_pattern, None
467-
), f"{tf_file} should match pattern {include_pattern}"
465+
assert github_client.match_file_patterns(tf_file, include_pattern, None), (
466+
f"{tf_file} should match pattern {include_pattern}"
467+
)
468468

469469
# Non-.tf files should NOT match
470470
non_tf_files = [f for f in test_files if not f.endswith(".tf")]

test/test_get_content.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,19 +1153,18 @@ def mock_match_patterns(
11531153
assert "# main.tf content" in result
11541154

11551155
@pytest.mark.asyncio
1156-
async def test_get_content_source_replacement(
1157-
self, config, mock_github_client
1158-
):
1156+
async def test_get_content_source_replacement(self, config, mock_github_client):
11591157
"""Test that source = '../../' is replaced with module ID and version."""
11601158
# Setup
11611159
request = GetContentRequest(
11621160
module_id="terraform-ibm-modules/vpc/ibm",
11631161
path="examples/basic",
1164-
include_files=["main.tf"]
1162+
include_files=["main.tf"],
11651163
)
11661164

11671165
mock_github_client._extract_repo_from_module_id.return_value = (
1168-
"terraform-ibm-modules", "terraform-ibm-vpc"
1166+
"terraform-ibm-modules",
1167+
"terraform-ibm-vpc",
11691168
)
11701169
mock_github_client.resolve_version.return_value = "v1.2.3"
11711170

@@ -1175,7 +1174,7 @@ async def test_get_content_source_replacement(
11751174
"name": "main.tf",
11761175
"path": "examples/basic/main.tf",
11771176
"type": "file",
1178-
"download_url": "https://api.github.com/repos/terraform-ibm-modules/terraform-ibm-vpc/contents/examples/basic/main.tf"
1177+
"download_url": "https://api.github.com/repos/terraform-ibm-modules/terraform-ibm-vpc/contents/examples/basic/main.tf",
11791178
}
11801179
]
11811180

@@ -1187,7 +1186,7 @@ async def mock_get_file_content(owner, repo, path, ref):
11871186
"content": "encoded_content",
11881187
"encoding": "base64",
11891188
"size": 200,
1190-
"decoded_content": '''module "vpc" {
1189+
"decoded_content": """module "vpc" {
11911190
source = "../../"
11921191
vpc_name = var.vpc_name
11931192
resource_group_id = var.resource_group_id
@@ -1196,7 +1195,7 @@ async def mock_get_file_content(owner, repo, path, ref):
11961195
module "other" {
11971196
source = "../.."
11981197
other_param = "value"
1199-
}'''
1198+
}""",
12001199
}
12011200

12021201
mock_github_client.get_file_content.side_effect = mock_get_file_content
@@ -1207,7 +1206,7 @@ async def mock_get_file_content(owner, repo, path, ref):
12071206
"name": "main.tf",
12081207
"path": "examples/basic/main.tf",
12091208
"type": "file",
1210-
"download_url": "https://api.github.com/repos/terraform-ibm-modules/terraform-ibm-vpc/contents/examples/basic/main.tf"
1209+
"download_url": "https://api.github.com/repos/terraform-ibm-modules/terraform-ibm-vpc/contents/examples/basic/main.tf",
12111210
}
12121211
]
12131212

@@ -1217,7 +1216,7 @@ async def mock_get_file_content(owner, repo, path, ref):
12171216
# Verify source replacement occurred
12181217
assert 'source = "terraform-ibm-modules/vpc/ibm"' in result
12191218
assert 'version = "1.2.3"' in result
1220-
1219+
12211220
# Verify original ../../ patterns are gone
12221221
assert 'source = "../../"' not in result
12231222
assert 'source = "../.."' not in result

test/test_get_module_details.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ def test_valid_module_id_parsing(self):
139139

140140
# Test with version included
141141
from tim_mcp.utils.module_id import parse_module_id_with_version
142-
namespace, name, provider, version = parse_module_id_with_version("terraform-ibm-modules/vpc/ibm/1.2.3")
142+
143+
namespace, name, provider, version = parse_module_id_with_version(
144+
"terraform-ibm-modules/vpc/ibm/1.2.3"
145+
)
143146
assert namespace == "terraform-ibm-modules"
144147
assert name == "vpc"
145148
assert provider == "ibm"

test/test_list_content.py

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
import pytest
1212

1313
from tim_mcp.config import Config
14-
from tim_mcp.exceptions import GitHubError, ModuleNotFoundError, RateLimitError, ValidationError
14+
from tim_mcp.exceptions import (
15+
GitHubError,
16+
ModuleNotFoundError,
17+
RateLimitError,
18+
ValidationError,
19+
)
1520
from tim_mcp.tools.list_content import list_content_impl
1621
from tim_mcp.types import ListContentRequest
1722

@@ -118,9 +123,7 @@ async def test_list_content_success(
118123
):
119124
"""Test successful content listing with version latest."""
120125
# Setup
121-
request = ListContentRequest(
122-
module_id="terraform-ibm-modules/vpc/ibm"
123-
)
126+
request = ListContentRequest(module_id="terraform-ibm-modules/vpc/ibm")
124127

125128
mock_github_client.get_repository_info.return_value = sample_repo_info
126129
mock_github_client.resolve_version.return_value = "main"
@@ -188,9 +191,7 @@ async def test_list_content_with_specific_version(
188191
):
189192
"""Test content listing with specific version tag."""
190193
# Setup
191-
request = ListContentRequest(
192-
module_id="terraform-ibm-modules/vpc/ibm/v5.1.0"
193-
)
194+
request = ListContentRequest(module_id="terraform-ibm-modules/vpc/ibm/v5.1.0")
194195

195196
mock_github_client.get_repository_info.return_value = sample_repo_info
196197
mock_github_client.resolve_version.return_value = "v5.1.0"
@@ -222,9 +223,7 @@ async def mock_get_file_content(owner, repo, path, ref="HEAD"):
222223
async def test_list_content_module_not_found(self, mock_config, mock_github_client):
223224
"""Test error handling when module repository is not found."""
224225
# Setup
225-
request = ListContentRequest(
226-
module_id="nonexistent/module/ibm"
227-
)
226+
request = ListContentRequest(module_id="nonexistent/module/ibm")
228227

229228
mock_github_client.get_repository_info.side_effect = ModuleNotFoundError(
230229
"nonexistent/terraform-ibm-module",
@@ -246,9 +245,7 @@ async def test_list_content_module_not_found(self, mock_config, mock_github_clie
246245
async def test_list_content_github_api_error(self, mock_config, mock_github_client):
247246
"""Test error handling for GitHub API errors."""
248247
# Setup
249-
request = ListContentRequest(
250-
module_id="terraform-ibm-modules/vpc/ibm"
251-
)
248+
request = ListContentRequest(module_id="terraform-ibm-modules/vpc/ibm")
252249

253250
mock_github_client.get_repository_info.side_effect = GitHubError(
254251
"HTTP error getting repository info: 500 Server Error",
@@ -272,9 +269,7 @@ async def test_list_content_github_api_error(self, mock_config, mock_github_clie
272269
async def test_list_content_rate_limit_error(self, mock_config, mock_github_client):
273270
"""Test error handling for GitHub rate limit errors."""
274271
# Setup
275-
request = ListContentRequest(
276-
module_id="terraform-ibm-modules/vpc/ibm"
277-
)
272+
request = ListContentRequest(module_id="terraform-ibm-modules/vpc/ibm")
278273

279274
mock_github_client.get_repository_tree.side_effect = RateLimitError(
280275
"GitHub rate limit exceeded", reset_time=1234567890, api_name="GitHub"
@@ -315,9 +310,7 @@ async def test_list_content_empty_repository(
315310
):
316311
"""Test content listing for empty repository."""
317312
# Setup
318-
request = ListContentRequest(
319-
module_id="terraform-ibm-modules/empty/ibm"
320-
)
313+
request = ListContentRequest(module_id="terraform-ibm-modules/empty/ibm")
321314

322315
mock_github_client.get_repository_info.return_value = sample_repo_info
323316
mock_github_client.resolve_version.return_value = "main"
@@ -347,9 +340,7 @@ async def test_list_content_readme_parsing_fallback(
347340
):
348341
"""Test README parsing with fallback when content is not available."""
349342
# Setup
350-
request = ListContentRequest(
351-
module_id="terraform-ibm-modules/vpc/ibm"
352-
)
343+
request = ListContentRequest(module_id="terraform-ibm-modules/vpc/ibm")
353344

354345
mock_github_client.get_repository_info.return_value = sample_repo_info
355346
mock_github_client.get_repository_tree.return_value = sample_tree_response
@@ -405,9 +396,7 @@ async def test_list_content_path_categorization(
405396
{"path": ".github", "type": "tree", "mode": "040000"},
406397
]
407398

408-
request = ListContentRequest(
409-
module_id="terraform-ibm-modules/test/ibm"
410-
)
399+
request = ListContentRequest(module_id="terraform-ibm-modules/test/ibm")
411400

412401
mock_github_client.get_repository_info.return_value = sample_repo_info
413402
mock_github_client.get_repository_tree.return_value = diverse_tree

tim_mcp/tools/details.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
from ..clients.terraform_client import TerraformClient
1212
from ..config import Config
13-
from ..exceptions import ModuleNotFoundError, TerraformRegistryError
14-
from ..exceptions import ValidationError
15-
from ..logging import get_logger
13+
from ..exceptions import ModuleNotFoundError, TerraformRegistryError, ValidationError
1614
from ..types import ModuleDetailsRequest
1715
from ..utils.module_id import parse_module_id_with_version
1816

@@ -265,7 +263,9 @@ async def get_module_details_impl(request: ModuleDetailsRequest, config: Config)
265263
"""
266264
# Parse and validate module ID with version
267265
try:
268-
namespace, name, provider, version = parse_module_id_with_version(request.module_id)
266+
namespace, name, provider, version = parse_module_id_with_version(
267+
request.module_id
268+
)
269269
except ValidationError as e:
270270
# Re-raise validation errors with original context
271271
raise TerraformRegistryError(f"Module ID validation failed: {e}") from e

0 commit comments

Comments
 (0)