wexample-helpers-git 0.0.18__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.
- wexample_helpers_git/const/__init__.py +0 -0
- wexample_helpers_git/const/common.py +2 -0
- wexample_helpers_git/helpers/__init__.py +0 -0
- wexample_helpers_git/helpers/git.py +26 -0
- wexample_helpers_git/py.typed +0 -0
- wexample_helpers_git-0.0.18.dist-info/METADATA +17 -0
- wexample_helpers_git-0.0.18.dist-info/RECORD +9 -0
- wexample_helpers_git-0.0.18.dist-info/WHEEL +5 -0
- wexample_helpers_git-0.0.18.dist-info/top_level.txt +1 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from git import InvalidGitRepositoryError, Remote, Repo
|
|
4
|
+
from wexample_helpers.const.types import FileStringOrPath
|
|
5
|
+
from wexample_helpers.helpers.file import file_resolve_path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def git_is_init(path: FileStringOrPath) -> bool:
|
|
9
|
+
path = file_resolve_path(path)
|
|
10
|
+
|
|
11
|
+
if not path.exists():
|
|
12
|
+
return False
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
Repo(path)
|
|
16
|
+
return True
|
|
17
|
+
except InvalidGitRepositoryError:
|
|
18
|
+
return False
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def git_remote_create_once(repo: Repo, name: str, url: str) -> Optional[Remote]:
|
|
22
|
+
try:
|
|
23
|
+
repo.remote(name=name)
|
|
24
|
+
return None
|
|
25
|
+
except ValueError:
|
|
26
|
+
return repo.create_remote(name, url)
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: wexample-helpers-git
|
|
3
|
+
Version: 0.0.18
|
|
4
|
+
Summary: Some python basic helpers for git.
|
|
5
|
+
Author-email: weeger <contact@wexample.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: homepage, https://github.com/wexample/python-helpers-git
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: gitpython
|
|
14
|
+
|
|
15
|
+
# helpers
|
|
16
|
+
|
|
17
|
+
Some python basic helpers and constants for git operations
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
wexample_helpers_git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
wexample_helpers_git/const/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
wexample_helpers_git/const/common.py,sha256=XaUahviaiN5H7WTWj6olrrFyrq0IFeiwZn9TXH0uW6w,62
|
|
4
|
+
wexample_helpers_git/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
wexample_helpers_git/helpers/git.py,sha256=l2nuEpuX8B-CoXBGLQ25mz0LCi0PqiKnIebd98c4I3A,656
|
|
6
|
+
wexample_helpers_git-0.0.18.dist-info/METADATA,sha256=KJe8_EoCK2y5DOrve51s5zwSNho-GTBgU_4DPG2k-Ew,541
|
|
7
|
+
wexample_helpers_git-0.0.18.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
+
wexample_helpers_git-0.0.18.dist-info/top_level.txt,sha256=T87tKgoDO9mDPxgbQNXdDMLYekVFHAgOZr1B7FMaKqQ,21
|
|
9
|
+
wexample_helpers_git-0.0.18.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
wexample_helpers_git
|