wexample-helpers-git 6.1.0__tar.gz → 6.2.0__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.
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/PKG-INFO +2 -2
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/README.md +1 -1
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/pyproject.toml +1 -1
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/helpers/git.py +30 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/__init__.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/__pycache__/__init__.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/const/__init__.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/const/common.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/helpers/__init__.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/helpers/__pycache__/__init__.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/helpers/git_retryable_callback_manager.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/helpers/repo.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/py.typed +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/tests/helpers/__init__.py +0 -0
- {wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/tests/helpers/test_helper_git.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wexample-helpers-git
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.2.0
|
|
4
4
|
Summary: Some python basic helpers for git.
|
|
5
5
|
Author-Email: weeger <contact@wexample.com>
|
|
6
6
|
License: MIT
|
|
@@ -20,7 +20,7 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
|
|
21
21
|
# helpers_git
|
|
22
22
|
|
|
23
|
-
Version: 6.
|
|
23
|
+
Version: 6.2.0
|
|
24
24
|
|
|
25
25
|
Some python basic helpers for git.
|
|
26
26
|
|
{wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/helpers/git.py
RENAMED
|
@@ -442,3 +442,33 @@ def git_tag_exists(
|
|
|
442
442
|
return len(out) > 0
|
|
443
443
|
except Exception:
|
|
444
444
|
return False
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
def git_tag_lightweight(
|
|
448
|
+
tag: str, *, cwd: FileStringOrPath, force: bool = False, inherit_stdio: bool = True
|
|
449
|
+
) -> None:
|
|
450
|
+
"""Create (or force-update) a lightweight tag at HEAD."""
|
|
451
|
+
from wexample_helpers.helpers.file import file_resolve_path
|
|
452
|
+
|
|
453
|
+
cmd = ["tag"]
|
|
454
|
+
if force:
|
|
455
|
+
cmd.append("-f")
|
|
456
|
+
cmd.append(tag)
|
|
457
|
+
git_run(cmd, inherit_stdio=inherit_stdio, cwd=file_resolve_path(cwd))
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
def git_tag_points_to_head(tag: str, *, cwd: FileStringOrPath) -> bool:
|
|
461
|
+
"""Return True if the given tag resolves to the same commit as HEAD."""
|
|
462
|
+
from wexample_helpers.helpers.file import file_resolve_path
|
|
463
|
+
from wexample_helpers.helpers.shell import shell_run
|
|
464
|
+
|
|
465
|
+
try:
|
|
466
|
+
tag_hash = shell_run(
|
|
467
|
+
["git", "rev-parse", f"refs/tags/{tag}^{{}}"],
|
|
468
|
+
inherit_stdio=False,
|
|
469
|
+
cwd=file_resolve_path(cwd),
|
|
470
|
+
).stdout.strip()
|
|
471
|
+
head_hash = git_get_current_commit_hash(cwd=cwd)
|
|
472
|
+
return bool(tag_hash) and tag_hash == head_hash
|
|
473
|
+
except Exception:
|
|
474
|
+
return False
|
{wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/const/__init__.py
RENAMED
|
File without changes
|
{wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/const/common.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wexample_helpers_git-6.1.0 → wexample_helpers_git-6.2.0}/src/wexample_helpers_git/helpers/repo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|