gitbolt 0.0.0.dev8__py3-none-any.whl → 0.0.0.dev10__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.
gitbolt/base.py CHANGED
@@ -154,6 +154,8 @@ class Add(GitSubCommand, RootDirOp, Protocol):
154
154
  Interface for ``git add`` command.
155
155
  """
156
156
 
157
+ # TODO: `pathspec: str` -> `pathspec_or_path: str | Path`.
158
+ # This will make a convenience method for python use.
157
159
  @overload
158
160
  @abstractmethod
159
161
  def add(
@@ -459,6 +459,10 @@ class UncheckedSubcmd(GitSubcmdCommand, RootDirOp, Protocol):
459
459
  def _subcmd_from_git(self, git: "Git") -> Self:
460
460
  return self
461
461
 
462
+ # TODO: the static type-safety of `run()` is not correct.
463
+ # `run([..], text=True, _input=b'<some-str>')` is incorrect
464
+ # as this should raise static-type check safety issue because text=True and _input is bytes. Similarly
465
+ # `run([..], text=False, _input='<some-bytes>')` does not raise issue as well.
462
466
  @overload
463
467
  def run(
464
468
  self,
@@ -168,7 +168,9 @@ class SimpleGitCommand(GitCommand, RootDirOp):
168
168
  self._version_subcmd = version_subcmd or VersionCommandImpl(self)
169
169
  self._ls_tree = ls_tree_subcmd or LsTreeCommandImpl(self.root_dir, self)
170
170
  self._add_subcmd = add_subcmd or AddCommandImpl(self.root_dir, self)
171
- self._subcmd_unchecked = subcmd_unchecked or UncheckedSubcmdImpl(self.root_dir, self)
171
+ self._subcmd_unchecked = subcmd_unchecked or UncheckedSubcmdImpl(
172
+ self.root_dir, self
173
+ )
172
174
 
173
175
  @override
174
176
  @property
gitbolt/models.py CHANGED
@@ -368,6 +368,17 @@ class GitLogEnvVars(TypedDict, total=False):
368
368
  """
369
369
 
370
370
 
371
+ class GitGPGEnvVars(TypedDict, total=False):
372
+ """
373
+ Environment variables related to GPG and git.
374
+ """
375
+
376
+ GNUPGHOME: Path
377
+ """
378
+ GPG will use this path for operations.
379
+ """
380
+
381
+
371
382
  class GitEnvVars(
372
383
  GitCommitEnvVars,
373
384
  GitEditorEnvVars,
@@ -377,6 +388,7 @@ class GitEnvVars(
377
388
  GitRepoEnvVars,
378
389
  GitNetworkEnvVars,
379
390
  GitSysEnvVars,
391
+ GitGPGEnvVars,
380
392
  ):
381
393
  """
382
394
  Environment variables that control Git's runtime behavior.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitbolt
3
- Version: 0.0.0.dev8
3
+ Version: 0.0.0.dev10
4
4
  Summary: Fast, flexible and type-safe Git commands in Python.
5
5
  Author-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
6
6
  Maintainer-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
@@ -26,7 +26,8 @@ Classifier: Typing :: Typed
26
26
  Requires-Python: >=3.12
27
27
  Description-Content-Type: text/markdown
28
28
  License-File: LICENSE
29
- Requires-Dist: vt-err-hndlr==0.0.0dev1
29
+ Requires-Dist: vt-err-hndlr>=0.0.0dev3
30
+ Requires-Dist: vt-commons>=0.0.1.dev4
30
31
  Provides-Extra: pygit2
31
32
  Requires-Dist: pygit2; extra == "pygit2"
32
33
  Provides-Extra: test
@@ -62,6 +63,7 @@ Dynamic: license-file
62
63
  * 📄 **Transparent Output:** Returns a Git command's `stdout` as-is.
63
64
  * 🧪 **Terminal Functions:** Git subcommands are terminal functions.
64
65
  * 🧼 **Idiomatic Python:** Write commands in idiomatic Python at compile-time and be confident they’ll execute smoothly at runtime.
66
+ * 🎀 **Add-ons:** Special features provided to ease programming with git. These can be added if required.
65
67
 
66
68
  ---
67
69
 
@@ -140,6 +142,53 @@ status_out = git.status_subcmd.status()
140
142
  print(status_out)
141
143
  ```
142
144
 
145
+ ### 🪼 Modular Architecture
146
+
147
+ #### 🧑‍💻 Modular at the programmatic level
148
+
149
+ Commands are designed to be passed around as objects. This makes them modular and thus users can opt to use only
150
+ particular commands.
151
+
152
+ ```python
153
+ from gitbolt import get_git
154
+
155
+ git = get_git() # get git object for the current working directory
156
+ add_subcmd = git.add_subcmd
157
+ ls_tree_subcmd = git.ls_tree_subcmd
158
+
159
+ # now, functions can be written to accept only the required subcommands and nothing more than that.
160
+ ```
161
+
162
+ #### 📽️ Modular at project level
163
+
164
+ Only required commands and hence their implementations can be installed as per user requirement.
165
+
166
+ e.g.
167
+
168
+ - To install only the `git add` command related logic:
169
+ - ```shell
170
+ pip install gitbolt[add]
171
+ ```
172
+ - To install command logic related to `git add` and `git rm` commands:
173
+ - ```shell
174
+ pip install gitbolt[add,rm]
175
+ ```
176
+ - Install all porcelain related commands:
177
+ - ```shell
178
+ pip install gitbolt[porcelain]
179
+ ```
180
+ - Install high performance `pygit2` implementations:
181
+ - ```shell
182
+ pip install gitbolt[pygit2]
183
+ ```
184
+ - ```shell
185
+ pip install gitbolt[add,pygit2,rm]
186
+ ```
187
+ - At last, install every command's implementation:
188
+ - ```shell
189
+ pip install gitbolt[all]
190
+ ```
191
+
143
192
  ---
144
193
 
145
194
  ## 🧠 Strong Typing Everywhere
@@ -325,3 +374,4 @@ Transformers for formatting/parsing can be added later.
325
374
 
326
375
  * Support `pygit2` for direct, fast Git access.
327
376
  * Enable `porcelain` support using `pygit2` where required.
377
+ > `pygit2` usage will automatically make all commands return in porcelain mode.
@@ -1,30 +1,30 @@
1
1
  gitbolt/__init__.py,sha256=SyV-PMv4Ul_k8sh7Y76Y4hUku1N5s-4ViyDpVbfRDOI,1176
2
2
  gitbolt/_internal_init.py,sha256=alSsIMgBWHmOdUo7P1ewftR12xPv8vb3ZgECuVsRMwk,485
3
3
  gitbolt/add.py,sha256=F16d0SQfLrjbpUzJIjKFwGU4KLSjqtYLOA9oZ5gdNS0,31731
4
- gitbolt/base.py,sha256=Vhd4GkTu3OscngXRJVfUMxVDY5Ilu6WVZvuhNw4dgFA,9649
4
+ gitbolt/base.py,sha256=KIWqAVaTUzKfcsfiWY5NXGrZ-WSeBkGvo_pk86mpWEs,9771
5
5
  gitbolt/constants.py,sha256=DTdG44PiJ-2XbScPcvvUOMGVDjddH-j7pORO42fjgiE,206
6
6
  gitbolt/exceptions.py,sha256=7YvR7whZYM1hlWZk4GxHbeNgJ0KJXElg5VFA1Vi-fiA,989
7
7
  gitbolt/ls_tree.py,sha256=PrDSoh4Pnqh6g4AfX8kwgez_zHYaH4yqknULbFbisUY,6269
8
- gitbolt/models.py,sha256=iwIO-ugHYiKS57I_LPo3uDFEQlAtu2mnn5AjZHHQg04,18828
8
+ gitbolt/models.py,sha256=ExIYraiqD_WlwouUady0UtnZ8Vi9FlkzOZkWoCmOMz4,19040
9
9
  gitbolt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  gitbolt/pytest_plugin.py,sha256=Gto30Ofmfz8kJ_AuBrEhqENmWoDlpMnsrpQWzHDmUi4,833
11
11
  gitbolt/utils.py,sha256=XftX3LIKtfzjQaUZUF3QYaFJFM-QdFjc05ZrZSMSdeM,6315
12
12
  gitbolt/git_subprocess/__init__.py,sha256=yEyJKH_iXFBkdgQMwE8vnHnhVTrjs2RkQUjUCF25SzU,590
13
13
  gitbolt/git_subprocess/_internal_init.py,sha256=C6jfsbjXhIFHaDH9GE-wLPAN9WMlUU57rRLWvfpZuAs,255
14
14
  gitbolt/git_subprocess/add.py,sha256=1PA9XonqFi2O941eBwIPMobSNgEJ0tgFYxlkVXSe1K4,17277
15
- gitbolt/git_subprocess/base.py,sha256=iAL_aFiywqbZGuPHTqY03ve5O0bYkdyLzmdzc30mM4E,17756
15
+ gitbolt/git_subprocess/base.py,sha256=1tXy5kgmY_2e6jofuqEFY0y-yXTSgGD5SF7hwoMr4xU,18075
16
16
  gitbolt/git_subprocess/constants.py,sha256=3qHXbNjPf_DOhTPNHi3_bcvIpvtqvgFtpGoTJLYmTWk,250
17
17
  gitbolt/git_subprocess/exceptions.py,sha256=cx4YKzxeBRSRKoF-oakZLpFUGrAHiGj1FtMIsiK5oHc,4063
18
18
  gitbolt/git_subprocess/ls_tree.py,sha256=MmM3qh-kvkD_tGQG9yliLx-reY_5TIVEArvAXJN6rP4,13200
19
19
  gitbolt/git_subprocess/utils.py,sha256=n9_kXPvDf0ACrzAm6SVVLBOFM1JyjHmXJl_99vBoPS8,4941
20
20
  gitbolt/git_subprocess/impl/__init__.py,sha256=bxYluO0B3My-10H5Z0JuEGvZe_g8i71QTpt6iM0WXoU,97
21
- gitbolt/git_subprocess/impl/simple.py,sha256=sjdby07SlLfdKpGlLedN9nYEAWxkGqy-rlJ1x32rbtE,7051
21
+ gitbolt/git_subprocess/impl/simple.py,sha256=xaFYze55rH6sxNm_0D30W5Klj2BtRnv5WGUzv6TVtj0,7073
22
22
  gitbolt/git_subprocess/runner/__init__.py,sha256=LPxbj3AwKLXyDxxCLwAVtl5b5SKjaNDj99lkKz6VSOU,177
23
23
  gitbolt/git_subprocess/runner/base.py,sha256=Sof2WaNyYULiObRF7WjaGs7-yGrdyeHUXchE2tg1820,1562
24
24
  gitbolt/git_subprocess/runner/simple_impl.py,sha256=JvKCQ_MITguuMn3f3hVQwfAukymkIqFdli5f2fxin54,2524
25
- gitbolt-0.0.0.dev8.dist-info/licenses/LICENSE,sha256=pOzr5bMWS6mHi3vro8d5vw0qW1i14rVq2XFrDuystVY,11372
26
- gitbolt-0.0.0.dev8.dist-info/METADATA,sha256=sioQ-E59oXr5auqJiY0iOJNrI_1rBiSBtHDQ4_ZtGmE,11287
27
- gitbolt-0.0.0.dev8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
- gitbolt-0.0.0.dev8.dist-info/entry_points.txt,sha256=Q078Wjss4skreUs8hzAEJ8sUcH4Rhjc9emZ4jRXCiBM,52
29
- gitbolt-0.0.0.dev8.dist-info/top_level.txt,sha256=QCXclkzSPZjgamcwB6XuKJexaJ1as_TLUUSGdIDA7VY,8
30
- gitbolt-0.0.0.dev8.dist-info/RECORD,,
25
+ gitbolt-0.0.0.dev10.dist-info/licenses/LICENSE,sha256=pOzr5bMWS6mHi3vro8d5vw0qW1i14rVq2XFrDuystVY,11372
26
+ gitbolt-0.0.0.dev10.dist-info/METADATA,sha256=YBES_BcIVjRJci7SkE8YBZGnZ8jLVveOS579kApRGko,12749
27
+ gitbolt-0.0.0.dev10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
+ gitbolt-0.0.0.dev10.dist-info/entry_points.txt,sha256=Q078Wjss4skreUs8hzAEJ8sUcH4Rhjc9emZ4jRXCiBM,52
29
+ gitbolt-0.0.0.dev10.dist-info/top_level.txt,sha256=QCXclkzSPZjgamcwB6XuKJexaJ1as_TLUUSGdIDA7VY,8
30
+ gitbolt-0.0.0.dev10.dist-info/RECORD,,