pygitpub 0.0.44__tar.gz → 0.0.46__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.
- {pygitpub-0.0.44 → pygitpub-0.0.46}/PKG-INFO +2 -2
- {pygitpub-0.0.44 → pygitpub-0.0.46}/README.rst +1 -1
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub/configs.py +5 -1
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub/main.py +13 -3
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub/static.py +1 -1
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub/utils.py +6 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub.egg-info/PKG-INFO +2 -2
- {pygitpub-0.0.44 → pygitpub-0.0.46}/setup.py +1 -1
- {pygitpub-0.0.44 → pygitpub-0.0.46}/LICENSE +0 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub/__init__.py +0 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub.egg-info/SOURCES.txt +0 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub.egg-info/dependency_links.txt +0 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub.egg-info/entry_points.txt +0 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub.egg-info/requires.txt +0 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/pygitpub.egg-info/top_level.txt +0 -0
- {pygitpub-0.0.44 → pygitpub-0.0.46}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pygitpub
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.46
|
|
4
4
|
Summary: Pygitpub will help you work with github
|
|
5
5
|
Home-page: https://veltzer.github.io/pygitpub
|
|
6
6
|
Download-URL: https://github.com/veltzer/pygitpub
|
|
@@ -42,6 +42,6 @@ project website: https://veltzer.github.io/pygitpub
|
|
|
42
42
|
|
|
43
43
|
author: Mark Veltzer
|
|
44
44
|
|
|
45
|
-
version: 0.0.
|
|
45
|
+
version: 0.0.46
|
|
46
46
|
|
|
47
47
|
Mark Veltzer <mark.veltzer@gmail.com>, Copyright © 2022, 2023
|
|
@@ -33,7 +33,7 @@ class ConfigAlgo(Config):
|
|
|
33
33
|
)
|
|
34
34
|
fork = ParamCreator.create_bool(
|
|
35
35
|
help_string="Include forks?",
|
|
36
|
-
default=
|
|
36
|
+
default=True,
|
|
37
37
|
)
|
|
38
38
|
dryrun = ParamCreator.create_bool(
|
|
39
39
|
help_string="Do a try run?",
|
|
@@ -43,6 +43,10 @@ class ConfigAlgo(Config):
|
|
|
43
43
|
help_string="Only include repos owned by this owner (None for dont mind)",
|
|
44
44
|
default=None,
|
|
45
45
|
)
|
|
46
|
+
show_extra = ParamCreator.create_bool(
|
|
47
|
+
help_string="Show extra git repos lygin around?",
|
|
48
|
+
default=True,
|
|
49
|
+
)
|
|
46
50
|
|
|
47
51
|
|
|
48
52
|
class ConfigOutput(Config):
|
|
@@ -13,7 +13,7 @@ from pytconf import register_main, config_arg_parse_and_launch, register_endpoin
|
|
|
13
13
|
import github
|
|
14
14
|
from pygitpub.configs import ConfigGithub, ConfigOutput, ConfigAlgo
|
|
15
15
|
import pygitpub.static
|
|
16
|
-
from pygitpub.utils import delete
|
|
16
|
+
from pygitpub.utils import delete, get_all_git_repos
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def yield_repos():
|
|
@@ -189,15 +189,16 @@ def pull_all() -> None:
|
|
|
189
189
|
description="Pull all projects from github",
|
|
190
190
|
configs=[
|
|
191
191
|
ConfigGithub,
|
|
192
|
+
ConfigAlgo,
|
|
192
193
|
],
|
|
193
194
|
)
|
|
194
195
|
def clone_all() -> None:
|
|
196
|
+
all_repo_folders = set()
|
|
195
197
|
for repo in yield_repos():
|
|
196
198
|
owner = repo.owner.login
|
|
197
|
-
if not os.path.isdir(owner):
|
|
198
|
-
os.mkdir(owner)
|
|
199
199
|
project = repo.name
|
|
200
200
|
folder = os.path.join(owner, repo.name)
|
|
201
|
+
all_repo_folders.add(folder)
|
|
201
202
|
# print(f"considering [{project}] from [{repo.ssh_url}]...")
|
|
202
203
|
if os.path.isfile(folder):
|
|
203
204
|
# print(f"skipping [{folder}] as it is not to be cloned...")
|
|
@@ -208,6 +209,8 @@ def clone_all() -> None:
|
|
|
208
209
|
if ConfigAlgo.dryrun:
|
|
209
210
|
continue
|
|
210
211
|
print(f"cloning [{owner}:{project}] from [{repo.ssh_url}] to [{folder}]")
|
|
212
|
+
if not os.path.isdir(owner):
|
|
213
|
+
os.mkdir(owner)
|
|
211
214
|
subprocess.check_call(
|
|
212
215
|
[
|
|
213
216
|
"git",
|
|
@@ -218,6 +221,13 @@ def clone_all() -> None:
|
|
|
218
221
|
stdout=subprocess.DEVNULL,
|
|
219
222
|
stderr=subprocess.DEVNULL,
|
|
220
223
|
)
|
|
224
|
+
if ConfigAlgo.show_extra:
|
|
225
|
+
disk_repos = get_all_git_repos()
|
|
226
|
+
extra_repos = disk_repos - all_repo_folders
|
|
227
|
+
if extra_repos:
|
|
228
|
+
print("extra repos follow:")
|
|
229
|
+
for extra_repo in extra_repos:
|
|
230
|
+
print(extra_repo)
|
|
221
231
|
|
|
222
232
|
|
|
223
233
|
@register_endpoint(
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
|
+
import os.path
|
|
4
|
+
import glob
|
|
3
5
|
|
|
4
6
|
from pygitpub import LOGGER_NAME
|
|
5
7
|
|
|
@@ -22,3 +24,7 @@ def delete(workflow_run):
|
|
|
22
24
|
# pylint: disable=protected-access
|
|
23
25
|
status, _, _ = workflow_run._requester.requestJson("DELETE", workflow_run.url)
|
|
24
26
|
return status == 204
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_all_git_repos() -> set[str]:
|
|
30
|
+
return {os.path.dirname(x) for x in glob.glob("*/*/.git")}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pygitpub
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.46
|
|
4
4
|
Summary: Pygitpub will help you work with github
|
|
5
5
|
Home-page: https://veltzer.github.io/pygitpub
|
|
6
6
|
Download-URL: https://github.com/veltzer/pygitpub
|
|
@@ -42,6 +42,6 @@ project website: https://veltzer.github.io/pygitpub
|
|
|
42
42
|
|
|
43
43
|
author: Mark Veltzer
|
|
44
44
|
|
|
45
|
-
version: 0.0.
|
|
45
|
+
version: 0.0.46
|
|
46
46
|
|
|
47
47
|
Mark Veltzer <mark.veltzer@gmail.com>, Copyright © 2022, 2023
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|