prefect 3.7.8.dev2__py3-none-any.whl → 3.7.8.dev3__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.
prefect/_build_info.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # Generated by versioningit
2
- __version__ = "3.7.8.dev2"
3
- __build_date__ = "2026-07-07 09:14:19.574605+00:00"
4
- __git_commit__ = "3f47d765fea655c92f2d700fedee8635ea2d4d2f"
2
+ __version__ = "3.7.8.dev3"
3
+ __build_date__ = "2026-07-08 08:58:16.990202+00:00"
4
+ __git_commit__ = "b2c95fd622d9ba86e5da2be0f7a63d4017f2a695"
5
5
  __dirty__ = False
prefect/runner/storage.py CHANGED
@@ -1,8 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import os
3
4
  import re
4
5
  import shutil
6
+ import stat
5
7
  import subprocess
8
+ import sys
6
9
  import warnings
7
10
  from copy import deepcopy
8
11
  from pathlib import Path
@@ -31,6 +34,41 @@ from prefect.logging.loggers import get_logger
31
34
  from prefect.utilities.collections import visit_collection
32
35
 
33
36
 
37
+ def _clear_read_only_attributes(path: Path) -> None:
38
+ """
39
+ Recursively clear the read-only attribute on files within a directory.
40
+
41
+ On Windows, git writes pack and loose object files as read-only (mode
42
+ `0o444`). A subsequent `git pull` that needs to repack or replace those
43
+ files then fails with `[WinError 5] Access is denied`. Marking the files
44
+ as writable beforehand lets git manage them. This is a no-op on
45
+ non-Windows platforms, where read-only object files do not block git.
46
+ """
47
+ if sys.platform != "win32":
48
+ return
49
+ if not path.exists():
50
+ return
51
+ for entry in path.rglob("*"):
52
+ try:
53
+ if entry.is_file() and not entry.is_symlink():
54
+ os.chmod(entry, stat.S_IWRITE | stat.S_IREAD)
55
+ except OSError:
56
+ # Best effort: if a single file can't be made writable, let git
57
+ # surface the underlying error rather than masking it here.
58
+ continue
59
+
60
+
61
+ def _rmtree_including_read_only(path: Path) -> None:
62
+ """
63
+ Remove a directory tree, first clearing read-only attributes so that
64
+ read-only git object files (mode `0o444` on Windows) do not raise
65
+ `[WinError 5] Access is denied` during deletion. This is a plain
66
+ `shutil.rmtree` on non-Windows platforms.
67
+ """
68
+ _clear_read_only_attributes(path)
69
+ shutil.rmtree(path)
70
+
71
+
34
72
  @runtime_checkable
35
73
  class RunnerStorage(Protocol):
36
74
  """
@@ -393,6 +431,11 @@ class GitRepository:
393
431
  f"does not match the configured repository {configured_repo_url}"
394
432
  )
395
433
 
434
+ # On Windows, git object files are read-only, which prevents git
435
+ # from repacking or replacing them during a pull. Clear the
436
+ # read-only attribute first to avoid `[WinError 5] Access is denied`.
437
+ _clear_read_only_attributes(git_dir)
438
+
396
439
  # Sparsely checkout the repository if directories are specified and the repo is not in sparse-checkout mode already
397
440
  if self._directories and not await self.is_sparsely_checked_out():
398
441
  await run_process(
@@ -423,7 +466,7 @@ class GitRepository:
423
466
  self._logger.error(
424
467
  f"Failed to fetch latest changes with exit code {exc}"
425
468
  )
426
- shutil.rmtree(self.destination)
469
+ _rmtree_including_read_only(self.destination)
427
470
  await self._clone_repo()
428
471
 
429
472
  await run_process(
@@ -449,7 +492,7 @@ class GitRepository:
449
492
  self._logger.error(
450
493
  f"Failed to pull latest changes with exit code {exc}"
451
494
  )
452
- shutil.rmtree(self.destination)
495
+ _rmtree_including_read_only(self.destination)
453
496
  await self._clone_repo()
454
497
 
455
498
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect
3
- Version: 3.7.8.dev2
3
+ Version: 3.7.8.dev3
4
4
  Summary: Workflow orchestration and management.
5
5
  Project-URL: Changelog, https://github.com/PrefectHQ/prefect/releases
6
6
  Project-URL: Documentation, https://docs.prefect.io
@@ -2,7 +2,7 @@ prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
2
2
  prefect/AGENTS.md,sha256=H7j73ZMACxsIfHXO6pTAdyQy2yi7XGnADtgwcMqMVO4,11049
3
3
  prefect/__init__.py,sha256=Z8rwfLbEOLh-5WcznTZP3FG2-9UgGZxY-prj8sL0-Qk,6828
4
4
  prefect/__main__.py,sha256=WFjw3kaYJY6pOTA7WDOgqjsz8zUEUZHCcj3P5wyVa-g,66
5
- prefect/_build_info.py,sha256=w7179WVe7MRkK0cIlgyfo5rc890eQ_MHOvQYRx8UBBU,185
5
+ prefect/_build_info.py,sha256=-VkixQ2x5TYD0dmITMQJ7GSn7LFMF73sKDbT_PETJIM,185
6
6
  prefect/_flow_run_suspension.py,sha256=5zTTB7ZIBHzoS0pVrhNn23-9hK51qZ3CQA6C-azluC0,4144
7
7
  prefect/agent.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
8
8
  prefect/artifacts.py,sha256=ZdMLJeJGK82hibtRzbsVa-g95dMa0D2UP1LiESoXmf4,23951
@@ -368,7 +368,7 @@ prefect/runner/_workspace_resolver.py,sha256=HweB3dIfS-lOSdRnH1Bu3c8GcYXkM8KSfsu
368
368
  prefect/runner/_workspace_starter.py,sha256=P9tX_iv0zROc6k6YB68L5eNiyuc_HoP2clOSqE--rsg,12096
369
369
  prefect/runner/runner.py,sha256=ZNgmuD19yNldoCDCXynNp1NoB8idIbZQb24vdKCnMvM,75785
370
370
  prefect/runner/server.py,sha256=YqvQjlxZZHyhSsqyaLvOy2NwTDg1hLSZB2PK3t8FJUg,3636
371
- prefect/runner/storage.py,sha256=rG0P79LQhACcU05roMbcG3WgZXRmPL-SMfh3LlCr44Q,42470
371
+ prefect/runner/storage.py,sha256=ufGKaruyhirzZjhFD4LaQUpMRY2mmUwraEtaE-G9PSg,44168
372
372
  prefect/runtime/__init__.py,sha256=JswiTlYRup2zXOYu8AqJ7czKtgcw9Kxo0tTbS6aWCqY,407
373
373
  prefect/runtime/deployment.py,sha256=jYD-jkbb1dAl0wQuiY5mulVTqAEnF4xE3D5Iard6yms,5552
374
374
  prefect/runtime/flow_run.py,sha256=KZRWdcqKOHvlK1g4OucFTH_o3XonoI1rzF81uQfjdu0,10793
@@ -1394,8 +1394,8 @@ prefect/workers/_worker_channel/_protocol.py,sha256=GpCNh1o3qmmqHA_UOOTge1QVC6IR
1394
1394
  prefect/workers/_worker_channel/_state.py,sha256=eQTFZtAVDZH1vVWps3SdeY6aW3qu2wx1UKYQXK3AyuE,5369
1395
1395
  prefect/workers/_worker_channel/_sync.py,sha256=G5G8_UaQYbeLebi5Mb1Z_KgGfXfyjXo5uT9la5_zwqY,14984
1396
1396
  prefect/workers/_worker_channel/_transport.py,sha256=_8aWX16tdbZcpqBg4HCX_vCzl2FX47jsYPKMPLAANRA,9181
1397
- prefect-3.7.8.dev2.dist-info/METADATA,sha256=PEjGW1KfvJ7mbVRcxw1R6mSUQFhx9GsK0yOqeoS4pvQ,14030
1398
- prefect-3.7.8.dev2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
1399
- prefect-3.7.8.dev2.dist-info/entry_points.txt,sha256=HlY8up83iIq2vU2r33a0qSis4eOFSyb1mRH4l7Xt9X8,126
1400
- prefect-3.7.8.dev2.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
1401
- prefect-3.7.8.dev2.dist-info/RECORD,,
1397
+ prefect-3.7.8.dev3.dist-info/METADATA,sha256=u2f81IB9_jvCNajONRH8_l1_2Bb5SHTh-g12jQhBBm8,14030
1398
+ prefect-3.7.8.dev3.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
1399
+ prefect-3.7.8.dev3.dist-info/entry_points.txt,sha256=HlY8up83iIq2vU2r33a0qSis4eOFSyb1mRH4l7Xt9X8,126
1400
+ prefect-3.7.8.dev3.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
1401
+ prefect-3.7.8.dev3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.30.1
2
+ Generator: hatchling 1.31.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any