batchfetch 1.3.0__tar.gz → 1.3.2__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.
- {batchfetch-1.3.0 → batchfetch-1.3.2}/PKG-INFO +4 -4
- {batchfetch-1.3.0 → batchfetch-1.3.2}/README.md +3 -3
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch/batchfetch_base.py +17 -14
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch/batchfetch_cli.py +8 -8
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch.egg-info/PKG-INFO +4 -4
- {batchfetch-1.3.0 → batchfetch-1.3.2}/setup.py +1 -1
- {batchfetch-1.3.0 → batchfetch-1.3.2}/LICENSE +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch/__init__.py +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch/batchfetch_git.py +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch/helpers.py +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch.egg-info/SOURCES.txt +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch.egg-info/dependency_links.txt +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch.egg-info/entry_points.txt +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch.egg-info/requires.txt +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/batchfetch.egg-info/top_level.txt +0 -0
- {batchfetch-1.3.0 → batchfetch-1.3.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: batchfetch
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.2
|
|
4
4
|
Summary: Efficiently clone and pull multiple Git repositories.
|
|
5
5
|
Home-page: https://github.com/jamescherti/batchfetch
|
|
6
6
|
Author: James Cherti
|
|
@@ -117,13 +117,13 @@ The parent directory of the "path:" value defines the managed directory, where t
|
|
|
117
117
|
|
|
118
118
|
For example, if the "path:" value is `file/my-project`, the managed directory will be `file/`. Any file within `file/` that is not managed by batchfetch will be considered an untracked file.
|
|
119
119
|
|
|
120
|
-
When *batchfetch* encounters an untracked file, it displays an error message to inform users about paths that are not managed by the system. The message provides clear instructions on how to handle these paths by adding them to the `options.
|
|
120
|
+
When *batchfetch* encounters an untracked file, it displays an error message to inform users about paths that are not managed by the system. The message provides clear instructions on how to handle these paths by adding them to the `options.ignore_untracked` list, enabling users to manage untracked files effectively.
|
|
121
121
|
|
|
122
122
|
Here is an example of a *batchfetch.yaml* file that enables *batchfetch* to accept a list of untracked files:
|
|
123
123
|
|
|
124
124
|
``` yaml
|
|
125
125
|
options:
|
|
126
|
-
|
|
126
|
+
ignore_untracked:
|
|
127
127
|
- ./test
|
|
128
128
|
- /absolute/path
|
|
129
129
|
- ../relative/path
|
|
@@ -132,7 +132,7 @@ tasks:
|
|
|
132
132
|
- git: https://github.com/user/project
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
By default, *batchfetch.yaml* is the only untracked file that is ignored. The user does not need to add it to the *
|
|
135
|
+
By default, *batchfetch.yaml* is the only untracked file that is ignored. The user does not need to add it to the *ignore_untracked* option.
|
|
136
136
|
|
|
137
137
|
### How is the Git local paths handled?
|
|
138
138
|
|
|
@@ -97,13 +97,13 @@ The parent directory of the "path:" value defines the managed directory, where t
|
|
|
97
97
|
|
|
98
98
|
For example, if the "path:" value is `file/my-project`, the managed directory will be `file/`. Any file within `file/` that is not managed by batchfetch will be considered an untracked file.
|
|
99
99
|
|
|
100
|
-
When *batchfetch* encounters an untracked file, it displays an error message to inform users about paths that are not managed by the system. The message provides clear instructions on how to handle these paths by adding them to the `options.
|
|
100
|
+
When *batchfetch* encounters an untracked file, it displays an error message to inform users about paths that are not managed by the system. The message provides clear instructions on how to handle these paths by adding them to the `options.ignore_untracked` list, enabling users to manage untracked files effectively.
|
|
101
101
|
|
|
102
102
|
Here is an example of a *batchfetch.yaml* file that enables *batchfetch* to accept a list of untracked files:
|
|
103
103
|
|
|
104
104
|
``` yaml
|
|
105
105
|
options:
|
|
106
|
-
|
|
106
|
+
ignore_untracked:
|
|
107
107
|
- ./test
|
|
108
108
|
- /absolute/path
|
|
109
109
|
- ../relative/path
|
|
@@ -112,7 +112,7 @@ tasks:
|
|
|
112
112
|
- git: https://github.com/user/project
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
By default, *batchfetch.yaml* is the only untracked file that is ignored. The user does not need to add it to the *
|
|
115
|
+
By default, *batchfetch.yaml* is the only untracked file that is ignored. The user does not need to add it to the *ignore_untracked* option.
|
|
116
116
|
|
|
117
117
|
### How is the Git local paths handled?
|
|
118
118
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
import os
|
|
22
22
|
from copy import deepcopy
|
|
23
23
|
from pathlib import Path
|
|
24
|
-
from typing import Any, Dict
|
|
24
|
+
from typing import Any, Dict, List
|
|
25
25
|
|
|
26
26
|
from schema import Optional, Or, Schema
|
|
27
27
|
|
|
@@ -39,13 +39,12 @@ class DataAlreadyInitialized(Exception):
|
|
|
39
39
|
class TaskBase:
|
|
40
40
|
def __init__(self, data: Dict[str, Any], options: Dict[str, Any]):
|
|
41
41
|
self.global_options_schema: Dict[Any, Any] = {}
|
|
42
|
-
self.global_options_values: Dict[str, Any] =
|
|
42
|
+
self.global_options_values: Dict[str, Any] = options
|
|
43
43
|
|
|
44
44
|
self.task_schema: Dict[Any, Any] = {}
|
|
45
45
|
self.task_default_values: Dict[str, Any] = {}
|
|
46
46
|
|
|
47
47
|
self._item_values = data
|
|
48
|
-
self._item_options = options
|
|
49
48
|
|
|
50
49
|
# Variables
|
|
51
50
|
self.values: Dict[str, Any] = {}
|
|
@@ -59,13 +58,14 @@ class TaskBase:
|
|
|
59
58
|
# Options
|
|
60
59
|
self.options = {}
|
|
61
60
|
self.options.update(deepcopy(self.global_options_values))
|
|
62
|
-
|
|
61
|
+
|
|
63
62
|
schema = Schema(self.global_options_schema)
|
|
64
63
|
schema.validate(self.options)
|
|
65
64
|
|
|
66
65
|
# Data
|
|
67
66
|
self.values = {}
|
|
68
67
|
self.values.update(deepcopy(self.task_default_values))
|
|
68
|
+
self.values.update(deepcopy(self.options))
|
|
69
69
|
self.values.update(deepcopy(self._item_values))
|
|
70
70
|
schema = Schema(self.task_schema)
|
|
71
71
|
schema.validate(self.values)
|
|
@@ -98,6 +98,12 @@ class TaskBatchFetch(TaskBase):
|
|
|
98
98
|
"""Plugin downloader base class."""
|
|
99
99
|
|
|
100
100
|
def __init__(self, data: Dict[str, Any], options: Dict[str, Any]):
|
|
101
|
+
new_options = {"exec_before": [],
|
|
102
|
+
"exec_after": [],
|
|
103
|
+
"ignore_untracked": []}
|
|
104
|
+
new_options.update(options)
|
|
105
|
+
options = new_options
|
|
106
|
+
|
|
101
107
|
super().__init__(data=data, options=options)
|
|
102
108
|
self.indent = 4
|
|
103
109
|
self.indent_spaces = " " * self.indent
|
|
@@ -107,7 +113,7 @@ class TaskBatchFetch(TaskBase):
|
|
|
107
113
|
self.global_options_schema: Dict[Any, Any] = {
|
|
108
114
|
Optional("exec_before"): Or([str], str),
|
|
109
115
|
Optional("exec_after"): Or([str], str),
|
|
110
|
-
Optional("
|
|
116
|
+
Optional("ignore_untracked"): Or([str], str),
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
self.task_schema: Dict[Any, Any] = {
|
|
@@ -116,12 +122,9 @@ class TaskBatchFetch(TaskBase):
|
|
|
116
122
|
|
|
117
123
|
Optional("exec_before"): Or([str], str),
|
|
118
124
|
Optional("exec_after"): Or([str], str),
|
|
119
|
-
}
|
|
120
125
|
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
"exec_after": [],
|
|
124
|
-
"ignore_untracked_paths": [],
|
|
126
|
+
# Global options (unused locally)
|
|
127
|
+
Optional("ignore_untracked"): Or([str], str),
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
self.task_default_values: Dict[str, Any] = {
|
|
@@ -151,8 +154,8 @@ class TaskBatchFetch(TaskBase):
|
|
|
151
154
|
return
|
|
152
155
|
|
|
153
156
|
# Global
|
|
154
|
-
cmd = self.
|
|
155
|
-
if "exec_before" in self.
|
|
157
|
+
cmd = self.global_options_values["exec_before"] \
|
|
158
|
+
if "exec_before" in self.global_options_values else None
|
|
156
159
|
if cmd:
|
|
157
160
|
self._local_task_exec(cmd, cwd=str(cwd))
|
|
158
161
|
|
|
@@ -167,8 +170,8 @@ class TaskBatchFetch(TaskBase):
|
|
|
167
170
|
return
|
|
168
171
|
|
|
169
172
|
# Local
|
|
170
|
-
cmd = self.
|
|
171
|
-
if "exec_after" in self.
|
|
173
|
+
cmd = self.global_options_values["exec_after"] \
|
|
174
|
+
if "exec_after" in self.global_options_values else None
|
|
172
175
|
if cmd:
|
|
173
176
|
self._local_task_exec(cmd, cwd=str(cwd))
|
|
174
177
|
|
|
@@ -47,7 +47,7 @@ class BatchFetchCli:
|
|
|
47
47
|
self.cfg: dict = {}
|
|
48
48
|
self.check_untracked = check_untracked
|
|
49
49
|
self.tracked_paths: Dict[Path, Set[str]] = {}
|
|
50
|
-
self.
|
|
50
|
+
self.ignore_untracked: Set[Path] = set()
|
|
51
51
|
self.verbose = verbose
|
|
52
52
|
self.max_workers = max_workers
|
|
53
53
|
self.dirs_relative_to_batchfetch: Set[str] = set()
|
|
@@ -100,20 +100,20 @@ class BatchFetchCli:
|
|
|
100
100
|
file=sys.stderr)
|
|
101
101
|
sys.exit(1)
|
|
102
102
|
|
|
103
|
-
self.
|
|
104
|
-
self.
|
|
103
|
+
self.ignore_untracked.add(Path(path).absolute())
|
|
104
|
+
self.ignore_untracked.add(Path(path).resolve())
|
|
105
105
|
untracked_paths = None
|
|
106
106
|
if "options" in yaml_dict and \
|
|
107
|
-
"
|
|
107
|
+
"ignore_untracked" in yaml_dict["options"]:
|
|
108
108
|
untracked_paths = \
|
|
109
|
-
yaml_dict["options"]["
|
|
109
|
+
yaml_dict["options"]["ignore_untracked"]
|
|
110
110
|
|
|
111
111
|
if isinstance(untracked_paths, str):
|
|
112
112
|
untracked_paths = [untracked_paths]
|
|
113
113
|
|
|
114
114
|
if untracked_paths:
|
|
115
115
|
for ignore_untracked_path in untracked_paths:
|
|
116
|
-
self.
|
|
116
|
+
self.ignore_untracked.add(
|
|
117
117
|
Path(ignore_untracked_path).absolute()
|
|
118
118
|
)
|
|
119
119
|
|
|
@@ -277,7 +277,7 @@ class BatchFetchCli:
|
|
|
277
277
|
actual_filenames = {file.name for file in tracked_dir.iterdir()}
|
|
278
278
|
for filename in actual_filenames - tracked_filenames:
|
|
279
279
|
full_path = tracked_dir / filename
|
|
280
|
-
if full_path in self.
|
|
280
|
+
if full_path in self.ignore_untracked:
|
|
281
281
|
continue
|
|
282
282
|
|
|
283
283
|
untracked_paths.add(full_path)
|
|
@@ -291,7 +291,7 @@ class BatchFetchCli:
|
|
|
291
291
|
"\n")
|
|
292
292
|
err_str += ("The paths above are not managed by batchfetch."
|
|
293
293
|
" To retain them, add them to the "
|
|
294
|
-
"options.
|
|
294
|
+
"options.ignore_untracked list, using either "
|
|
295
295
|
"relative or absolute paths")
|
|
296
296
|
raise BatchFetchError(err_str)
|
|
297
297
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: batchfetch
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.2
|
|
4
4
|
Summary: Efficiently clone and pull multiple Git repositories.
|
|
5
5
|
Home-page: https://github.com/jamescherti/batchfetch
|
|
6
6
|
Author: James Cherti
|
|
@@ -117,13 +117,13 @@ The parent directory of the "path:" value defines the managed directory, where t
|
|
|
117
117
|
|
|
118
118
|
For example, if the "path:" value is `file/my-project`, the managed directory will be `file/`. Any file within `file/` that is not managed by batchfetch will be considered an untracked file.
|
|
119
119
|
|
|
120
|
-
When *batchfetch* encounters an untracked file, it displays an error message to inform users about paths that are not managed by the system. The message provides clear instructions on how to handle these paths by adding them to the `options.
|
|
120
|
+
When *batchfetch* encounters an untracked file, it displays an error message to inform users about paths that are not managed by the system. The message provides clear instructions on how to handle these paths by adding them to the `options.ignore_untracked` list, enabling users to manage untracked files effectively.
|
|
121
121
|
|
|
122
122
|
Here is an example of a *batchfetch.yaml* file that enables *batchfetch* to accept a list of untracked files:
|
|
123
123
|
|
|
124
124
|
``` yaml
|
|
125
125
|
options:
|
|
126
|
-
|
|
126
|
+
ignore_untracked:
|
|
127
127
|
- ./test
|
|
128
128
|
- /absolute/path
|
|
129
129
|
- ../relative/path
|
|
@@ -132,7 +132,7 @@ tasks:
|
|
|
132
132
|
- git: https://github.com/user/project
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
By default, *batchfetch.yaml* is the only untracked file that is ignored. The user does not need to add it to the *
|
|
135
|
+
By default, *batchfetch.yaml* is the only untracked file that is ignored. The user does not need to add it to the *ignore_untracked* option.
|
|
136
136
|
|
|
137
137
|
### How is the Git local paths handled?
|
|
138
138
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|