github-backup 0.48.0__tar.gz → 0.50.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,150 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- 0.48.0 (2025-01-04)
4
+ 0.50.0 (2025-02-22)
5
5
  -------------------
6
6
  ------------------------
7
+ - Chore: fix inline comments. [Jose Diaz-Gonzalez]
8
+ - Chore(deps): bump the python-packages group across 1 directory with 2
9
+ updates. [dependabot[bot]]
10
+
11
+ Bumps the python-packages group with 2 updates in the / directory: [flake8](https://github.com/pycqa/flake8) and [pkginfo](https://code.launchpad.net/~tseaver/pkginfo/trunk).
12
+
13
+
14
+ Updates `flake8` from 7.1.1 to 7.1.2
15
+ - [Commits](https://github.com/pycqa/flake8/compare/7.1.1...7.1.2)
16
+
17
+ Updates `pkginfo` from 1.12.0 to 1.12.1.2
18
+
19
+ ---
20
+ updated-dependencies:
21
+ - dependency-name: flake8
22
+ dependency-type: direct:production
23
+ update-type: version-update:semver-patch
24
+ dependency-group: python-packages
25
+ - dependency-name: pkginfo
26
+ dependency-type: direct:production
27
+ update-type: version-update:semver-patch
28
+ dependency-group: python-packages
29
+ ...
30
+
31
+
32
+ 0.49.0 (2025-02-01)
33
+ -------------------
34
+ - Convert timestamp to string, although maybe the other way around would
35
+ be better ... [Honza Maly]
36
+ - Implementing incremental by files, safer version of incremental
37
+ backup. [Honza Maly]
38
+ - Chore(deps): bump the python-packages group across 1 directory with 7
39
+ updates. [dependabot[bot]]
40
+
41
+ Bumps the python-packages group with 7 updates in the / directory:
42
+
43
+ | Package | From | To |
44
+ | --- | --- | --- |
45
+ | [autopep8](https://github.com/hhatto/autopep8) | `2.3.1` | `2.3.2` |
46
+ | [black](https://github.com/psf/black) | `24.10.0` | `25.1.0` |
47
+ | [certifi](https://github.com/certifi/python-certifi) | `2024.12.14` | `2025.1.31` |
48
+ | [importlib-metadata](https://github.com/python/importlib_metadata) | `8.5.0` | `8.6.1` |
49
+ | [more-itertools](https://github.com/more-itertools/more-itertools) | `10.5.0` | `10.6.0` |
50
+ | [setuptools](https://github.com/pypa/setuptools) | `75.7.0` | `75.8.0` |
51
+ | [twine](https://github.com/pypa/twine) | `6.0.1` | `6.1.0` |
52
+
53
+
54
+
55
+ Updates `autopep8` from 2.3.1 to 2.3.2
56
+ - [Release notes](https://github.com/hhatto/autopep8/releases)
57
+ - [Commits](https://github.com/hhatto/autopep8/compare/v2.3.1...v2.3.2)
58
+
59
+ Updates `black` from 24.10.0 to 25.1.0
60
+ - [Release notes](https://github.com/psf/black/releases)
61
+ - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
62
+ - [Commits](https://github.com/psf/black/compare/24.10.0...25.1.0)
63
+
64
+ Updates `certifi` from 2024.12.14 to 2025.1.31
65
+ - [Commits](https://github.com/certifi/python-certifi/compare/2024.12.14...2025.01.31)
66
+
67
+ Updates `importlib-metadata` from 8.5.0 to 8.6.1
68
+ - [Release notes](https://github.com/python/importlib_metadata/releases)
69
+ - [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
70
+ - [Commits](https://github.com/python/importlib_metadata/compare/v8.5.0...v8.6.1)
71
+
72
+ Updates `more-itertools` from 10.5.0 to 10.6.0
73
+ - [Release notes](https://github.com/more-itertools/more-itertools/releases)
74
+ - [Commits](https://github.com/more-itertools/more-itertools/compare/v10.5.0...v10.6.0)
75
+
76
+ Updates `setuptools` from 75.7.0 to 75.8.0
77
+ - [Release notes](https://github.com/pypa/setuptools/releases)
78
+ - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
79
+ - [Commits](https://github.com/pypa/setuptools/compare/v75.7.0...v75.8.0)
80
+
81
+ Updates `twine` from 6.0.1 to 6.1.0
82
+ - [Release notes](https://github.com/pypa/twine/releases)
83
+ - [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
84
+ - [Commits](https://github.com/pypa/twine/compare/6.0.1...6.1.0)
85
+
86
+ ---
87
+ updated-dependencies:
88
+ - dependency-name: autopep8
89
+ dependency-type: direct:production
90
+ update-type: version-update:semver-patch
91
+ dependency-group: python-packages
92
+ - dependency-name: black
93
+ dependency-type: direct:production
94
+ update-type: version-update:semver-major
95
+ dependency-group: python-packages
96
+ - dependency-name: certifi
97
+ dependency-type: direct:production
98
+ update-type: version-update:semver-major
99
+ dependency-group: python-packages
100
+ - dependency-name: importlib-metadata
101
+ dependency-type: direct:production
102
+ update-type: version-update:semver-minor
103
+ dependency-group: python-packages
104
+ - dependency-name: more-itertools
105
+ dependency-type: direct:production
106
+ update-type: version-update:semver-minor
107
+ dependency-group: python-packages
108
+ - dependency-name: setuptools
109
+ dependency-type: direct:production
110
+ update-type: version-update:semver-minor
111
+ dependency-group: python-packages
112
+ - dependency-name: twine
113
+ dependency-type: direct:production
114
+ update-type: version-update:semver-minor
115
+ dependency-group: python-packages
116
+ ...
117
+ - Chore(deps): bump the python-packages group across 1 directory with 2
118
+ updates. [dependabot[bot]]
119
+
120
+ Bumps the python-packages group with 2 updates in the / directory: [pygments](https://github.com/pygments/pygments) and [setuptools](https://github.com/pypa/setuptools).
121
+
122
+
123
+ Updates `pygments` from 2.18.0 to 2.19.1
124
+ - [Release notes](https://github.com/pygments/pygments/releases)
125
+ - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
126
+ - [Commits](https://github.com/pygments/pygments/compare/2.18.0...2.19.1)
127
+
128
+ Updates `setuptools` from 75.6.0 to 75.7.0
129
+ - [Release notes](https://github.com/pypa/setuptools/releases)
130
+ - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
131
+ - [Commits](https://github.com/pypa/setuptools/compare/v75.6.0...v75.7.0)
132
+
133
+ ---
134
+ updated-dependencies:
135
+ - dependency-name: pygments
136
+ dependency-type: direct:production
137
+ update-type: version-update:semver-minor
138
+ dependency-group: python-packages
139
+ - dependency-name: setuptools
140
+ dependency-type: direct:production
141
+ update-type: version-update:semver-minor
142
+ dependency-group: python-packages
143
+ ...
144
+
145
+
146
+ 0.48.0 (2025-01-04)
147
+ -------------------
7
148
  - Chore: reformat file to fix lint issues. [Jose Diaz-Gonzalez]
8
149
  - Chore(deps): bump the python-packages group across 1 directory with 4
9
150
  updates. [dependabot[bot]]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: github-backup
3
- Version: 0.48.0
3
+ Version: 0.50.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
@@ -16,6 +16,14 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: LICENSE.txt
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: summary
19
27
 
20
28
  =============
21
29
  github-backup
@@ -99,6 +107,7 @@ CLI Help output::
99
107
  log level to use (default: info, possible levels:
100
108
  debug, info, warning, error, critical)
101
109
  -i, --incremental incremental backup
110
+ --incremental-by-files incremental backup using modified time of files
102
111
  --starred include JSON output of starred repositories in backup
103
112
  --all-starred include starred repositories in backup [*]
104
113
  --watched include JSON output of watched repositories in backup
@@ -258,6 +267,12 @@ Using (``-i, --incremental``) will only request new data from the API **since th
258
267
 
259
268
  This means any blocking errors on previous runs can cause a large amount of missing data in backups.
260
269
 
270
+ Using (``--incremental-by-files``) will request new data from the API **based on when the file was modified on filesystem**. e.g. if you modify the file yourself you may miss something.
271
+
272
+ Still saver than the previous version.
273
+
274
+ Specifically, issues and pull requests are handled like this.
275
+
261
276
  Known blocking errors
262
277
  ---------------------
263
278
 
@@ -80,6 +80,7 @@ CLI Help output::
80
80
  log level to use (default: info, possible levels:
81
81
  debug, info, warning, error, critical)
82
82
  -i, --incremental incremental backup
83
+ --incremental-by-files incremental backup using modified time of files
83
84
  --starred include JSON output of starred repositories in backup
84
85
  --all-starred include starred repositories in backup [*]
85
86
  --watched include JSON output of watched repositories in backup
@@ -239,6 +240,12 @@ Using (``-i, --incremental``) will only request new data from the API **since th
239
240
 
240
241
  This means any blocking errors on previous runs can cause a large amount of missing data in backups.
241
242
 
243
+ Using (``--incremental-by-files``) will request new data from the API **based on when the file was modified on filesystem**. e.g. if you modify the file yourself you may miss something.
244
+
245
+ Still saver than the previous version.
246
+
247
+ Specifically, issues and pull requests are handled like this.
248
+
242
249
  Known blocking errors
243
250
  ---------------------
244
251
 
@@ -80,6 +80,7 @@ CLI Help output::
80
80
  log level to use (default: info, possible levels:
81
81
  debug, info, warning, error, critical)
82
82
  -i, --incremental incremental backup
83
+ --incremental-by-files incremental backup using modified time of files
83
84
  --starred include JSON output of starred repositories in backup
84
85
  --all-starred include starred repositories in backup [*]
85
86
  --watched include JSON output of watched repositories in backup
@@ -239,6 +240,12 @@ Using (``-i, --incremental``) will only request new data from the API **since th
239
240
 
240
241
  This means any blocking errors on previous runs can cause a large amount of missing data in backups.
241
242
 
243
+ Using (``--incremental-by-files``) will request new data from the API **based on when the file was modified on filesystem**. e.g. if you modify the file yourself you may miss something.
244
+
245
+ Still saver than the previous version.
246
+
247
+ Specifically, issues and pull requests are handled like this.
248
+
242
249
  Known blocking errors
243
250
  ---------------------
244
251
 
@@ -0,0 +1 @@
1
+ __version__ = "0.50.0"
@@ -181,6 +181,12 @@ def parse_args(args=None):
181
181
  dest="incremental",
182
182
  help="incremental backup",
183
183
  )
184
+ parser.add_argument(
185
+ "--incremental-by-files",
186
+ action="store_true",
187
+ dest="incremental_by_files",
188
+ help="incremental backup based on modification date of files",
189
+ )
184
190
  parser.add_argument(
185
191
  "--starred",
186
192
  action="store_true",
@@ -1114,6 +1120,14 @@ def backup_issues(args, repo_cwd, repository, repos_template):
1114
1120
  comments_template = _issue_template + "/{0}/comments"
1115
1121
  events_template = _issue_template + "/{0}/events"
1116
1122
  for number, issue in list(issues.items()):
1123
+ issue_file = "{0}/{1}.json".format(issue_cwd, number)
1124
+ if args.incremental_by_files and os.path.isfile(issue_file):
1125
+ modified = os.path.getmtime(issue_file)
1126
+ modified = datetime.fromtimestamp(modified).strftime("%Y-%m-%dT%H:%M:%SZ")
1127
+ if modified > issue["updated_at"]:
1128
+ logger.info("Skipping issue {0} because it wasn't modified since last backup".format(number))
1129
+ continue
1130
+
1117
1131
  if args.include_issue_comments or args.include_everything:
1118
1132
  template = comments_template.format(number)
1119
1133
  issues[number]["comment_data"] = retrieve_data(args, template)
@@ -1121,9 +1135,9 @@ def backup_issues(args, repo_cwd, repository, repos_template):
1121
1135
  template = events_template.format(number)
1122
1136
  issues[number]["event_data"] = retrieve_data(args, template)
1123
1137
 
1124
- issue_file = "{0}/{1}.json".format(issue_cwd, number)
1125
- with codecs.open(issue_file, "w", encoding="utf-8") as f:
1138
+ with codecs.open(issue_file + ".temp", "w", encoding="utf-8") as f:
1126
1139
  json_dump(issue, f)
1140
+ os.rename(issue_file + ".temp", issue_file) # Unlike json_dump, this is atomic
1127
1141
 
1128
1142
 
1129
1143
  def backup_pulls(args, repo_cwd, repository, repos_template):
@@ -1176,6 +1190,13 @@ def backup_pulls(args, repo_cwd, repository, repos_template):
1176
1190
  comments_template = _pulls_template + "/{0}/comments"
1177
1191
  commits_template = _pulls_template + "/{0}/commits"
1178
1192
  for number, pull in list(pulls.items()):
1193
+ pull_file = "{0}/{1}.json".format(pulls_cwd, number)
1194
+ if args.incremental_by_files and os.path.isfile(pull_file):
1195
+ modified = os.path.getmtime(pull_file)
1196
+ modified = datetime.fromtimestamp(modified).strftime("%Y-%m-%dT%H:%M:%SZ")
1197
+ if modified > pull["updated_at"]:
1198
+ logger.info("Skipping pull request {0} because it wasn't modified since last backup".format(number))
1199
+ continue
1179
1200
  if args.include_pull_comments or args.include_everything:
1180
1201
  template = comments_regular_template.format(number)
1181
1202
  pulls[number]["comment_regular_data"] = retrieve_data(args, template)
@@ -1185,9 +1206,9 @@ def backup_pulls(args, repo_cwd, repository, repos_template):
1185
1206
  template = commits_template.format(number)
1186
1207
  pulls[number]["commit_data"] = retrieve_data(args, template)
1187
1208
 
1188
- pull_file = "{0}/{1}.json".format(pulls_cwd, number)
1189
- with codecs.open(pull_file, "w", encoding="utf-8") as f:
1209
+ with codecs.open(pull_file + ".temp", "w", encoding="utf-8") as f:
1190
1210
  json_dump(pull, f)
1211
+ os.rename(pull_file + ".temp", pull_file) # Unlike json_dump, this is atomic
1191
1212
 
1192
1213
 
1193
1214
  def backup_milestones(args, repo_cwd, repository, repos_template):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: github-backup
3
- Version: 0.48.0
3
+ Version: 0.50.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
@@ -16,6 +16,14 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: LICENSE.txt
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: summary
19
27
 
20
28
  =============
21
29
  github-backup
@@ -99,6 +107,7 @@ CLI Help output::
99
107
  log level to use (default: info, possible levels:
100
108
  debug, info, warning, error, critical)
101
109
  -i, --incremental incremental backup
110
+ --incremental-by-files incremental backup using modified time of files
102
111
  --starred include JSON output of starred repositories in backup
103
112
  --all-starred include starred repositories in backup [*]
104
113
  --watched include JSON output of watched repositories in backup
@@ -258,6 +267,12 @@ Using (``-i, --incremental``) will only request new data from the API **since th
258
267
 
259
268
  This means any blocking errors on previous runs can cause a large amount of missing data in backups.
260
269
 
270
+ Using (``--incremental-by-files``) will request new data from the API **based on when the file was modified on filesystem**. e.g. if you modify the file yourself you may miss something.
271
+
272
+ Still saver than the previous version.
273
+
274
+ Specifically, issues and pull requests are handled like this.
275
+
261
276
  Known blocking errors
262
277
  ---------------------
263
278
 
@@ -1,39 +1,39 @@
1
- autopep8==2.3.1
2
- black==24.10.0
1
+ autopep8==2.3.2
2
+ black==25.1.0
3
3
  bleach==6.2.0
4
- certifi==2024.12.14
4
+ certifi==2025.1.31
5
5
  charset-normalizer==3.4.1
6
6
  click==8.1.8
7
7
  colorama==0.4.6
8
8
  docutils==0.21.2
9
- flake8==7.1.1
9
+ flake8==7.1.2
10
10
  gitchangelog==3.0.4
11
11
  idna==3.10
12
- importlib-metadata==8.5.0
12
+ importlib-metadata==8.6.1
13
13
  jaraco.classes==3.4.0
14
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
18
- more-itertools==10.5.0
18
+ more-itertools==10.6.0
19
19
  mypy-extensions==1.0.0
20
20
  packaging==24.2
21
21
  pathspec==0.12.1
22
- pkginfo==1.12.0
22
+ pkginfo==1.12.1.2
23
23
  platformdirs==4.3.6
24
24
  pycodestyle==2.12.1
25
25
  pyflakes==3.2.0
26
- Pygments==2.18.0
26
+ Pygments==2.19.1
27
27
  readme-renderer==44.0
28
28
  requests==2.32.3
29
29
  requests-toolbelt==1.0.0
30
30
  restructuredtext-lint==1.4.0
31
31
  rfc3986==2.0.0
32
32
  rich==13.9.4
33
- setuptools==75.6.0
33
+ setuptools==75.8.0
34
34
  six==1.17.0
35
35
  tqdm==4.67.1
36
- twine==6.0.1
36
+ twine==6.1.0
37
37
  urllib3==2.3.0
38
38
  webencodings==0.5.1
39
39
  zipp==3.21.0
@@ -1 +0,0 @@
1
- __version__ = "0.48.0"
File without changes
File without changes