github-archive 6.1.1__tar.gz → 6.2.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.
Files changed (28) hide show
  1. {github-archive-6.1.1 → github_archive-6.2.0}/PKG-INFO +23 -3
  2. github_archive-6.2.0/github_archive/_version.py +1 -0
  3. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/archive.py +4 -4
  4. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/constants.py +1 -1
  5. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/gists.py +15 -2
  6. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive.egg-info/PKG-INFO +23 -3
  7. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive.egg-info/requires.txt +5 -6
  8. {github-archive-6.1.1 → github_archive-6.2.0}/pyproject.toml +3 -0
  9. {github-archive-6.1.1 → github_archive-6.2.0}/setup.py +5 -6
  10. {github-archive-6.1.1 → github_archive-6.2.0}/test/unit/test_gists.py +7 -2
  11. github-archive-6.1.1/github_archive/_version.py +0 -1
  12. {github-archive-6.1.1 → github_archive-6.2.0}/LICENSE +0 -0
  13. {github-archive-6.1.1 → github_archive-6.2.0}/README.md +0 -0
  14. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/__init__.py +0 -0
  15. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/cli.py +0 -0
  16. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/logger.py +0 -0
  17. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/py.typed +0 -0
  18. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive/repos.py +0 -0
  19. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive.egg-info/SOURCES.txt +0 -0
  20. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive.egg-info/dependency_links.txt +0 -0
  21. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive.egg-info/entry_points.txt +0 -0
  22. {github-archive-6.1.1 → github_archive-6.2.0}/github_archive.egg-info/top_level.txt +0 -0
  23. {github-archive-6.1.1 → github_archive-6.2.0}/setup.cfg +0 -0
  24. {github-archive-6.1.1 → github_archive-6.2.0}/test/unit/__init__.py +0 -0
  25. {github-archive-6.1.1 → github_archive-6.2.0}/test/unit/conftest.py +0 -0
  26. {github-archive-6.1.1 → github_archive-6.2.0}/test/unit/test_archive.py +0 -0
  27. {github-archive-6.1.1 → github_archive-6.2.0}/test/unit/test_logger.py +0 -0
  28. {github-archive-6.1.1 → github_archive-6.2.0}/test/unit/test_repos.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: github-archive
3
- Version: 6.1.1
3
+ Version: 6.2.0
4
4
  Summary: A powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.
5
5
  Home-page: http://github.com/justintime50/github-archive
6
6
  Author: Justintime50
@@ -10,8 +10,28 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.8, <4
12
12
  Description-Content-Type: text/markdown
13
- Provides-Extra: dev
14
13
  License-File: LICENSE
14
+ Requires-Dist: PyGithub>=1.59.0
15
+ Requires-Dist: woodchips==1.*
16
+ Provides-Extra: dev
17
+ Requires-Dist: bandit==1.7.*; extra == "dev"
18
+ Requires-Dist: black==24.*; extra == "dev"
19
+ Requires-Dist: build==1.1.*; extra == "dev"
20
+ Requires-Dist: flake8==7.*; extra == "dev"
21
+ Requires-Dist: isort==5.*; extra == "dev"
22
+ Requires-Dist: mypy==1.11.*; extra == "dev"
23
+ Requires-Dist: pytest==8.*; extra == "dev"
24
+ Requires-Dist: pytest-cov==4.*; extra == "dev"
25
+ Dynamic: author
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: license
31
+ Dynamic: provides-extra
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
34
+ Dynamic: summary
15
35
 
16
36
  <div align="center">
17
37
 
@@ -0,0 +1 @@
1
+ __version__ = "6.2.0"
@@ -81,7 +81,7 @@ class GithubArchive:
81
81
  self.include = include.lower().split(',') if include else ''
82
82
  self.exclude = exclude.lower().split(',') if exclude else ''
83
83
  self.forks = forks
84
- self.location = location
84
+ self.location = os.path.expanduser(location)
85
85
  self.use_https = use_https
86
86
  self.timeout = timeout
87
87
  self.threads = threads
@@ -146,7 +146,7 @@ class GithubArchive:
146
146
  logger.info('# Pulling changes to user repos...')
147
147
  _ = iterate_repos_to_archive(self, user_repos, PULL_OPERATION)
148
148
  if self.fork:
149
- logger.info('# Forking starred repos...')
149
+ logger.info('# Forking user repos...')
150
150
  iterate_repos_to_fork(user_repos)
151
151
 
152
152
  # Orgs
@@ -166,7 +166,7 @@ class GithubArchive:
166
166
  logger.info('# Pulling changes to org repos...')
167
167
  _ = iterate_repos_to_archive(self, org_repos, PULL_OPERATION)
168
168
  if self.fork:
169
- logger.info('# Forking starred repos...')
169
+ logger.info('# Forking org repos...')
170
170
  iterate_repos_to_fork(org_repos)
171
171
 
172
172
  # Stars
@@ -212,7 +212,7 @@ class GithubArchive:
212
212
  _ = iterate_gists_to_archive(self, gists, PULL_OPERATION)
213
213
  if self.fork:
214
214
  logger.info('# Forking gists...')
215
- iterate_gists_to_fork(gists)
215
+ iterate_gists_to_fork(self, gists)
216
216
 
217
217
  if failed_gist_dirs:
218
218
  logger.info('Cleaning up gists...')
@@ -3,7 +3,7 @@ from typing import Literal
3
3
 
4
4
 
5
5
  DEFAULT_BASE_URL = 'https://api.github.com'
6
- DEFAULT_LOCATION = os.path.expanduser(os.path.join('~', 'github-archive'))
6
+ DEFAULT_LOCATION = os.path.join('~', 'github-archive')
7
7
  DEFAULT_NUM_THREADS = 10
8
8
  DEFAULT_TIMEOUT = 300
9
9
 
@@ -62,10 +62,23 @@ def view_gists(gists: List[Gist.Gist]):
62
62
  logger.info(gist_id)
63
63
 
64
64
 
65
- def iterate_gists_to_fork(gists: List[Gist.Gist]):
65
+ def iterate_gists_to_fork(github_archive: GithubArchive, gists: List[Gist.Gist]) -> List[Optional[str]]:
66
66
  """Iterates through a list of gists and attempts to fork them."""
67
+ pool = ThreadPoolExecutor(github_archive.threads)
68
+ thread_list = []
69
+
67
70
  for gist in gists:
68
- _fork_gist(gist)
71
+ thread_list.append(
72
+ pool.submit(
73
+ _fork_gist,
74
+ gist=gist,
75
+ )
76
+ )
77
+
78
+ wait(thread_list, return_when=ALL_COMPLETED)
79
+ failed_gists = [gist.result() for gist in thread_list if gist.result()]
80
+
81
+ return failed_gists
69
82
 
70
83
 
71
84
  def _fork_gist(gist: Gist.Gist):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: github-archive
3
- Version: 6.1.1
3
+ Version: 6.2.0
4
4
  Summary: A powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.
5
5
  Home-page: http://github.com/justintime50/github-archive
6
6
  Author: Justintime50
@@ -10,8 +10,28 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.8, <4
12
12
  Description-Content-Type: text/markdown
13
- Provides-Extra: dev
14
13
  License-File: LICENSE
14
+ Requires-Dist: PyGithub>=1.59.0
15
+ Requires-Dist: woodchips==1.*
16
+ Provides-Extra: dev
17
+ Requires-Dist: bandit==1.7.*; extra == "dev"
18
+ Requires-Dist: black==24.*; extra == "dev"
19
+ Requires-Dist: build==1.1.*; extra == "dev"
20
+ Requires-Dist: flake8==7.*; extra == "dev"
21
+ Requires-Dist: isort==5.*; extra == "dev"
22
+ Requires-Dist: mypy==1.11.*; extra == "dev"
23
+ Requires-Dist: pytest==8.*; extra == "dev"
24
+ Requires-Dist: pytest-cov==4.*; extra == "dev"
25
+ Dynamic: author
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: license
31
+ Dynamic: provides-extra
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
34
+ Dynamic: summary
15
35
 
16
36
  <div align="center">
17
37
 
@@ -3,11 +3,10 @@ woodchips==1.*
3
3
 
4
4
  [dev]
5
5
  bandit==1.7.*
6
- black==23.*
7
- build==0.10.*
8
- flake8==6.*
6
+ black==24.*
7
+ build==1.1.*
8
+ flake8==7.*
9
9
  isort==5.*
10
- mypy==1.5.*
11
- pytest==7.*
10
+ mypy==1.11.*
11
+ pytest==8.*
12
12
  pytest-cov==4.*
13
- twine==4.*
@@ -13,3 +13,6 @@ sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
13
13
  lines_after_imports = 2
14
14
  include_trailing_comma = true
15
15
  use_parentheses = true
16
+
17
+ [tool.mypy]
18
+ disable_error_code = "import-untyped"
@@ -21,14 +21,13 @@ REQUIREMENTS = [
21
21
 
22
22
  DEV_REQUIREMENTS = [
23
23
  'bandit == 1.7.*',
24
- 'black == 23.*',
25
- 'build == 0.10.*',
26
- 'flake8 == 6.*',
24
+ 'black == 24.*',
25
+ 'build == 1.1.*',
26
+ 'flake8 == 7.*',
27
27
  'isort == 5.*',
28
- 'mypy == 1.5.*',
29
- 'pytest == 7.*',
28
+ 'mypy == 1.11.*',
29
+ 'pytest == 8.*',
30
30
  'pytest-cov == 4.*',
31
- 'twine == 4.*',
32
31
  ]
33
32
 
34
33
  setuptools.setup(
@@ -92,10 +92,15 @@ def test_view_gists(mock_logger, mock_git_asset):
92
92
  mock_logger.assert_called_with('mock_username/123')
93
93
 
94
94
 
95
+ @patch('github_archive.archive.Github')
95
96
  @patch('github_archive.gists._fork_gist')
96
- def test_iterate_gists_to_fork(mock_fork_gist):
97
+ def test_iterate_gists_to_fork(mock_fork_gist, mock_github_instance):
97
98
  gist = MagicMock(spec=Gist.Gist)
98
- iterate_gists_to_fork([gist])
99
+ github_archive = GithubArchive(
100
+ gists='mock_username',
101
+ )
102
+
103
+ iterate_gists_to_fork(github_archive, [gist])
99
104
 
100
105
  mock_fork_gist.assert_called_once()
101
106
 
@@ -1 +0,0 @@
1
- __version__ = "6.1.1"
File without changes
File without changes
File without changes