github-backup 0.47.0__tar.gz → 0.48.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.
@@ -1,9 +1,82 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- 0.47.0 (2024-12-09)
4
+ 0.48.0 (2025-01-04)
5
5
  -------------------
6
6
  ------------------------
7
+ - Chore: reformat file to fix lint issues. [Jose Diaz-Gonzalez]
8
+ - Chore(deps): bump the python-packages group across 1 directory with 4
9
+ updates. [dependabot[bot]]
10
+
11
+ Bumps the python-packages group with 4 updates in the / directory: [charset-normalizer](https://github.com/jawah/charset_normalizer), [click](https://github.com/pallets/click), [keyring](https://github.com/jaraco/keyring) and [urllib3](https://github.com/urllib3/urllib3).
12
+
13
+
14
+ Updates `charset-normalizer` from 3.4.0 to 3.4.1
15
+ - [Release notes](https://github.com/jawah/charset_normalizer/releases)
16
+ - [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md)
17
+ - [Commits](https://github.com/jawah/charset_normalizer/compare/3.4.0...3.4.1)
18
+
19
+ Updates `click` from 8.1.7 to 8.1.8
20
+ - [Release notes](https://github.com/pallets/click/releases)
21
+ - [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst)
22
+ - [Commits](https://github.com/pallets/click/compare/8.1.7...8.1.8)
23
+
24
+ Updates `keyring` from 25.5.0 to 25.6.0
25
+ - [Release notes](https://github.com/jaraco/keyring/releases)
26
+ - [Changelog](https://github.com/jaraco/keyring/blob/main/NEWS.rst)
27
+ - [Commits](https://github.com/jaraco/keyring/compare/v25.5.0...v25.6.0)
28
+
29
+ Updates `urllib3` from 2.2.3 to 2.3.0
30
+ - [Release notes](https://github.com/urllib3/urllib3/releases)
31
+ - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
32
+ - [Commits](https://github.com/urllib3/urllib3/compare/2.2.3...2.3.0)
33
+
34
+ ---
35
+ updated-dependencies:
36
+ - dependency-name: charset-normalizer
37
+ dependency-type: direct:production
38
+ update-type: version-update:semver-patch
39
+ dependency-group: python-packages
40
+ - dependency-name: click
41
+ dependency-type: direct:production
42
+ update-type: version-update:semver-patch
43
+ dependency-group: python-packages
44
+ - dependency-name: keyring
45
+ dependency-type: direct:production
46
+ update-type: version-update:semver-minor
47
+ dependency-group: python-packages
48
+ - dependency-name: urllib3
49
+ dependency-type: direct:production
50
+ update-type: version-update:semver-minor
51
+ dependency-group: python-packages
52
+ ...
53
+ - Fix typo README.rst: --starred-gists that should be --gists. [Michael
54
+ D. Adams]
55
+ - Remove fixed release issue from known blocking errors. [Ethan White]
56
+
57
+ The issue with --release producing errors documented in #209 (the linked issue) and #234 appears to have been fixed in #257.
58
+
59
+ This change removes the associated warning from the README.
60
+ - Chore(deps): bump certifi in the python-packages group.
61
+ [dependabot[bot]]
62
+
63
+ Bumps the python-packages group with 1 update: [certifi](https://github.com/certifi/python-certifi).
64
+
65
+
66
+ Updates `certifi` from 2024.8.30 to 2024.12.14
67
+ - [Commits](https://github.com/certifi/python-certifi/compare/2024.08.30...2024.12.14)
68
+
69
+ ---
70
+ updated-dependencies:
71
+ - dependency-name: certifi
72
+ dependency-type: direct:production
73
+ update-type: version-update:semver-minor
74
+ dependency-group: python-packages
75
+ ...
76
+
77
+
78
+ 0.47.0 (2024-12-09)
79
+ -------------------
7
80
  - Detect empty HTTPS contexts. [John Doe]
8
81
 
9
82
  Some users are relying solely on the certifi package to provide their CA certs, as requests does this by default.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: github-backup
3
- Version: 0.47.0
3
+ Version: 0.48.0
4
4
  Summary: backup a github user or organization
5
5
  Home-page: http://github.com/josegonzalez/python-github-backup
6
6
  Author: Jose Diaz-Gonzalez
@@ -186,7 +186,7 @@ Customise the permissions for your use case, but for a personal account full bac
186
186
 
187
187
  **User permissions**: Read access to followers, starring, and watching.
188
188
 
189
- **Repository permissions**: Read access to code, commit statuses, issues, metadata, pages, pull requests, and repository hooks.
189
+ **Repository permissions**: Read access to contents, issues, metadata, pull requests, and webhooks.
190
190
 
191
191
 
192
192
  Prefer SSH
@@ -244,7 +244,7 @@ Gotchas / Known-issues
244
244
  All is not everything
245
245
  ---------------------
246
246
 
247
- The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--starred-gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
247
+ The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
248
248
 
249
249
  Cloning all starred size
250
250
  ------------------------
@@ -273,12 +273,6 @@ It's therefore recommended to only use the incremental argument if the output/re
273
273
 
274
274
  This is due to needing the correct permission for ``--hooks`` on public repos.
275
275
 
276
- 2. **Releases blocking**
277
-
278
- A known ``--releases`` (required for ``--assets``) error will sometimes block the backup.
279
-
280
- If you're backing up a lot of repositories with releases e.g. an organisation or ``--all-starred``. You may need to remove ``--releases`` (and therefore ``--assets``) to complete a backup. Documented in `issue 209 <https://github.com/josegonzalez/python-github-backup/issues/209>`_.
281
-
282
276
 
283
277
  "bare" is actually "mirror"
284
278
  ---------------------------
@@ -167,7 +167,7 @@ Customise the permissions for your use case, but for a personal account full bac
167
167
 
168
168
  **User permissions**: Read access to followers, starring, and watching.
169
169
 
170
- **Repository permissions**: Read access to code, commit statuses, issues, metadata, pages, pull requests, and repository hooks.
170
+ **Repository permissions**: Read access to contents, issues, metadata, pull requests, and webhooks.
171
171
 
172
172
 
173
173
  Prefer SSH
@@ -225,7 +225,7 @@ Gotchas / Known-issues
225
225
  All is not everything
226
226
  ---------------------
227
227
 
228
- The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--starred-gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
228
+ The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
229
229
 
230
230
  Cloning all starred size
231
231
  ------------------------
@@ -254,12 +254,6 @@ It's therefore recommended to only use the incremental argument if the output/re
254
254
 
255
255
  This is due to needing the correct permission for ``--hooks`` on public repos.
256
256
 
257
- 2. **Releases blocking**
258
-
259
- A known ``--releases`` (required for ``--assets``) error will sometimes block the backup.
260
-
261
- If you're backing up a lot of repositories with releases e.g. an organisation or ``--all-starred``. You may need to remove ``--releases`` (and therefore ``--assets``) to complete a backup. Documented in `issue 209 <https://github.com/josegonzalez/python-github-backup/issues/209>`_.
262
-
263
257
 
264
258
  "bare" is actually "mirror"
265
259
  ---------------------------
@@ -167,7 +167,7 @@ Customise the permissions for your use case, but for a personal account full bac
167
167
 
168
168
  **User permissions**: Read access to followers, starring, and watching.
169
169
 
170
- **Repository permissions**: Read access to code, commit statuses, issues, metadata, pages, pull requests, and repository hooks.
170
+ **Repository permissions**: Read access to contents, issues, metadata, pull requests, and webhooks.
171
171
 
172
172
 
173
173
  Prefer SSH
@@ -225,7 +225,7 @@ Gotchas / Known-issues
225
225
  All is not everything
226
226
  ---------------------
227
227
 
228
- The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--starred-gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
228
+ The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
229
229
 
230
230
  Cloning all starred size
231
231
  ------------------------
@@ -254,12 +254,6 @@ It's therefore recommended to only use the incremental argument if the output/re
254
254
 
255
255
  This is due to needing the correct permission for ``--hooks`` on public repos.
256
256
 
257
- 2. **Releases blocking**
258
-
259
- A known ``--releases`` (required for ``--assets``) error will sometimes block the backup.
260
-
261
- If you're backing up a lot of repositories with releases e.g. an organisation or ``--all-starred``. You may need to remove ``--releases`` (and therefore ``--assets``) to complete a backup. Documented in `issue 209 <https://github.com/josegonzalez/python-github-backup/issues/209>`_.
262
-
263
257
 
264
258
  "bare" is actually "mirror"
265
259
  ---------------------------
@@ -0,0 +1 @@
1
+ __version__ = "0.48.0"
@@ -19,12 +19,12 @@ import ssl
19
19
  import subprocess
20
20
  import sys
21
21
  import time
22
+ from datetime import datetime
22
23
  from http.client import IncompleteRead
23
24
  from urllib.error import HTTPError, URLError
24
25
  from urllib.parse import quote as urlquote
25
26
  from urllib.parse import urlencode, urlparse
26
27
  from urllib.request import HTTPRedirectHandler, Request, build_opener, urlopen
27
- from datetime import datetime
28
28
 
29
29
  try:
30
30
  from . import __version__
@@ -40,16 +40,21 @@ logger = logging.getLogger(__name__)
40
40
  https_ctx = ssl.create_default_context()
41
41
  if not https_ctx.get_ca_certs():
42
42
  import warnings
43
- warnings.warn('\n\nYOUR DEFAULT CA CERTS ARE EMPTY.\n' +
44
- 'PLEASE POPULATE ANY OF:' +
45
- ''.join([
46
- '\n - ' + x
47
- for x in ssl.get_default_verify_paths()
48
- if type(x) is str
49
- ]) + '\n', stacklevel=2)
43
+
44
+ warnings.warn(
45
+ "\n\nYOUR DEFAULT CA CERTS ARE EMPTY.\n"
46
+ + "PLEASE POPULATE ANY OF:"
47
+ + "".join(
48
+ ["\n - " + x for x in ssl.get_default_verify_paths() if type(x) is str]
49
+ )
50
+ + "\n",
51
+ stacklevel=2,
52
+ )
50
53
  import certifi
54
+
51
55
  https_ctx = ssl.create_default_context(cafile=certifi.where())
52
56
 
57
+
53
58
  def logging_subprocess(
54
59
  popenargs, stdout_log_level=logging.DEBUG, stderr_log_level=logging.ERROR, **kwargs
55
60
  ):
@@ -524,7 +529,7 @@ def get_github_host(args):
524
529
 
525
530
 
526
531
  def read_file_contents(file_uri):
527
- return open(file_uri[len(FILE_URI_PREFIX):], "rt").readline().strip()
532
+ return open(file_uri[len(FILE_URI_PREFIX) :], "rt").readline().strip()
528
533
 
529
534
 
530
535
  def get_github_repo_url(args, repository):
@@ -795,13 +800,15 @@ def download_file(url, path, auth, as_app=False, fine=False):
795
800
  if os.path.exists(path):
796
801
  return
797
802
 
798
- request = _construct_request(per_page=100,
799
- page=1,
800
- query_args={},
801
- template=url,
802
- auth=auth,
803
- as_app=as_app,
804
- fine=fine)
803
+ request = _construct_request(
804
+ per_page=100,
805
+ page=1,
806
+ query_args={},
807
+ template=url,
808
+ auth=auth,
809
+ as_app=as_app,
810
+ fine=fine,
811
+ )
805
812
  request.add_header("Accept", "application/octet-stream")
806
813
  opener = build_opener(S3HTTPRedirectHandler)
807
814
 
@@ -944,11 +951,15 @@ def filter_repositories(args, unfiltered_repositories):
944
951
  if r.get("language") and r.get("language").lower() in languages
945
952
  ] # noqa
946
953
  if name_regex:
947
- repositories = [r for r in repositories if "name" not in r or name_regex.match(r["name"])]
954
+ repositories = [
955
+ r for r in repositories if "name" not in r or name_regex.match(r["name"])
956
+ ]
948
957
  if args.skip_archived:
949
958
  repositories = [r for r in repositories if not r.get("archived")]
950
959
  if args.exclude:
951
- repositories = [r for r in repositories if "name" not in r or r["name"] not in args.exclude]
960
+ repositories = [
961
+ r for r in repositories if "name" not in r or r["name"] not in args.exclude
962
+ ]
952
963
 
953
964
  return repositories
954
965
 
@@ -1244,10 +1255,16 @@ def backup_releases(args, repo_cwd, repository, repos_template, include_assets=F
1244
1255
  if args.skip_prerelease:
1245
1256
  releases = [r for r in releases if not r["prerelease"] and not r["draft"]]
1246
1257
 
1247
- if args.number_of_latest_releases and args.number_of_latest_releases < len(releases):
1248
- releases.sort(key=lambda item: datetime.strptime(item["created_at"], "%Y-%m-%dT%H:%M:%SZ"),
1249
- reverse=True)
1250
- releases = releases[:args.number_of_latest_releases]
1258
+ if args.number_of_latest_releases and args.number_of_latest_releases < len(
1259
+ releases
1260
+ ):
1261
+ releases.sort(
1262
+ key=lambda item: datetime.strptime(
1263
+ item["created_at"], "%Y-%m-%dT%H:%M:%SZ"
1264
+ ),
1265
+ reverse=True,
1266
+ )
1267
+ releases = releases[: args.number_of_latest_releases]
1251
1268
  logger.info("Saving the latest {0} releases to disk".format(len(releases)))
1252
1269
  else:
1253
1270
  logger.info("Saving {0} releases to disk".format(len(releases)))
@@ -1274,7 +1291,7 @@ def backup_releases(args, repo_cwd, repository, repos_template, include_assets=F
1274
1291
  os.path.join(release_assets_cwd, asset["name"]),
1275
1292
  get_auth(args, encode=not args.as_app),
1276
1293
  as_app=args.as_app,
1277
- fine=True if args.token_fine is not None else False
1294
+ fine=True if args.token_fine is not None else False,
1278
1295
  )
1279
1296
 
1280
1297
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: github-backup
3
- Version: 0.47.0
3
+ Version: 0.48.0
4
4
  Summary: backup a github user or organization
5
5
  Home-page: http://github.com/josegonzalez/python-github-backup
6
6
  Author: Jose Diaz-Gonzalez
@@ -186,7 +186,7 @@ Customise the permissions for your use case, but for a personal account full bac
186
186
 
187
187
  **User permissions**: Read access to followers, starring, and watching.
188
188
 
189
- **Repository permissions**: Read access to code, commit statuses, issues, metadata, pages, pull requests, and repository hooks.
189
+ **Repository permissions**: Read access to contents, issues, metadata, pull requests, and webhooks.
190
190
 
191
191
 
192
192
  Prefer SSH
@@ -244,7 +244,7 @@ Gotchas / Known-issues
244
244
  All is not everything
245
245
  ---------------------
246
246
 
247
- The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--starred-gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
247
+ The ``--all`` argument does not include: cloning private repos (``-P, --private``), cloning forks (``-F, --fork``), cloning starred repositories (``--all-starred``), ``--pull-details``, cloning LFS repositories (``--lfs``), cloning gists (``--gists``) or cloning starred gist repos (``--starred-gists``). See examples for more.
248
248
 
249
249
  Cloning all starred size
250
250
  ------------------------
@@ -273,12 +273,6 @@ It's therefore recommended to only use the incremental argument if the output/re
273
273
 
274
274
  This is due to needing the correct permission for ``--hooks`` on public repos.
275
275
 
276
- 2. **Releases blocking**
277
-
278
- A known ``--releases`` (required for ``--assets``) error will sometimes block the backup.
279
-
280
- If you're backing up a lot of repositories with releases e.g. an organisation or ``--all-starred``. You may need to remove ``--releases`` (and therefore ``--assets``) to complete a backup. Documented in `issue 209 <https://github.com/josegonzalez/python-github-backup/issues/209>`_.
281
-
282
276
 
283
277
  "bare" is actually "mirror"
284
278
  ---------------------------
@@ -1,9 +1,9 @@
1
1
  autopep8==2.3.1
2
2
  black==24.10.0
3
3
  bleach==6.2.0
4
- certifi==2024.8.30
5
- charset-normalizer==3.4.0
6
- click==8.1.7
4
+ certifi==2024.12.14
5
+ charset-normalizer==3.4.1
6
+ click==8.1.8
7
7
  colorama==0.4.6
8
8
  docutils==0.21.2
9
9
  flake8==7.1.1
@@ -11,7 +11,7 @@ gitchangelog==3.0.4
11
11
  idna==3.10
12
12
  importlib-metadata==8.5.0
13
13
  jaraco.classes==3.4.0
14
- keyring==25.5.0
14
+ keyring==25.6.0
15
15
  markdown-it-py==3.0.0
16
16
  mccabe==0.7.0
17
17
  mdurl==0.1.2
@@ -34,6 +34,6 @@ setuptools==75.6.0
34
34
  six==1.17.0
35
35
  tqdm==4.67.1
36
36
  twine==6.0.1
37
- urllib3==2.2.3
37
+ urllib3==2.3.0
38
38
  webencodings==0.5.1
39
39
  zipp==3.21.0
@@ -1 +0,0 @@
1
- __version__ = "0.47.0"
File without changes
File without changes