wexample-helpers-git 6.3.0__tar.gz → 6.4.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.3.0 → wexample_helpers_git-6.4.0}/PKG-INFO +4 -4
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/README.md +2 -2
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/pyproject.toml +2 -2
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/helpers/git.py +48 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/__init__.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/__pycache__/__init__.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/const/__init__.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/const/common.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/helpers/__init__.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/helpers/__pycache__/__init__.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/helpers/git_retryable_callback_manager.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/helpers/repo.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/py.typed +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/tests/helpers/__init__.py +0 -0
- {wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.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.4.0
|
|
4
4
|
Summary: Some python basic helpers for git.
|
|
5
5
|
Author-Email: weeger <contact@wexample.com>
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Requires-Python: >=3.10
|
|
|
12
12
|
Requires-Dist: attrs>=23.1.0
|
|
13
13
|
Requires-Dist: cattrs>=23.1.0
|
|
14
14
|
Requires-Dist: gitpython
|
|
15
|
-
Requires-Dist: wexample-helpers>=6.
|
|
15
|
+
Requires-Dist: wexample-helpers>=6.9.0
|
|
16
16
|
Provides-Extra: dev
|
|
17
17
|
Requires-Dist: pytest; extra == "dev"
|
|
18
18
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
@@ -20,7 +20,7 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
|
|
21
21
|
# helpers_git
|
|
22
22
|
|
|
23
|
-
Version: 6.
|
|
23
|
+
Version: 6.4.0
|
|
24
24
|
|
|
25
25
|
Some python basic helpers for git.
|
|
26
26
|
|
|
@@ -103,7 +103,7 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
|
|
|
103
103
|
- attrs: >=23.1.0
|
|
104
104
|
- cattrs: >=23.1.0
|
|
105
105
|
- gitpython:
|
|
106
|
-
- wexample-helpers: >=6.
|
|
106
|
+
- wexample-helpers: >=6.9.0
|
|
107
107
|
|
|
108
108
|
## Versioning & Compatibility Policy
|
|
109
109
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# helpers_git
|
|
2
2
|
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.4.0
|
|
4
4
|
|
|
5
5
|
Some python basic helpers for git.
|
|
6
6
|
|
|
@@ -83,7 +83,7 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
|
|
|
83
83
|
- attrs: >=23.1.0
|
|
84
84
|
- cattrs: >=23.1.0
|
|
85
85
|
- gitpython:
|
|
86
|
-
- wexample-helpers: >=6.
|
|
86
|
+
- wexample-helpers: >=6.9.0
|
|
87
87
|
|
|
88
88
|
## Versioning & Compatibility Policy
|
|
89
89
|
|
|
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "wexample-helpers-git"
|
|
9
|
-
version = "6.
|
|
9
|
+
version = "6.4.0"
|
|
10
10
|
description = "Some python basic helpers for git."
|
|
11
11
|
authors = [
|
|
12
12
|
{ name = "weeger", email = "contact@wexample.com" },
|
|
@@ -21,7 +21,7 @@ dependencies = [
|
|
|
21
21
|
"attrs>=23.1.0",
|
|
22
22
|
"cattrs>=23.1.0",
|
|
23
23
|
"gitpython",
|
|
24
|
-
"wexample-helpers>=6.
|
|
24
|
+
"wexample-helpers>=6.9.0",
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
[project.readme]
|
{wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/helpers/git.py
RENAMED
|
@@ -105,6 +105,54 @@ def git_ensure_upstream(
|
|
|
105
105
|
return upstream
|
|
106
106
|
|
|
107
107
|
|
|
108
|
+
def git_get_changed_paths(*, cwd: FileStringOrPath) -> set[str]:
|
|
109
|
+
"""Return absolute paths of all changed, untracked, and ignored files/dirs.
|
|
110
|
+
|
|
111
|
+
Uses git status --porcelain --ignored so that files not yet committed
|
|
112
|
+
and gitignored entries are included alongside tracked modifications.
|
|
113
|
+
Paths are relative to the git root and made absolute.
|
|
114
|
+
Returns an empty set if the directory is not a git repository.
|
|
115
|
+
"""
|
|
116
|
+
from pathlib import Path
|
|
117
|
+
|
|
118
|
+
from wexample_helpers.helpers.file import file_resolve_path
|
|
119
|
+
|
|
120
|
+
cwd_path = Path(file_resolve_path(cwd))
|
|
121
|
+
|
|
122
|
+
try:
|
|
123
|
+
git_root = shell_run(
|
|
124
|
+
["git", "rev-parse", "--show-toplevel"],
|
|
125
|
+
inherit_stdio=False,
|
|
126
|
+
cwd=cwd_path,
|
|
127
|
+
).stdout.strip()
|
|
128
|
+
except Exception:
|
|
129
|
+
return set()
|
|
130
|
+
|
|
131
|
+
git_root_path = Path(git_root)
|
|
132
|
+
|
|
133
|
+
try:
|
|
134
|
+
status_output = shell_run(
|
|
135
|
+
["git", "status", "--porcelain", "--ignored"],
|
|
136
|
+
inherit_stdio=False,
|
|
137
|
+
cwd=git_root_path,
|
|
138
|
+
).stdout
|
|
139
|
+
except Exception:
|
|
140
|
+
return set()
|
|
141
|
+
|
|
142
|
+
paths: set[str] = set()
|
|
143
|
+
for line in status_output.splitlines():
|
|
144
|
+
if len(line) < 3:
|
|
145
|
+
continue
|
|
146
|
+
rel = line[3:]
|
|
147
|
+
if " -> " in rel:
|
|
148
|
+
rel = rel.split(" -> ", 1)[1]
|
|
149
|
+
rel = rel.strip().strip('"').rstrip("/")
|
|
150
|
+
if rel:
|
|
151
|
+
paths.add(str(git_root_path / rel))
|
|
152
|
+
|
|
153
|
+
return paths
|
|
154
|
+
|
|
155
|
+
|
|
108
156
|
def git_get_current_commit_hash(*, cwd: FileStringOrPath, short: bool = False) -> str:
|
|
109
157
|
"""Return the current commit hash (full or short)."""
|
|
110
158
|
from wexample_helpers.helpers.file import file_resolve_path
|
{wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/const/__init__.py
RENAMED
|
File without changes
|
{wexample_helpers_git-6.3.0 → wexample_helpers_git-6.4.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.3.0 → wexample_helpers_git-6.4.0}/src/wexample_helpers_git/helpers/repo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|