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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygitpub
3
- Version: 0.0.44
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.44
45
+ version: 0.0.46
46
46
 
47
47
  Mark Veltzer <mark.veltzer@gmail.com>, Copyright © 2022, 2023
@@ -12,6 +12,6 @@ project website: https://veltzer.github.io/pygitpub
12
12
 
13
13
  author: Mark Veltzer
14
14
 
15
- version: 0.0.44
15
+ version: 0.0.46
16
16
 
17
17
  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=False,
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,5 @@
1
1
  """ version which can be consumed from within the module """
2
- VERSION_STR = "0.0.44"
2
+ VERSION_STR = "0.0.46"
3
3
  DESCRIPTION = "Pygitpub will help you work with github"
4
4
  APP_NAME = "pygitpub"
5
5
  LOGGER_NAME = "pygitpub"
@@ -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.44
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.44
45
+ version: 0.0.46
46
46
 
47
47
  Mark Veltzer <mark.veltzer@gmail.com>, Copyright © 2022, 2023
@@ -9,7 +9,7 @@ def get_readme():
9
9
  setuptools.setup(
10
10
  # the first three fields are a must according to the documentation
11
11
  name="pygitpub",
12
- version="0.0.44",
12
+ version="0.0.46",
13
13
  packages=[
14
14
  "pygitpub",
15
15
  ],
File without changes
File without changes