batchfetch 1.1.5__tar.gz → 1.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.
- {batchfetch-1.1.5/batchfetch.egg-info → batchfetch-1.1.6}/PKG-INFO +1 -5
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch/batchfetch_git.py +16 -14
- {batchfetch-1.1.5 → batchfetch-1.1.6/batchfetch.egg-info}/PKG-INFO +1 -5
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch.egg-info/SOURCES.txt +1 -6
- {batchfetch-1.1.5 → batchfetch-1.1.6}/setup.py +1 -1
- batchfetch-1.1.5/.gitignore +0 -138
- batchfetch-1.1.5/run_tests.sh +0 -23
- batchfetch-1.1.5/tests/data/test-md5sum.txt +0 -3
- batchfetch-1.1.5/tests/data/test-run_simple.sh +0 -5
- batchfetch-1.1.5/tests/test_helpers.py +0 -56
- {batchfetch-1.1.5 → batchfetch-1.1.6}/LICENSE +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/README.md +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch/__init__.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch/batchfetch_base.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch/batchfetch_cli.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch/helpers.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch.egg-info/dependency_links.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch.egg-info/entry_points.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch.egg-info/requires.txt +1 -1
- {batchfetch-1.1.5 → batchfetch-1.1.6}/batchfetch.egg-info/top_level.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: batchfetch
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.6
|
|
4
4
|
Summary: Efficiently clone and pull multiple Git repositories.
|
|
5
5
|
Home-page: https://github.com/jamescherti/batchfetch
|
|
6
6
|
Author: James Cherti
|
|
@@ -17,10 +17,6 @@ Classifier: Topic :: Utilities
|
|
|
17
17
|
Requires-Python: >=3.6, <4
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: colorama
|
|
21
|
-
Requires-Dist: schema
|
|
22
|
-
Requires-Dist: setproctitle
|
|
23
|
-
Requires-Dist: PyYAML
|
|
24
20
|
|
|
25
21
|
# Batchfetch - Efficiently clone or pull multiple Git repositories in parallel
|
|
26
22
|
|
|
@@ -128,7 +128,7 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
128
128
|
# Update
|
|
129
129
|
if self.git_local_dir.is_dir():
|
|
130
130
|
# Pre exec
|
|
131
|
-
self.
|
|
131
|
+
self._update_current_branch_name()
|
|
132
132
|
self._repo_fix_remote_origin()
|
|
133
133
|
self._run_pre_exec(cwd=self.git_local_dir)
|
|
134
134
|
|
|
@@ -173,14 +173,16 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
173
173
|
return ""
|
|
174
174
|
return output
|
|
175
175
|
|
|
176
|
-
def
|
|
176
|
+
def _update_current_branch_name(self):
|
|
177
177
|
try:
|
|
178
|
+
# This returns the branch name
|
|
178
179
|
stdout, _ = run_simple(
|
|
179
180
|
["git", "symbolic-ref", "--short", "HEAD"],
|
|
180
181
|
env=self.env,
|
|
181
182
|
cwd=self.git_local_dir,
|
|
182
183
|
)
|
|
183
|
-
self.current_branch = stdout[0]
|
|
184
|
+
self.current_branch = stdout[0].strip()
|
|
185
|
+
self.is_branch = True
|
|
184
186
|
except (IndexError, subprocess.CalledProcessError):
|
|
185
187
|
# Not a symbolic ref
|
|
186
188
|
self.current_branch = None
|
|
@@ -191,10 +193,9 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
191
193
|
# directly to a commit. You need to resolve it to the
|
|
192
194
|
# commit it points to. Using `git rev-parse
|
|
193
195
|
# <tagname>^{commit}` allows getting the right reference.
|
|
194
|
-
commit_ref = self._git_tags(
|
|
196
|
+
commit_ref = self._git_tags(self["reference"] +
|
|
195
197
|
"^{commit}")[0]
|
|
196
|
-
self.branch_commit_ref = commit_ref.strip()
|
|
197
|
-
self.is_branch = True
|
|
198
|
+
self.branch_commit_ref = commit_ref.strip()
|
|
198
199
|
except GitReferenceDoesNotExist:
|
|
199
200
|
pass
|
|
200
201
|
|
|
@@ -233,11 +234,13 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
233
234
|
|
|
234
235
|
# Merge
|
|
235
236
|
do_git_pull = self["git_pull"]
|
|
236
|
-
if
|
|
237
|
+
if self.is_branch:
|
|
238
|
+
do_git_pull = True
|
|
239
|
+
elif not self["reference"]:
|
|
237
240
|
do_git_pull = True
|
|
238
241
|
self.add_output(self.indent_spaces +
|
|
239
|
-
|
|
240
|
-
|
|
242
|
+
"[INFO] Git fetch origin reason: " +
|
|
243
|
+
"No 'reference:' specified\n")
|
|
241
244
|
else:
|
|
242
245
|
do_git_pull = False
|
|
243
246
|
commit_ref = None
|
|
@@ -246,7 +249,7 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
246
249
|
# Check if the reference such as
|
|
247
250
|
# 0560fe21d1173b2221fd8c600fab818f7eecbad4 exist
|
|
248
251
|
commit_ref = self._git_tags(self["reference"])[0]
|
|
249
|
-
commit_ref = commit_ref.strip()
|
|
252
|
+
commit_ref = commit_ref.strip()
|
|
250
253
|
except GitReferenceDoesNotExist:
|
|
251
254
|
pass
|
|
252
255
|
|
|
@@ -280,7 +283,7 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
280
283
|
# # <tagname>^{commit}` allows getting the right
|
|
281
284
|
# # reference.
|
|
282
285
|
# commit_ref_head = self._git_tags("HEAD^{commit}")[0]
|
|
283
|
-
# commit_ref_head = commit_ref_head.strip()
|
|
286
|
+
# commit_ref_head = commit_ref_head.strip()
|
|
284
287
|
# except GitReferenceDoesNotExist:
|
|
285
288
|
# # HEAD is detached
|
|
286
289
|
# commit_ref_head = None
|
|
@@ -411,8 +414,7 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
411
414
|
# Also check the commit reference in case
|
|
412
415
|
# branch is a commit reference instead of a tag
|
|
413
416
|
try:
|
|
414
|
-
git_ref_branch = self._git_tags("
|
|
415
|
-
self["reference"] +
|
|
417
|
+
git_ref_branch = self._git_tags(self["reference"] +
|
|
416
418
|
"^{commit}")[0]
|
|
417
419
|
except GitReferenceDoesNotExist as err:
|
|
418
420
|
raise BatchFetchError(f"The branch '{self['reference']}' "
|
|
@@ -430,7 +432,7 @@ class BatchFetchGit(TaskBatchFetch):
|
|
|
430
432
|
branch_changed = True
|
|
431
433
|
|
|
432
434
|
# Read branch again
|
|
433
|
-
self.
|
|
435
|
+
self._update_current_branch_name()
|
|
434
436
|
|
|
435
437
|
return branch_changed
|
|
436
438
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: batchfetch
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.6
|
|
4
4
|
Summary: Efficiently clone and pull multiple Git repositories.
|
|
5
5
|
Home-page: https://github.com/jamescherti/batchfetch
|
|
6
6
|
Author: James Cherti
|
|
@@ -17,10 +17,6 @@ Classifier: Topic :: Utilities
|
|
|
17
17
|
Requires-Python: >=3.6, <4
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: colorama
|
|
21
|
-
Requires-Dist: schema
|
|
22
|
-
Requires-Dist: setproctitle
|
|
23
|
-
Requires-Dist: PyYAML
|
|
24
20
|
|
|
25
21
|
# Batchfetch - Efficiently clone or pull multiple Git repositories in parallel
|
|
26
22
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
.gitignore
|
|
2
1
|
LICENSE
|
|
3
2
|
README.md
|
|
4
|
-
run_tests.sh
|
|
5
3
|
setup.py
|
|
6
4
|
batchfetch/__init__.py
|
|
7
5
|
batchfetch/batchfetch_base.py
|
|
@@ -13,7 +11,4 @@ batchfetch.egg-info/SOURCES.txt
|
|
|
13
11
|
batchfetch.egg-info/dependency_links.txt
|
|
14
12
|
batchfetch.egg-info/entry_points.txt
|
|
15
13
|
batchfetch.egg-info/requires.txt
|
|
16
|
-
batchfetch.egg-info/top_level.txt
|
|
17
|
-
tests/test_helpers.py
|
|
18
|
-
tests/data/test-md5sum.txt
|
|
19
|
-
tests/data/test-run_simple.sh
|
|
14
|
+
batchfetch.egg-info/top_level.txt
|
batchfetch-1.1.5/.gitignore
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
# Byte-compiled / optimized / DLL files
|
|
2
|
-
__pycache__/
|
|
3
|
-
*.py[cod]
|
|
4
|
-
*$py.class
|
|
5
|
-
|
|
6
|
-
# C extensions
|
|
7
|
-
*.so
|
|
8
|
-
|
|
9
|
-
# Distribution / packaging
|
|
10
|
-
.Python
|
|
11
|
-
build/
|
|
12
|
-
develop-eggs/
|
|
13
|
-
dist/
|
|
14
|
-
downloads/
|
|
15
|
-
eggs/
|
|
16
|
-
.eggs/
|
|
17
|
-
lib/
|
|
18
|
-
lib64/
|
|
19
|
-
parts/
|
|
20
|
-
sdist/
|
|
21
|
-
var/
|
|
22
|
-
wheels/
|
|
23
|
-
share/python-wheels/
|
|
24
|
-
*.egg-info/
|
|
25
|
-
.installed.cfg
|
|
26
|
-
*.egg
|
|
27
|
-
MANIFEST
|
|
28
|
-
|
|
29
|
-
# PyInstaller
|
|
30
|
-
# Usually these files are written by a python script from a template
|
|
31
|
-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
-
*.manifest
|
|
33
|
-
*.spec
|
|
34
|
-
|
|
35
|
-
# Installer logs
|
|
36
|
-
pip-log.txt
|
|
37
|
-
pip-delete-this-directory.txt
|
|
38
|
-
|
|
39
|
-
# Unit test / coverage reports
|
|
40
|
-
htmlcov/
|
|
41
|
-
.tox/
|
|
42
|
-
.nox/
|
|
43
|
-
.coverage
|
|
44
|
-
.coverage.*
|
|
45
|
-
.cache
|
|
46
|
-
nosetests.xml
|
|
47
|
-
coverage.xml
|
|
48
|
-
*.cover
|
|
49
|
-
*.py,cover
|
|
50
|
-
.hypothesis/
|
|
51
|
-
.pytest_cache/
|
|
52
|
-
cover/
|
|
53
|
-
|
|
54
|
-
# Translations
|
|
55
|
-
*.mo
|
|
56
|
-
*.pot
|
|
57
|
-
|
|
58
|
-
# Django stuff:
|
|
59
|
-
*.log
|
|
60
|
-
local_settings.py
|
|
61
|
-
db.sqlite3
|
|
62
|
-
db.sqlite3-journal
|
|
63
|
-
|
|
64
|
-
# Flask stuff:
|
|
65
|
-
instance/
|
|
66
|
-
.webassets-cache
|
|
67
|
-
|
|
68
|
-
# Scrapy stuff:
|
|
69
|
-
.scrapy
|
|
70
|
-
|
|
71
|
-
# Sphinx documentation
|
|
72
|
-
docs/_build/
|
|
73
|
-
|
|
74
|
-
# PyBuilder
|
|
75
|
-
.pybuilder/
|
|
76
|
-
target/
|
|
77
|
-
|
|
78
|
-
# Jupyter Notebook
|
|
79
|
-
.ipynb_checkpoints
|
|
80
|
-
|
|
81
|
-
# IPython
|
|
82
|
-
profile_default/
|
|
83
|
-
ipython_config.py
|
|
84
|
-
|
|
85
|
-
# pyenv
|
|
86
|
-
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
-
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
-
# .python-version
|
|
89
|
-
|
|
90
|
-
# pipenv
|
|
91
|
-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
-
# install all needed dependencies.
|
|
95
|
-
#Pipfile.lock
|
|
96
|
-
|
|
97
|
-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
98
|
-
__pypackages__/
|
|
99
|
-
|
|
100
|
-
# Celery stuff
|
|
101
|
-
celerybeat-schedule
|
|
102
|
-
celerybeat.pid
|
|
103
|
-
|
|
104
|
-
# SageMath parsed files
|
|
105
|
-
*.sage.py
|
|
106
|
-
|
|
107
|
-
# Environments
|
|
108
|
-
.env
|
|
109
|
-
.venv
|
|
110
|
-
env/
|
|
111
|
-
venv/
|
|
112
|
-
ENV/
|
|
113
|
-
env.bak/
|
|
114
|
-
venv.bak/
|
|
115
|
-
|
|
116
|
-
# Spyder project settings
|
|
117
|
-
.spyderproject
|
|
118
|
-
.spyproject
|
|
119
|
-
|
|
120
|
-
# Rope project settings
|
|
121
|
-
.ropeproject
|
|
122
|
-
|
|
123
|
-
# mkdocs documentation
|
|
124
|
-
/site
|
|
125
|
-
|
|
126
|
-
# mypy
|
|
127
|
-
.mypy_cache/
|
|
128
|
-
.dmypy.json
|
|
129
|
-
dmypy.json
|
|
130
|
-
|
|
131
|
-
# Pyre type checker
|
|
132
|
-
.pyre/
|
|
133
|
-
|
|
134
|
-
# pytype static type analyzer
|
|
135
|
-
.pytype/
|
|
136
|
-
|
|
137
|
-
# Cython debug symbols
|
|
138
|
-
cython_debug/
|
batchfetch-1.1.5/run_tests.sh
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2024 James Cherti
|
|
4
|
-
# URL: https://github.com/jamescherti/batchfetch
|
|
5
|
-
#
|
|
6
|
-
# This program is free software: you can redistribute it and/or modify it under
|
|
7
|
-
# the terms of the GNU General Public License as published by the Free Software
|
|
8
|
-
# Foundation, either version 3 of the License, or (at your option) any later
|
|
9
|
-
# version.
|
|
10
|
-
#
|
|
11
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License along with
|
|
16
|
-
# this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
#
|
|
18
|
-
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
19
|
-
export PYTHONPATH="$(pwd)"
|
|
20
|
-
exec pytest -v -v --cov=batchfetch --cov=tests \
|
|
21
|
-
--cov-report=term \
|
|
22
|
-
--cov-report=html:htmlcov \
|
|
23
|
-
tests/test_*py
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2024 James Cherti
|
|
4
|
-
# URL: https://github.com/jamescherti/batchfetch
|
|
5
|
-
#
|
|
6
|
-
# This program is free software: you can redistribute it and/or modify it under
|
|
7
|
-
# the terms of the GNU General Public License as published by the Free Software
|
|
8
|
-
# Foundation, either version 3 of the License, or (at your option) any later
|
|
9
|
-
# version.
|
|
10
|
-
#
|
|
11
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License along with
|
|
16
|
-
# this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
#
|
|
18
|
-
"""Unit tests."""
|
|
19
|
-
|
|
20
|
-
from pathlib import Path
|
|
21
|
-
|
|
22
|
-
from batchfetch import helpers
|
|
23
|
-
|
|
24
|
-
DATA_PATH = Path(".").joinpath("tests", "data").absolute()
|
|
25
|
-
SCRIPT_RUN_SIMPLE = DATA_PATH / "test-run_simple.sh"
|
|
26
|
-
TEST_MD5SUM_FILE = DATA_PATH / "test-md5sum.txt"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def test_md5sum():
|
|
30
|
-
md5sum = helpers.md5sum(TEST_MD5SUM_FILE)
|
|
31
|
-
assert md5sum == "f31e127edc87a6aa2eb01b7d94d2ec58"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def test_run_simple():
|
|
35
|
-
# Stdout
|
|
36
|
-
stdout_lines, stderr_lines = helpers.run_simple(str(SCRIPT_RUN_SIMPLE))
|
|
37
|
-
assert stdout_lines == ['Test 1.',
|
|
38
|
-
'Test 2.',
|
|
39
|
-
'Test 3.']
|
|
40
|
-
assert stderr_lines == ['Test 3.']
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def test_indent_raw_output():
|
|
44
|
-
list_str = \
|
|
45
|
-
helpers.indent_raw_output(["Test 1.", "Test 2."])
|
|
46
|
-
|
|
47
|
-
assert list_str == [" Test 1.", " Test 2."]
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def test_run_indent():
|
|
51
|
-
stdout_lines, stderr_lines = helpers.run_indent(str(SCRIPT_RUN_SIMPLE))
|
|
52
|
-
assert stdout_lines == [f' [RUN] {str(SCRIPT_RUN_SIMPLE)}',
|
|
53
|
-
' Test 1.',
|
|
54
|
-
' Test 2.',
|
|
55
|
-
' Test 3.']
|
|
56
|
-
assert stderr_lines == [' Test 3.']
|
|
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
|