mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f07157c9b | ||
|
|
87f5b76c52 | ||
|
|
27eb009e34 | ||
|
|
82c1fc3086 | ||
|
|
a4f15b06d9 | ||
|
|
aa217774ff | ||
|
|
d820dd994d | ||
|
|
1bad563e3f | ||
|
|
175ac19be6 | ||
|
|
773ccecb8c | ||
|
|
e27b5a8ee3 | ||
|
|
fb8945fc09 | ||
|
|
7333458ee4 |
160
CHANGES.rst
160
CHANGES.rst
@@ -1,9 +1,167 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
0.50.2 (2025-06-16)
|
0.50.3 (2025-08-08)
|
||||||
-------------------
|
-------------------
|
||||||
------------------------
|
------------------------
|
||||||
|
- Revert "Add conditional check for git checkout in development path"
|
||||||
|
[Eric Wheeler]
|
||||||
|
|
||||||
|
This reverts commit 1bad563e3f23d3d8b9f98721d857a660692f4847.
|
||||||
|
- Fix -R flag to allow backups of repositories not owned by user. [Eric
|
||||||
|
Wheeler]
|
||||||
|
|
||||||
|
Previously, using -R flag would show zero issues/PRs for repositories
|
||||||
|
not owned by the primary user due to incorrect pagination parameters
|
||||||
|
being added to single repository API calls.
|
||||||
|
|
||||||
|
- Remove pagination parameters for single repository requests
|
||||||
|
- Support owner/repo format in -R flag (e.g., -R owner/repo-name)
|
||||||
|
- Skip filtering when specific repository is requested
|
||||||
|
- Fix URL construction for requests without query parameters
|
||||||
|
|
||||||
|
This enables backing up any repository, not just those owned by the
|
||||||
|
primary user specified in -u flag.
|
||||||
|
- Add conditional check for git checkout in development path. [Eric
|
||||||
|
Wheeler]
|
||||||
|
|
||||||
|
Only insert development path into sys.path when running from a git checkout
|
||||||
|
(when ../.git exists). This makes the script more robust by only using the
|
||||||
|
development tree when available and falling back to installed package otherwise.
|
||||||
|
- Chore(deps): bump the python-packages group across 1 directory with 3
|
||||||
|
updates. [dependabot[bot]]
|
||||||
|
|
||||||
|
Bumps the python-packages group with 3 updates in the / directory: [certifi](https://github.com/certifi/python-certifi), [docutils](https://github.com/rtfd/recommonmark) and [rich](https://github.com/Textualize/rich).
|
||||||
|
|
||||||
|
|
||||||
|
Updates `certifi` from 2025.7.9 to 2025.7.14
|
||||||
|
- [Commits](https://github.com/certifi/python-certifi/compare/2025.07.09...2025.07.14)
|
||||||
|
|
||||||
|
Updates `docutils` from 0.21.2 to 0.22
|
||||||
|
- [Changelog](https://github.com/readthedocs/recommonmark/blob/master/CHANGELOG.md)
|
||||||
|
- [Commits](https://github.com/rtfd/recommonmark/commits)
|
||||||
|
|
||||||
|
Updates `rich` from 14.0.0 to 14.1.0
|
||||||
|
- [Release notes](https://github.com/Textualize/rich/releases)
|
||||||
|
- [Changelog](https://github.com/Textualize/rich/blob/master/CHANGELOG.md)
|
||||||
|
- [Commits](https://github.com/Textualize/rich/compare/v14.0.0...v14.1.0)
|
||||||
|
|
||||||
|
---
|
||||||
|
updated-dependencies:
|
||||||
|
- dependency-name: certifi
|
||||||
|
dependency-version: 2025.7.14
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-patch
|
||||||
|
dependency-group: python-packages
|
||||||
|
- dependency-name: docutils
|
||||||
|
dependency-version: '0.22'
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-minor
|
||||||
|
dependency-group: python-packages
|
||||||
|
- dependency-name: rich
|
||||||
|
dependency-version: 14.1.0
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-minor
|
||||||
|
dependency-group: python-packages
|
||||||
|
...
|
||||||
|
- Chore(deps): bump certifi in the python-packages group.
|
||||||
|
[dependabot[bot]]
|
||||||
|
|
||||||
|
Bumps the python-packages group with 1 update: [certifi](https://github.com/certifi/python-certifi).
|
||||||
|
|
||||||
|
|
||||||
|
Updates `certifi` from 2025.6.15 to 2025.7.9
|
||||||
|
- [Commits](https://github.com/certifi/python-certifi/compare/2025.06.15...2025.07.09)
|
||||||
|
|
||||||
|
---
|
||||||
|
updated-dependencies:
|
||||||
|
- dependency-name: certifi
|
||||||
|
dependency-version: 2025.7.9
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-minor
|
||||||
|
dependency-group: python-packages
|
||||||
|
...
|
||||||
|
- Chore(deps): bump urllib3 from 2.4.0 to 2.5.0. [dependabot[bot]]
|
||||||
|
|
||||||
|
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.4.0 to 2.5.0.
|
||||||
|
- [Release notes](https://github.com/urllib3/urllib3/releases)
|
||||||
|
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
|
||||||
|
- [Commits](https://github.com/urllib3/urllib3/compare/2.4.0...2.5.0)
|
||||||
|
|
||||||
|
---
|
||||||
|
updated-dependencies:
|
||||||
|
- dependency-name: urllib3
|
||||||
|
dependency-version: 2.5.0
|
||||||
|
dependency-type: direct:production
|
||||||
|
...
|
||||||
|
- Chore(deps): bump the python-packages group with 5 updates.
|
||||||
|
[dependabot[bot]]
|
||||||
|
|
||||||
|
Bumps the python-packages group with 5 updates:
|
||||||
|
|
||||||
|
| Package | From | To |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [flake8](https://github.com/pycqa/flake8) | `7.2.0` | `7.3.0` |
|
||||||
|
| [pycodestyle](https://github.com/PyCQA/pycodestyle) | `2.13.0` | `2.14.0` |
|
||||||
|
| [pyflakes](https://github.com/PyCQA/pyflakes) | `3.3.2` | `3.4.0` |
|
||||||
|
| [pygments](https://github.com/pygments/pygments) | `2.19.1` | `2.19.2` |
|
||||||
|
| [urllib3](https://github.com/urllib3/urllib3) | `2.4.0` | `2.5.0` |
|
||||||
|
|
||||||
|
|
||||||
|
Updates `flake8` from 7.2.0 to 7.3.0
|
||||||
|
- [Commits](https://github.com/pycqa/flake8/compare/7.2.0...7.3.0)
|
||||||
|
|
||||||
|
Updates `pycodestyle` from 2.13.0 to 2.14.0
|
||||||
|
- [Release notes](https://github.com/PyCQA/pycodestyle/releases)
|
||||||
|
- [Changelog](https://github.com/PyCQA/pycodestyle/blob/main/CHANGES.txt)
|
||||||
|
- [Commits](https://github.com/PyCQA/pycodestyle/compare/2.13.0...2.14.0)
|
||||||
|
|
||||||
|
Updates `pyflakes` from 3.3.2 to 3.4.0
|
||||||
|
- [Changelog](https://github.com/PyCQA/pyflakes/blob/main/NEWS.rst)
|
||||||
|
- [Commits](https://github.com/PyCQA/pyflakes/compare/3.3.2...3.4.0)
|
||||||
|
|
||||||
|
Updates `pygments` from 2.19.1 to 2.19.2
|
||||||
|
- [Release notes](https://github.com/pygments/pygments/releases)
|
||||||
|
- [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
|
||||||
|
- [Commits](https://github.com/pygments/pygments/compare/2.19.1...2.19.2)
|
||||||
|
|
||||||
|
Updates `urllib3` from 2.4.0 to 2.5.0
|
||||||
|
- [Release notes](https://github.com/urllib3/urllib3/releases)
|
||||||
|
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
|
||||||
|
- [Commits](https://github.com/urllib3/urllib3/compare/2.4.0...2.5.0)
|
||||||
|
|
||||||
|
---
|
||||||
|
updated-dependencies:
|
||||||
|
- dependency-name: flake8
|
||||||
|
dependency-version: 7.3.0
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-minor
|
||||||
|
dependency-group: python-packages
|
||||||
|
- dependency-name: pycodestyle
|
||||||
|
dependency-version: 2.14.0
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-minor
|
||||||
|
dependency-group: python-packages
|
||||||
|
- dependency-name: pyflakes
|
||||||
|
dependency-version: 3.4.0
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-minor
|
||||||
|
dependency-group: python-packages
|
||||||
|
- dependency-name: pygments
|
||||||
|
dependency-version: 2.19.2
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-patch
|
||||||
|
dependency-group: python-packages
|
||||||
|
- dependency-name: urllib3
|
||||||
|
dependency-version: 2.5.0
|
||||||
|
dependency-type: direct:production
|
||||||
|
update-type: version-update:semver-minor
|
||||||
|
dependency-group: python-packages
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
0.50.2 (2025-06-16)
|
||||||
|
-------------------
|
||||||
- Chore(deps): bump certifi in the python-packages group.
|
- Chore(deps): bump certifi in the python-packages group.
|
||||||
[dependabot[bot]]
|
[dependabot[bot]]
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = "0.50.2"
|
__version__ = "0.50.3"
|
||||||
|
|||||||
@@ -578,10 +578,15 @@ def retrieve_data_gen(args, template, query_args=None, single_request=False):
|
|||||||
page = 0
|
page = 0
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
if single_request:
|
||||||
|
request_page, request_per_page = None, None
|
||||||
|
else:
|
||||||
page = page + 1
|
page = page + 1
|
||||||
|
request_page, request_per_page = page, per_page
|
||||||
|
|
||||||
request = _construct_request(
|
request = _construct_request(
|
||||||
per_page,
|
request_per_page,
|
||||||
page,
|
request_page,
|
||||||
query_args,
|
query_args,
|
||||||
template,
|
template,
|
||||||
auth,
|
auth,
|
||||||
@@ -715,14 +720,22 @@ def _get_response(request, auth, template):
|
|||||||
def _construct_request(
|
def _construct_request(
|
||||||
per_page, page, query_args, template, auth, as_app=None, fine=False
|
per_page, page, query_args, template, auth, as_app=None, fine=False
|
||||||
):
|
):
|
||||||
querystring = urlencode(
|
all_query_args = {}
|
||||||
dict(
|
if per_page:
|
||||||
list({"per_page": per_page, "page": page}.items())
|
all_query_args["per_page"] = per_page
|
||||||
+ list(query_args.items())
|
if page:
|
||||||
)
|
all_query_args["page"] = page
|
||||||
)
|
if query_args:
|
||||||
|
all_query_args.update(query_args)
|
||||||
|
|
||||||
request = Request(template + "?" + querystring)
|
request_url = template
|
||||||
|
if all_query_args:
|
||||||
|
querystring = urlencode(all_query_args)
|
||||||
|
request_url = template + "?" + querystring
|
||||||
|
else:
|
||||||
|
querystring = ""
|
||||||
|
|
||||||
|
request = Request(request_url)
|
||||||
if auth is not None:
|
if auth is not None:
|
||||||
if not as_app:
|
if not as_app:
|
||||||
if fine:
|
if fine:
|
||||||
@@ -735,7 +748,11 @@ def _construct_request(
|
|||||||
request.add_header(
|
request.add_header(
|
||||||
"Accept", "application/vnd.github.machine-man-preview+json"
|
"Accept", "application/vnd.github.machine-man-preview+json"
|
||||||
)
|
)
|
||||||
logger.info("Requesting {}?{}".format(template, querystring))
|
|
||||||
|
log_url = template
|
||||||
|
if querystring:
|
||||||
|
log_url += "?" + querystring
|
||||||
|
logger.info("Requesting {}".format(log_url))
|
||||||
return request
|
return request
|
||||||
|
|
||||||
|
|
||||||
@@ -885,9 +902,13 @@ def retrieve_repositories(args, authenticated_user):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if args.repository:
|
if args.repository:
|
||||||
|
if "/" in args.repository:
|
||||||
|
repo_path = args.repository
|
||||||
|
else:
|
||||||
|
repo_path = "{0}/{1}".format(args.user, args.repository)
|
||||||
single_request = True
|
single_request = True
|
||||||
template = "https://{0}/repos/{1}/{2}".format(
|
template = "https://{0}/repos/{1}".format(
|
||||||
get_github_api_host(args), args.user, args.repository
|
get_github_api_host(args), repo_path
|
||||||
)
|
)
|
||||||
|
|
||||||
repos = retrieve_data(args, template, single_request=single_request)
|
repos = retrieve_data(args, template, single_request=single_request)
|
||||||
@@ -928,6 +949,8 @@ def retrieve_repositories(args, authenticated_user):
|
|||||||
|
|
||||||
|
|
||||||
def filter_repositories(args, unfiltered_repositories):
|
def filter_repositories(args, unfiltered_repositories):
|
||||||
|
if args.repository:
|
||||||
|
return unfiltered_repositories
|
||||||
logger.info("Filtering repositories")
|
logger.info("Filtering repositories")
|
||||||
|
|
||||||
repositories = []
|
repositories = []
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
autopep8==2.3.2
|
autopep8==2.3.2
|
||||||
black==25.1.0
|
black==25.1.0
|
||||||
bleach==6.2.0
|
bleach==6.2.0
|
||||||
certifi==2025.6.15
|
certifi==2025.7.14
|
||||||
charset-normalizer==3.4.2
|
charset-normalizer==3.4.2
|
||||||
click==8.1.8
|
click==8.1.8
|
||||||
colorama==0.4.6
|
colorama==0.4.6
|
||||||
docutils==0.21.2
|
docutils==0.22
|
||||||
flake8==7.2.0
|
flake8==7.3.0
|
||||||
gitchangelog==3.0.4
|
gitchangelog==3.0.4
|
||||||
idna==3.10
|
idna==3.10
|
||||||
importlib-metadata==8.7.0
|
importlib-metadata==8.7.0
|
||||||
@@ -21,19 +21,19 @@ packaging==25.0
|
|||||||
pathspec==0.12.1
|
pathspec==0.12.1
|
||||||
pkginfo==1.12.1.2
|
pkginfo==1.12.1.2
|
||||||
platformdirs==4.3.8
|
platformdirs==4.3.8
|
||||||
pycodestyle==2.13.0
|
pycodestyle==2.14.0
|
||||||
pyflakes==3.3.2
|
pyflakes==3.4.0
|
||||||
Pygments==2.19.1
|
Pygments==2.19.2
|
||||||
readme-renderer==44.0
|
readme-renderer==44.0
|
||||||
requests==2.32.4
|
requests==2.32.4
|
||||||
requests-toolbelt==1.0.0
|
requests-toolbelt==1.0.0
|
||||||
restructuredtext-lint==1.4.0
|
restructuredtext-lint==1.4.0
|
||||||
rfc3986==2.0.0
|
rfc3986==2.0.0
|
||||||
rich==14.0.0
|
rich==14.1.0
|
||||||
setuptools==80.9.0
|
setuptools==80.9.0
|
||||||
six==1.17.0
|
six==1.17.0
|
||||||
tqdm==4.67.1
|
tqdm==4.67.1
|
||||||
twine==6.1.0
|
twine==6.1.0
|
||||||
urllib3==2.4.0
|
urllib3==2.5.0
|
||||||
webencodings==0.5.1
|
webencodings==0.5.1
|
||||||
zipp==3.23.0
|
zipp==3.23.0
|
||||||
|
|||||||
Reference in New Issue
Block a user