hatch-xclam 0.7.0.dev12__py3-none-any.whl → 0.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. hatch/cli_hatch.py +120 -18
  2. hatch/mcp_host_config/__init__.py +4 -2
  3. hatch/mcp_host_config/backup.py +62 -31
  4. hatch/mcp_host_config/models.py +125 -1
  5. hatch/mcp_host_config/strategies.py +268 -1
  6. {hatch_xclam-0.7.0.dev12.dist-info → hatch_xclam-0.7.1.dist-info}/METADATA +41 -32
  7. hatch_xclam-0.7.1.dist-info/RECORD +105 -0
  8. hatch_xclam-0.7.1.dist-info/top_level.txt +2 -0
  9. tests/integration/__init__.py +5 -0
  10. tests/integration/test_mcp_kiro_integration.py +153 -0
  11. tests/regression/__init__.py +5 -0
  12. tests/regression/test_mcp_codex_backup_integration.py +162 -0
  13. tests/regression/test_mcp_codex_host_strategy.py +163 -0
  14. tests/regression/test_mcp_codex_model_validation.py +117 -0
  15. tests/regression/test_mcp_kiro_backup_integration.py +241 -0
  16. tests/regression/test_mcp_kiro_cli_integration.py +141 -0
  17. tests/regression/test_mcp_kiro_decorator_registration.py +71 -0
  18. tests/regression/test_mcp_kiro_host_strategy.py +214 -0
  19. tests/regression/test_mcp_kiro_model_validation.py +116 -0
  20. tests/regression/test_mcp_kiro_omni_conversion.py +104 -0
  21. tests/test_data_utils.py +108 -0
  22. tests/test_mcp_cli_all_host_specific_args.py +194 -1
  23. tests/test_mcp_cli_direct_management.py +8 -5
  24. hatch_xclam-0.7.0.dev12.dist-info/RECORD +0 -152
  25. hatch_xclam-0.7.0.dev12.dist-info/top_level.txt +0 -3
  26. node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py +0 -45
  27. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
  28. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  29. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1272
  30. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  31. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  32. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
  33. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
  34. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  35. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -704
  36. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -709
  37. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -173
  38. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -169
  39. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
  40. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  41. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  42. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
  43. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1172
  44. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1319
  45. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
  46. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
  47. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -462
  48. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  49. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -56
  50. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2745
  51. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3976
  52. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  53. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2965
  54. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -67
  55. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1391
  56. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
  57. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3112
  58. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
  59. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -767
  60. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1260
  61. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  62. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  63. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -373
  64. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  65. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
  66. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -303
  67. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3196
  68. node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  69. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
  70. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +0 -108
  71. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
  72. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
  73. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
  74. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
  75. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
  76. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/markers.py +0 -252
  77. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +0 -825
  78. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  79. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
  80. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
  81. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/tags.py +0 -553
  82. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/utils.py +0 -172
  83. node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/version.py +0 -563
  84. node_modules/npm/node_modules/node-gyp/gyp/test_gyp.py +0 -261
  85. {hatch_xclam-0.7.0.dev12.dist-info → hatch_xclam-0.7.1.dist-info}/WHEEL +0 -0
  86. {hatch_xclam-0.7.0.dev12.dist-info → hatch_xclam-0.7.1.dist-info}/entry_points.txt +0 -0
  87. {hatch_xclam-0.7.0.dev12.dist-info → hatch_xclam-0.7.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- """Unit tests for the xcode_emulation.py file."""
4
-
5
- import sys
6
- import unittest
7
-
8
- from gyp.xcode_emulation import XcodeSettings
9
-
10
-
11
- class TestXcodeSettings(unittest.TestCase):
12
- def setUp(self):
13
- if sys.platform != "darwin":
14
- self.skipTest("This test only runs on macOS")
15
-
16
- def test_GetCflags(self):
17
- target = {
18
- "type": "static_library",
19
- "configurations": {
20
- "Release": {},
21
- },
22
- }
23
- configuration_name = "Release"
24
- xcode_settings = XcodeSettings(target)
25
- cflags = xcode_settings.GetCflags(configuration_name, "arm64")
26
-
27
- # Do not quote `-arch arm64` with spaces in one string.
28
- self.assertEqual(
29
- cflags,
30
- ["-fasm-blocks", "-mpascal-strings", "-Os", "-gdwarf-2", "-arch", "arm64"],
31
- )
32
-
33
- def GypToBuildPath(self, path):
34
- return path
35
-
36
- def test_GetLdflags(self):
37
- target = {
38
- "type": "static_library",
39
- "configurations": {
40
- "Release": {},
41
- },
42
- }
43
- configuration_name = "Release"
44
- xcode_settings = XcodeSettings(target)
45
- ldflags = xcode_settings.GetLdflags(
46
- configuration_name, "PRODUCT_DIR", self.GypToBuildPath, "arm64"
47
- )
48
-
49
- # Do not quote `-arch arm64` with spaces in one string.
50
- self.assertEqual(ldflags, ["-arch", "arm64", "-LPRODUCT_DIR"])
51
-
52
-
53
- if __name__ == "__main__":
54
- unittest.main()
@@ -1,303 +0,0 @@
1
- # Copyright (c) 2014 Google Inc. All rights reserved.
2
- # Use of this source code is governed by a BSD-style license that can be
3
- # found in the LICENSE file.
4
-
5
- """Xcode-ninja wrapper project file generator.
6
-
7
- This updates the data structures passed to the Xcode gyp generator to build
8
- with ninja instead. The Xcode project itself is transformed into a list of
9
- executable targets, each with a build step to build with ninja, and a target
10
- with every source and resource file. This appears to sidestep some of the
11
- major performance headaches experienced using complex projects and large number
12
- of targets within Xcode.
13
- """
14
-
15
- import errno
16
- import os
17
- import re
18
- import xml.sax.saxutils
19
-
20
- import gyp.generator.ninja
21
-
22
-
23
- def _WriteWorkspace(main_gyp, sources_gyp, params):
24
- """ Create a workspace to wrap main and sources gyp paths. """
25
- (build_file_root, build_file_ext) = os.path.splitext(main_gyp)
26
- workspace_path = build_file_root + ".xcworkspace"
27
- options = params["options"]
28
- if options.generator_output:
29
- workspace_path = os.path.join(options.generator_output, workspace_path)
30
- try:
31
- os.makedirs(workspace_path)
32
- except OSError as e:
33
- if e.errno != errno.EEXIST:
34
- raise
35
- output_string = (
36
- '<?xml version="1.0" encoding="UTF-8"?>\n' + '<Workspace version = "1.0">\n'
37
- )
38
- for gyp_name in [main_gyp, sources_gyp]:
39
- name = os.path.splitext(os.path.basename(gyp_name))[0] + ".xcodeproj"
40
- name = xml.sax.saxutils.quoteattr("group:" + name)
41
- output_string += " <FileRef location = %s></FileRef>\n" % name
42
- output_string += "</Workspace>\n"
43
-
44
- workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata")
45
-
46
- try:
47
- with open(workspace_file) as input_file:
48
- input_string = input_file.read()
49
- if input_string == output_string:
50
- return
51
- except OSError:
52
- # Ignore errors if the file doesn't exist.
53
- pass
54
-
55
- with open(workspace_file, "w") as output_file:
56
- output_file.write(output_string)
57
-
58
-
59
- def _TargetFromSpec(old_spec, params):
60
- """ Create fake target for xcode-ninja wrapper. """
61
- # Determine ninja top level build dir (e.g. /path/to/out).
62
- ninja_toplevel = None
63
- jobs = 0
64
- if params:
65
- options = params["options"]
66
- ninja_toplevel = os.path.join(
67
- options.toplevel_dir, gyp.generator.ninja.ComputeOutputDir(params)
68
- )
69
- jobs = params.get("generator_flags", {}).get("xcode_ninja_jobs", 0)
70
-
71
- target_name = old_spec.get("target_name")
72
- product_name = old_spec.get("product_name", target_name)
73
- product_extension = old_spec.get("product_extension")
74
-
75
- ninja_target = {}
76
- ninja_target["target_name"] = target_name
77
- ninja_target["product_name"] = product_name
78
- if product_extension:
79
- ninja_target["product_extension"] = product_extension
80
- ninja_target["toolset"] = old_spec.get("toolset")
81
- ninja_target["default_configuration"] = old_spec.get("default_configuration")
82
- ninja_target["configurations"] = {}
83
-
84
- # Tell Xcode to look in |ninja_toplevel| for build products.
85
- new_xcode_settings = {}
86
- if ninja_toplevel:
87
- new_xcode_settings["CONFIGURATION_BUILD_DIR"] = (
88
- "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel
89
- )
90
-
91
- if "configurations" in old_spec:
92
- for config in old_spec["configurations"]:
93
- old_xcode_settings = old_spec["configurations"][config].get(
94
- "xcode_settings", {}
95
- )
96
- if "IPHONEOS_DEPLOYMENT_TARGET" in old_xcode_settings:
97
- new_xcode_settings["CODE_SIGNING_REQUIRED"] = "NO"
98
- new_xcode_settings["IPHONEOS_DEPLOYMENT_TARGET"] = old_xcode_settings[
99
- "IPHONEOS_DEPLOYMENT_TARGET"
100
- ]
101
- for key in ["BUNDLE_LOADER", "TEST_HOST"]:
102
- if key in old_xcode_settings:
103
- new_xcode_settings[key] = old_xcode_settings[key]
104
-
105
- ninja_target["configurations"][config] = {}
106
- ninja_target["configurations"][config][
107
- "xcode_settings"
108
- ] = new_xcode_settings
109
-
110
- ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0)
111
- ninja_target["mac_xctest_bundle"] = old_spec.get("mac_xctest_bundle", 0)
112
- ninja_target["ios_app_extension"] = old_spec.get("ios_app_extension", 0)
113
- ninja_target["ios_watchkit_extension"] = old_spec.get("ios_watchkit_extension", 0)
114
- ninja_target["ios_watchkit_app"] = old_spec.get("ios_watchkit_app", 0)
115
- ninja_target["type"] = old_spec["type"]
116
- if ninja_toplevel:
117
- ninja_target["actions"] = [
118
- {
119
- "action_name": "Compile and copy %s via ninja" % target_name,
120
- "inputs": [],
121
- "outputs": [],
122
- "action": [
123
- "env",
124
- "PATH=%s" % os.environ["PATH"],
125
- "ninja",
126
- "-C",
127
- new_xcode_settings["CONFIGURATION_BUILD_DIR"],
128
- target_name,
129
- ],
130
- "message": "Compile and copy %s via ninja" % target_name,
131
- },
132
- ]
133
- if jobs > 0:
134
- ninja_target["actions"][0]["action"].extend(("-j", jobs))
135
- return ninja_target
136
-
137
-
138
- def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec):
139
- """Limit targets for Xcode wrapper.
140
-
141
- Xcode sometimes performs poorly with too many targets, so only include
142
- proper executable targets, with filters to customize.
143
- Arguments:
144
- target_extras: Regular expression to always add, matching any target.
145
- executable_target_pattern: Regular expression limiting executable targets.
146
- spec: Specifications for target.
147
- """
148
- target_name = spec.get("target_name")
149
- # Always include targets matching target_extras.
150
- if target_extras is not None and re.search(target_extras, target_name):
151
- return True
152
-
153
- # Otherwise just show executable targets and xc_tests.
154
- if int(spec.get("mac_xctest_bundle", 0)) != 0 or (
155
- spec.get("type", "") == "executable"
156
- and spec.get("product_extension", "") != "bundle"
157
- ):
158
-
159
- # If there is a filter and the target does not match, exclude the target.
160
- if executable_target_pattern is not None:
161
- if not re.search(executable_target_pattern, target_name):
162
- return False
163
- return True
164
- return False
165
-
166
-
167
- def CreateWrapper(target_list, target_dicts, data, params):
168
- """Initialize targets for the ninja wrapper.
169
-
170
- This sets up the necessary variables in the targets to generate Xcode projects
171
- that use ninja as an external builder.
172
- Arguments:
173
- target_list: List of target pairs: 'base/base.gyp:base'.
174
- target_dicts: Dict of target properties keyed on target pair.
175
- data: Dict of flattened build files keyed on gyp path.
176
- params: Dict of global options for gyp.
177
- """
178
- orig_gyp = params["build_files"][0]
179
- for gyp_name, gyp_dict in data.items():
180
- if gyp_name == orig_gyp:
181
- depth = gyp_dict["_DEPTH"]
182
-
183
- # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE
184
- # and prepend .ninja before the .gyp extension.
185
- generator_flags = params.get("generator_flags", {})
186
- main_gyp = generator_flags.get("xcode_ninja_main_gyp", None)
187
- if main_gyp is None:
188
- (build_file_root, build_file_ext) = os.path.splitext(orig_gyp)
189
- main_gyp = build_file_root + ".ninja" + build_file_ext
190
-
191
- # Create new |target_list|, |target_dicts| and |data| data structures.
192
- new_target_list = []
193
- new_target_dicts = {}
194
- new_data = {}
195
-
196
- # Set base keys needed for |data|.
197
- new_data[main_gyp] = {}
198
- new_data[main_gyp]["included_files"] = []
199
- new_data[main_gyp]["targets"] = []
200
- new_data[main_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {})
201
-
202
- # Normally the xcode-ninja generator includes only valid executable targets.
203
- # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to
204
- # executable targets that match the pattern. (Default all)
205
- executable_target_pattern = generator_flags.get(
206
- "xcode_ninja_executable_target_pattern", None
207
- )
208
-
209
- # For including other non-executable targets, add the matching target name
210
- # to the |xcode_ninja_target_pattern| regular expression. (Default none)
211
- target_extras = generator_flags.get("xcode_ninja_target_pattern", None)
212
-
213
- for old_qualified_target in target_list:
214
- spec = target_dicts[old_qualified_target]
215
- if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec):
216
- # Add to new_target_list.
217
- target_name = spec.get("target_name")
218
- new_target_name = f"{main_gyp}:{target_name}#target"
219
- new_target_list.append(new_target_name)
220
-
221
- # Add to new_target_dicts.
222
- new_target_dicts[new_target_name] = _TargetFromSpec(spec, params)
223
-
224
- # Add to new_data.
225
- for old_target in data[old_qualified_target.split(":")[0]]["targets"]:
226
- if old_target["target_name"] == target_name:
227
- new_data_target = {}
228
- new_data_target["target_name"] = old_target["target_name"]
229
- new_data_target["toolset"] = old_target["toolset"]
230
- new_data[main_gyp]["targets"].append(new_data_target)
231
-
232
- # Create sources target.
233
- sources_target_name = "sources_for_indexing"
234
- sources_target = _TargetFromSpec(
235
- {
236
- "target_name": sources_target_name,
237
- "toolset": "target",
238
- "default_configuration": "Default",
239
- "mac_bundle": "0",
240
- "type": "executable",
241
- },
242
- None,
243
- )
244
-
245
- # Tell Xcode to look everywhere for headers.
246
- sources_target["configurations"] = {"Default": {"include_dirs": [depth]}}
247
-
248
- # Put excluded files into the sources target so they can be opened in Xcode.
249
- skip_excluded_files = not generator_flags.get(
250
- "xcode_ninja_list_excluded_files", True
251
- )
252
-
253
- sources = []
254
- for target, target_dict in target_dicts.items():
255
- base = os.path.dirname(target)
256
- files = target_dict.get("sources", []) + target_dict.get(
257
- "mac_bundle_resources", []
258
- )
259
-
260
- if not skip_excluded_files:
261
- files.extend(
262
- target_dict.get("sources_excluded", [])
263
- + target_dict.get("mac_bundle_resources_excluded", [])
264
- )
265
-
266
- for action in target_dict.get("actions", []):
267
- files.extend(action.get("inputs", []))
268
-
269
- if not skip_excluded_files:
270
- files.extend(action.get("inputs_excluded", []))
271
-
272
- # Remove files starting with $. These are mostly intermediate files for the
273
- # build system.
274
- files = [file for file in files if not file.startswith("$")]
275
-
276
- # Make sources relative to root build file.
277
- relative_path = os.path.dirname(main_gyp)
278
- sources += [
279
- os.path.relpath(os.path.join(base, file), relative_path) for file in files
280
- ]
281
-
282
- sources_target["sources"] = sorted(set(sources))
283
-
284
- # Put sources_to_index in it's own gyp.
285
- sources_gyp = os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp")
286
- fully_qualified_target_name = f"{sources_gyp}:{sources_target_name}#target"
287
-
288
- # Add to new_target_list, new_target_dicts and new_data.
289
- new_target_list.append(fully_qualified_target_name)
290
- new_target_dicts[fully_qualified_target_name] = sources_target
291
- new_data_target = {}
292
- new_data_target["target_name"] = sources_target["target_name"]
293
- new_data_target["_DEPTH"] = depth
294
- new_data_target["toolset"] = "target"
295
- new_data[sources_gyp] = {}
296
- new_data[sources_gyp]["targets"] = []
297
- new_data[sources_gyp]["included_files"] = []
298
- new_data[sources_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {})
299
- new_data[sources_gyp]["targets"].append(new_data_target)
300
-
301
- # Write workspace to file.
302
- _WriteWorkspace(main_gyp, sources_gyp, params)
303
- return (new_target_list, new_target_dicts, new_data)