gitbolt 0.0.0.dev26__tar.gz → 0.0.0.dev27__tar.gz
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.
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/PKG-INFO +2 -2
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/pyproject.toml +3 -2
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/base.py +5 -2
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/utils/session.py +20 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt.egg-info/PKG-INFO +2 -2
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/LICENSE +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/README.md +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/setup.cfg +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/__init__.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/_internal_init.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/add.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/base.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/constants.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/exceptions.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/ls_tree.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/models.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/py.typed +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/pytest_plugin.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/__init__.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/_internal_init.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/add.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/constants.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/exceptions.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/impl/__init__.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/impl/simple.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/ls_tree.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/runner/__init__.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/runner/base.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/runner/simple.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/utils/__init__.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/utils/main_cmd.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/utils/models.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/subprocess/worktree.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt/utils.py +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt.egg-info/SOURCES.txt +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt.egg-info/dependency_links.txt +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt.egg-info/entry_points.txt +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt.egg-info/requires.txt +0 -0
- {gitbolt-0.0.0.dev26 → gitbolt-0.0.0.dev27}/src/gitbolt.egg-info/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitbolt
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev27
|
|
4
4
|
Summary: Fast, flexible and type-safe Git commands in Python.
|
|
5
|
-
Author-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
|
|
5
|
+
Author-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>, Thamotharan R <thamotharan.r@vaastav.tech>
|
|
6
6
|
Maintainer-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
|
|
7
7
|
License-Expression: Apache-2.0
|
|
8
8
|
Project-URL: homepage, https://github.com/Vaastav-Technologies/py-gitbolt
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "gitbolt"
|
|
3
|
-
version = "0.0.0.
|
|
3
|
+
version = "0.0.0.dev27"
|
|
4
4
|
description = "Fast, flexible and type-safe Git commands in Python."
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
authors = [
|
|
8
|
-
{name = "Suhas Krishna Srivastava", email = "suhas.srivastava@vaastav.tech"}
|
|
8
|
+
{name = "Suhas Krishna Srivastava", email = "suhas.srivastava@vaastav.tech"},
|
|
9
|
+
{name = "Thamotharan R", email = "thamotharan.r@vaastav.tech"}
|
|
9
10
|
]
|
|
10
11
|
maintainers = [
|
|
11
12
|
{name = "Suhas Krishna Srivastava", email = "suhas.srivastava@vaastav.tech"}
|
|
@@ -35,6 +35,7 @@ from gitbolt.models import GitOpts, GitLsTreeOpts, GitAddOpts, GitEnvVars
|
|
|
35
35
|
from gitbolt.subprocess.worktree import WorktreeCLIArgsBuilder
|
|
36
36
|
from gitbolt.utils import merge_git_opts, merge_git_envs
|
|
37
37
|
from gitbolt.subprocess.constants import GIT_CMD, VERSION_CMD, LS_TREE_CMD, ADD_CMD, WORKTREE_CMD, WORKTREE_ADD_CMD
|
|
38
|
+
from gitbolt.subprocess.utils.session import _close_session_popen
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
class GitCommand(Git, ABC):
|
|
@@ -512,7 +513,9 @@ class GitSession(HasGitUnderneath[GitCommand], AbstractContextManager):
|
|
|
512
513
|
self.started_commands[unstarted_command_key] = unstarted_command().__enter__()
|
|
513
514
|
except Exception:
|
|
514
515
|
for k in reversed(processes_started_keys):
|
|
515
|
-
|
|
516
|
+
_close_session_popen(
|
|
517
|
+
self.started_commands[k], *sys.exc_info()
|
|
518
|
+
)
|
|
516
519
|
raise
|
|
517
520
|
processes_started_keys.append(unstarted_command_key)
|
|
518
521
|
self._commands = SimpleNamespace(**self.started_commands)
|
|
@@ -532,7 +535,7 @@ class GitSession(HasGitUnderneath[GitCommand], AbstractContextManager):
|
|
|
532
535
|
if self.__depth == 0:
|
|
533
536
|
process_done_keys: list[str] = []
|
|
534
537
|
for started_popen_key, started_popen in self.started_commands.items():
|
|
535
|
-
started_popen
|
|
538
|
+
_close_session_popen(started_popen, exc_type, exc_value, traceback)
|
|
536
539
|
process_done_keys.append(started_popen_key)
|
|
537
540
|
self._commands = None
|
|
538
541
|
for pk in process_done_keys:
|
|
@@ -8,6 +8,7 @@ Create sessions for long-running commands and communicate with them using their
|
|
|
8
8
|
|
|
9
9
|
Much faster that subprocess creation for each input/output pair.
|
|
10
10
|
"""
|
|
11
|
+
import errno
|
|
11
12
|
import subprocess
|
|
12
13
|
from typing import Iterable, IO, cast
|
|
13
14
|
|
|
@@ -18,6 +19,25 @@ from gitbolt.subprocess.utils.models import GitRawActor, GitRawSignature, GPGGit
|
|
|
18
19
|
RawCommitBytesObj, RawBytesValsOfCommit
|
|
19
20
|
|
|
20
21
|
|
|
22
|
+
def _close_session_popen(popen: subprocess.Popen[bytes], exc_type, exc_value, traceback) -> None:
|
|
23
|
+
"""
|
|
24
|
+
Close a session ``Popen`` and ignore a broken pipe.
|
|
25
|
+
|
|
26
|
+
A git process started with a bad command can exit before the session does. Closing its stdin
|
|
27
|
+
then raises ``BrokenPipeError`` (common on macOS) or a matching ``OSError``.
|
|
28
|
+
"""
|
|
29
|
+
try:
|
|
30
|
+
popen.__exit__(exc_type, exc_value, traceback)
|
|
31
|
+
except BrokenPipeError:
|
|
32
|
+
return
|
|
33
|
+
except OSError as err:
|
|
34
|
+
if err.errno in {errno.EPIPE, errno.ECONNRESET}:
|
|
35
|
+
return
|
|
36
|
+
if getattr(err, "winerror", None) in {109, 232}:
|
|
37
|
+
return
|
|
38
|
+
raise
|
|
39
|
+
|
|
40
|
+
|
|
21
41
|
# region blob
|
|
22
42
|
def cat_file_blob_content(
|
|
23
43
|
cat_file_popen: subprocess.Popen[bytes], blob_hash: bytes, require_type: bytes | None = None
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitbolt
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev27
|
|
4
4
|
Summary: Fast, flexible and type-safe Git commands in Python.
|
|
5
|
-
Author-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
|
|
5
|
+
Author-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>, Thamotharan R <thamotharan.r@vaastav.tech>
|
|
6
6
|
Maintainer-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
|
|
7
7
|
License-Expression: Apache-2.0
|
|
8
8
|
Project-URL: homepage, https://github.com/Vaastav-Technologies/py-gitbolt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|