fastgit 0.1.5__tar.gz → 0.1.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastgit
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Use git from python, fast
5
5
  Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
6
6
  License-Expression: Apache-2.0
@@ -12,7 +12,7 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: Development Status :: 3 - Alpha
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Requires-Python: >=3.9
15
+ Requires-Python: >=3.11
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: fastcore>=1.12.27
@@ -39,7 +39,7 @@ $ pip install fastgit
39
39
 
40
40
  ### How to use
41
41
 
42
- Create a [`Git`](https://AnswerDotAI.github.io/fastgit/core.html#git) object for the directory you want to work in. Every command runs in that directory. The default local runner expands `~` and resolves relative paths. A custom `runner` receives the supplied directory unchanged. Results have leading and trailing whitespace stripped:
42
+ Create a [`Git`](https://AnswerDotAI.github.io/fastgit/core.html#git) object for the directory you want to work in. Every command runs in that directory. The default local runner expands `~` and resolves relative paths. A custom `runner` receives the supplied directory unchanged. Trailing newlines are stripped from results:
43
43
 
44
44
  ``` python
45
45
  import shutil, tempfile
@@ -19,7 +19,7 @@ $ pip install fastgit
19
19
 
20
20
  ### How to use
21
21
 
22
- Create a [`Git`](https://AnswerDotAI.github.io/fastgit/core.html#git) object for the directory you want to work in. Every command runs in that directory. The default local runner expands `~` and resolves relative paths. A custom `runner` receives the supplied directory unchanged. Results have leading and trailing whitespace stripped:
22
+ Create a [`Git`](https://AnswerDotAI.github.io/fastgit/core.html#git) object for the directory you want to work in. Every command runs in that directory. The default local runner expands `~` and resolves relative paths. A custom `runner` receives the supplied directory unchanged. Trailing newlines are stripped from results:
23
23
 
24
24
  ``` python
25
25
  import shutil, tempfile
@@ -4,6 +4,6 @@
4
4
 
5
5
  Commands run through the installed `git` executable and return its text output. There is no separate object model for repositories and commits. Both synchronous and asynchronous clients are available."""
6
6
 
7
- __version__ = "0.1.5"
7
+ __version__ = "0.1.6"
8
8
 
9
9
  from .core import *
@@ -1,32 +1,32 @@
1
1
  # Autogenerated by nbdev
2
2
 
3
- d = { 'settings': { 'branch': 'main',
4
- 'doc_baseurl': '/fastgit',
5
- 'doc_host': 'https://AnswerDotAI.github.io',
6
- 'git_url': 'https://github.com/AnswerDotAI/fastgit',
7
- 'lib_path': 'fastgit'},
8
- 'syms': { 'fastgit.core': { 'fastgit.core.Git': ('core.html#git', 'fastgit/core.py'),
9
- 'fastgit.core.Git.__call__': ('core.html#git.__call__', 'fastgit/core.py'),
10
- 'fastgit.core.Git.__getattr__': ('core.html#git.__getattr__', 'fastgit/core.py'),
3
+ d = { 'syms': { 'fastgit.core': { 'fastgit.core.GitRes': ('core.html#gitres', 'fastgit/core.py'),
4
+ 'fastgit.core.GitRes.__new__': ('core.html#gitres.__new__', 'fastgit/core.py'),
5
+ 'fastgit.core.GitRes.__repr__': ('core.html#gitres.__repr__', 'fastgit/core.py'),
6
+ 'fastgit.core._gitcmd': ('core.html#_gitcmd', 'fastgit/core.py'),
7
+ 'fastgit.core._depr_uname': ('core.html#_depr_uname', 'fastgit/core.py'),
8
+ 'fastgit.core._gitres': ('core.html#_gitres', 'fastgit/core.py'),
9
+ 'fastgit.core._runlocal': ('core.html#_runlocal', 'fastgit/core.py'),
10
+ 'fastgit.core.callgit': ('core.html#callgit', 'fastgit/core.py'),
11
+ 'fastgit.core.get_top': ('core.html#get_top', 'fastgit/core.py'),
12
+ 'fastgit.core._longopts': ('core.html#_longopts', 'fastgit/core.py'),
13
+ 'fastgit.core.Git': ('core.html#git', 'fastgit/core.py'),
11
14
  'fastgit.core.Git.__init__': ('core.html#git.__init__', 'fastgit/core.py'),
15
+ 'fastgit.core.Git.__call__': ('core.html#git.__call__', 'fastgit/core.py'),
16
+ 'fastgit.core.Git._run': ('core.html#git._run', 'fastgit/core.py'),
12
17
  'fastgit.core.Git._arun': ('core.html#git._arun', 'fastgit/core.py'),
13
18
  'fastgit.core.Git._err': ('core.html#git._err', 'fastgit/core.py'),
14
- 'fastgit.core.Git._run': ('core.html#git._run', 'fastgit/core.py'),
15
- 'fastgit.core.Git.commits': ('core.html#git.commits', 'fastgit/core.py'),
16
- 'fastgit.core.Git.current_branch': ('core.html#git.current_branch', 'fastgit/core.py'),
19
+ 'fastgit.core.Git.__getattr__': ('core.html#git.__getattr__', 'fastgit/core.py'),
20
+ 'fastgit.core.Git.top': ('core.html#git.top', 'fastgit/core.py'),
17
21
  'fastgit.core.Git.exists': ('core.html#git.exists', 'fastgit/core.py'),
18
22
  'fastgit.core.Git.head_sha': ('core.html#git.head_sha', 'fastgit/core.py'),
19
23
  'fastgit.core.Git.last_commit': ('core.html#git.last_commit', 'fastgit/core.py'),
20
- 'fastgit.core.Git.top': ('core.html#git.top', 'fastgit/core.py'),
21
- 'fastgit.core.GitRes': ('core.html#gitres', 'fastgit/core.py'),
22
- 'fastgit.core.GitRes.__new__': ('core.html#gitres.__new__', 'fastgit/core.py'),
23
- 'fastgit.core.GitRes.__repr__': ('core.html#gitres.__repr__', 'fastgit/core.py'),
24
+ 'fastgit.core.Git.commits': ('core.html#git.commits', 'fastgit/core.py'),
25
+ 'fastgit.core.Git.current_branch': ('core.html#git.current_branch', 'fastgit/core.py'),
24
26
  'fastgit.core._arunlocal': ('core.html#_arunlocal', 'fastgit/core.py'),
25
- 'fastgit.core._depr_uname': ('core.html#_depr_uname', 'fastgit/core.py'),
26
- 'fastgit.core._gitcmd': ('core.html#_gitcmd', 'fastgit/core.py'),
27
- 'fastgit.core._gitres': ('core.html#_gitres', 'fastgit/core.py'),
28
- 'fastgit.core._longopts': ('core.html#_longopts', 'fastgit/core.py'),
29
- 'fastgit.core._runlocal': ('core.html#_runlocal', 'fastgit/core.py'),
30
- 'fastgit.core.acallgit': ('core.html#acallgit', 'fastgit/core.py'),
31
- 'fastgit.core.callgit': ('core.html#callgit', 'fastgit/core.py'),
32
- 'fastgit.core.get_top': ('core.html#get_top', 'fastgit/core.py')}}}
27
+ 'fastgit.core.acallgit': ('core.html#acallgit', 'fastgit/core.py')}},
28
+ 'settings': { 'branch': 'main',
29
+ 'git_url': 'https://github.com/AnswerDotAI/fastgit',
30
+ 'doc_host': 'https://AnswerDotAI.github.io',
31
+ 'doc_baseurl': '/fastgit',
32
+ 'lib_path': 'fastgit'}}
@@ -20,7 +20,7 @@ _ok1 = {'merge-tree','merge-base','grep','check-ignore','diff','diff-index','dif
20
20
  class GitRes(str):
21
21
  "Git output text for display, with raw `stdout`, `stderr` and `returncode`"
22
22
  def __new__(cls, stdout, stderr, returncode=0):
23
- self = super().__new__(cls, (stdout + stderr).strip())
23
+ self = super().__new__(cls, (stdout + stderr).rstrip('\r\n'))
24
24
  self.stdout,self.stderr,self.returncode = stdout,stderr,returncode
25
25
  return self
26
26
 
@@ -55,7 +55,7 @@ def callgit(
55
55
  ok_exit=None, # Extra accepted exit codes (default: 1 for `_ok1` commands)
56
56
  runner=None, # Replaces the local subprocess: `(path, args, pre) -> (stdout, stderr, returncode)`
57
57
  ):
58
- "Run git in `path`; its `GitRes` displays stripped output and retains raw stdout/stderr"
58
+ "Run git in `path`; its `GitRes` strips trailing newlines for display and retains raw stdout/stderr"
59
59
  out,err,rc = (runner or _runlocal)(path, list(args), pre=_depr_uname(uname, pre))
60
60
  return _gitres(args, out, err, rc, ok_exit)
61
61
 
@@ -85,7 +85,7 @@ class Git:
85
85
  ok_exit=None, # Extra accepted exit codes (default: 1 for commands like `diff` where it isn't an error)
86
86
  **kwargs # Become flags: short keys as `-k v`, long as `--key=v` (`_` to `-`; `True` bare, `False` dropped); `__` passes paths after `--`
87
87
  ):
88
- "Run `git cmd` in `self.d`, returning a `GitRes` (or an awaitable of one when `sync=False`)"
88
+ "Run `git cmd` in `self.d`, returning a `GitRes`, or `None` if it fails without `raise_exc` (an awaitable of either when `sync=False`)"
89
89
  paths = [str(p) for p in listify(kwargs.pop('__', None) or [])]
90
90
  args = listify(args)
91
91
  kwargs = {k:v for k,v in kwargs.items() if v is not False}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastgit
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Use git from python, fast
5
5
  Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
6
6
  License-Expression: Apache-2.0
@@ -12,7 +12,7 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: Development Status :: 3 - Alpha
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Requires-Python: >=3.9
15
+ Requires-Python: >=3.11
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: fastcore>=1.12.27
@@ -39,7 +39,7 @@ $ pip install fastgit
39
39
 
40
40
  ### How to use
41
41
 
42
- Create a [`Git`](https://AnswerDotAI.github.io/fastgit/core.html#git) object for the directory you want to work in. Every command runs in that directory. The default local runner expands `~` and resolves relative paths. A custom `runner` receives the supplied directory unchanged. Results have leading and trailing whitespace stripped:
42
+ Create a [`Git`](https://AnswerDotAI.github.io/fastgit/core.html#git) object for the directory you want to work in. Every command runs in that directory. The default local runner expands `~` and resolves relative paths. A custom `runner` receives the supplied directory unchanged. Trailing newlines are stripped from results:
43
43
 
44
44
  ``` python
45
45
  import shutil, tempfile
@@ -7,7 +7,7 @@ name = "fastgit"
7
7
  dynamic = ["version"]
8
8
  description = "Use git from python, fast"
9
9
  readme = "README.md"
10
- requires-python = ">=3.9"
10
+ requires-python = ">=3.11"
11
11
  license = "Apache-2.0"
12
12
  authors = [{name = "Jeremy Howard", email = "github@jhoward.fastmail.fm"}]
13
13
  keywords = ['nbdev', 'jupyter', 'notebook', 'python']
@@ -28,6 +28,7 @@ version = {attr = "fastgit.__version__"}
28
28
  include = ["fastgit"]
29
29
 
30
30
  [tool.nbdev]
31
+ to_meta = ["export"]
31
32
  allowed_metadata_keys = ['solveit']
32
33
  allowed_cell_metadata_keys = ['solveit_ai']
33
34
  custom_sidebar = false
File without changes
File without changes