griptape-nodes 0.66.0__py3-none-any.whl → 0.66.2__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.
@@ -1163,6 +1163,7 @@ def _shallow_clone_with_pygit2(remote_url: str, ref: str) -> tuple[str, str, dic
1163
1163
  """
1164
1164
  with tempfile.TemporaryDirectory() as temp_dir:
1165
1165
  temp_path = Path(temp_dir)
1166
+ repo = None # Initialize for finally block
1166
1167
 
1167
1168
  try:
1168
1169
  # Use SSH callbacks for SSH URLs
@@ -1171,19 +1172,34 @@ def _shallow_clone_with_pygit2(remote_url: str, ref: str) -> tuple[str, str, dic
1171
1172
  callbacks = _get_ssh_callbacks()
1172
1173
 
1173
1174
  # Shallow clone with depth=1
1174
- checkout_branch = ref if ref != "HEAD" else None
1175
+ # Note: We don't use checkout_branch here because it only works with branches,
1176
+ # not tags or commit SHAs. Instead, we'll fetch and checkout the ref manually.
1175
1177
  repo = pygit2.clone_repository(
1176
1178
  remote_url,
1177
1179
  str(temp_path),
1178
1180
  callbacks=callbacks,
1179
1181
  depth=1,
1180
- checkout_branch=checkout_branch,
1181
1182
  )
1182
1183
 
1183
1184
  if repo is None:
1184
1185
  msg = f"Failed to clone repository from {remote_url}"
1185
1186
  raise GitCloneError(msg)
1186
1187
 
1188
+ # If a specific ref was requested (not HEAD), fetch and checkout that ref
1189
+ if ref != "HEAD":
1190
+ try:
1191
+ # Fetch the specific ref (works for branches, tags, and commits)
1192
+ remote = repo.remotes["origin"]
1193
+ remote.fetch([ref], callbacks=callbacks, depth=1)
1194
+
1195
+ # Now resolve and checkout the ref
1196
+ resolved_ref = repo.revparse_single(ref)
1197
+ repo.checkout_tree(resolved_ref)
1198
+ repo.set_head(resolved_ref.id)
1199
+ except (KeyError, pygit2.GitError) as e:
1200
+ msg = f"Failed to fetch and checkout ref '{ref}' in clone from {remote_url}: {e}"
1201
+ raise GitCloneError(msg) from e
1202
+
1187
1203
  # Find the library JSON file
1188
1204
  library_json_path = find_file_in_directory(temp_path, "griptape[-_]nodes[-_]library.json")
1189
1205
  if library_json_path is None:
@@ -1207,6 +1223,11 @@ def _shallow_clone_with_pygit2(remote_url: str, ref: str) -> tuple[str, str, dic
1207
1223
  except pygit2.GitError as e:
1208
1224
  msg = f"Git error during clone from {remote_url}: {e}"
1209
1225
  raise GitCloneError(msg) from e
1226
+ finally:
1227
+ # Release repository file handles before temp directory cleanup
1228
+ # Critical on Windows where open handles prevent directory deletion
1229
+ if repo is not None:
1230
+ repo.free()
1210
1231
 
1211
1232
  return (library_version, commit_sha, library_data)
1212
1233
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: griptape-nodes
3
- Version: 0.66.0
3
+ Version: 0.66.2
4
4
  Summary: Add your description here
5
5
  Requires-Dist: griptape>=1.8.12
6
6
  Requires-Dist: pydantic>=2.10.6
@@ -253,7 +253,7 @@ griptape_nodes/utils/__init__.py,sha256=kzDZW_VPyxWJFonM3kYTl7A91_JmtHPK0Io4KPLT
253
253
  griptape_nodes/utils/async_utils.py,sha256=4IrW8Ub8iJ2QB9yguZtfN1EB9B5nXHS7jbDaLOHWso0,4844
254
254
  griptape_nodes/utils/dict_utils.py,sha256=1VP2EoyOP0nswoAgjPehpA0izpkygWRX7L--ArN6LV8,7314
255
255
  griptape_nodes/utils/file_utils.py,sha256=Lj1SQH8XyuJx3WoHmWhyZf2gHPirZ0ZpQtPPcuP-ONQ,3288
256
- griptape_nodes/utils/git_utils.py,sha256=hcrancOlWO1qtq93NA1O7sPc_joaHff41z-7JKH6IdQ,44539
256
+ griptape_nodes/utils/git_utils.py,sha256=Gz55JqSFPuxbTzvnXHKHsbMy3PvkNDAYyMQ7szekcL0,45674
257
257
  griptape_nodes/utils/huggingface_utils.py,sha256=txR5XS_01W3TvsH4SQ3AJrFy8oS8Ah9M-ePRSs3jHYA,4737
258
258
  griptape_nodes/utils/image_preview.py,sha256=NhYIqohRF9vbFpWIEvZHdPLLPK_JdUBvC4RvNAsSa1w,4480
259
259
  griptape_nodes/utils/library_utils.py,sha256=UwTdOJcPwJljWYD-DbctjExicaw-6isXZ-Js02jrGCw,4224
@@ -272,7 +272,7 @@ griptape_nodes/version_compatibility/versions/v0_65_5/__init__.py,sha256=4UyspOV
272
272
  griptape_nodes/version_compatibility/versions/v0_65_5/flux_2_removed_parameters.py,sha256=jOlmY5kKHXh8HPzAUtvwMJqzD4bP7pkE--yHUb7jTRA,3305
273
273
  griptape_nodes/version_compatibility/versions/v0_7_0/__init__.py,sha256=IzPPmGK86h2swfGGTOHyVcBIlOng6SjgWQzlbf3ngmo,51
274
274
  griptape_nodes/version_compatibility/versions/v0_7_0/local_executor_argument_addition.py,sha256=Thx8acnbw5OychhwEEj9aFxvbPe7Wgn4V9ZmZ7KRZqc,2082
275
- griptape_nodes-0.66.0.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
276
- griptape_nodes-0.66.0.dist-info/entry_points.txt,sha256=qvevqd3BVbAV5TcantnAm0ouqaqYKhsRO3pkFymWLWM,82
277
- griptape_nodes-0.66.0.dist-info/METADATA,sha256=CV4bNiOA9DIMnFYmEp3FVBOPdpmmkwarQcH68JaO2qQ,5374
278
- griptape_nodes-0.66.0.dist-info/RECORD,,
275
+ griptape_nodes-0.66.2.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
276
+ griptape_nodes-0.66.2.dist-info/entry_points.txt,sha256=qvevqd3BVbAV5TcantnAm0ouqaqYKhsRO3pkFymWLWM,82
277
+ griptape_nodes-0.66.2.dist-info/METADATA,sha256=VC-QhMlVIUuf9pJUTECmxxFkGGcOBDfIc0EDMcfn8ls,5374
278
+ griptape_nodes-0.66.2.dist-info/RECORD,,