mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75382afeae | ||
|
|
2cc34de2a3 | ||
|
|
dea87873f9 | ||
|
|
0288b5f553 | ||
|
|
02a07d3f0d | ||
|
|
24a7b1f885 | ||
|
|
22fa2eb97e | ||
|
|
cb147cf6d0 | ||
|
|
298724acfc | ||
|
|
65d541f577 | ||
|
|
8b08685678 | ||
|
|
b18ba6de28 | ||
|
|
358d1e3d3e | ||
|
|
1cd04281e9 | ||
|
|
6630b2b82e | ||
|
|
391f2ba305 | ||
|
|
1f0bf50381 | ||
|
|
eb44c735eb | ||
|
|
caff40e65b | ||
|
|
bba39fb4c8 | ||
|
|
093db93994 | ||
|
|
d835d47c17 | ||
|
|
2cd9061c46 | ||
|
|
0cc50bc4cb | ||
|
|
436e8df0ac | ||
|
|
9812988a4a | ||
|
|
1eccebcb83 | ||
|
|
122eb56aa1 | ||
|
|
a0fdae3314 | ||
|
|
80fa92664c | ||
|
|
7b69394488 | ||
|
|
d1d3d84d95 | ||
|
|
fff2aa4075 | ||
|
|
8eba46d8a7 | ||
|
|
9dc3458dba | ||
|
|
e9d7692123 | ||
|
|
a1ef61f87c | ||
|
|
6b62973997 | ||
|
|
b25af67898 | ||
|
|
0380fb8e35 | ||
|
|
f62fe5e6c9 | ||
|
|
c97598c914 | ||
|
|
c488b0adf9 | ||
|
|
888815c271 | ||
|
|
66e11aa532 | ||
|
|
d1874c0bd9 | ||
|
|
4c07bd1310 | ||
|
|
fd2d398025 | ||
|
|
53d2ceec10 | ||
|
|
421a7ec62b | ||
|
|
ec43649bcd | ||
|
|
e869844dba | ||
|
|
0857a37440 | ||
|
|
585af4c4e3 | ||
|
|
41ec01d5cb | ||
|
|
7dc22358df | ||
|
|
b855bcabf6 | ||
|
|
3c3262ed69 | ||
|
|
42b836f623 | ||
|
|
09f4168db6 | ||
|
|
3e9a4fa0d8 | ||
|
|
ab18e96ea8 | ||
|
|
eb88def888 | ||
|
|
7fe6541291 | ||
|
|
c8b8b270f6 | ||
|
|
a97f15b519 | ||
|
|
500c97c60e | ||
|
|
31a6e52a5e | ||
|
|
4c5187bcff | ||
|
|
2de69beffa | ||
|
|
96592295e1 | ||
|
|
bd65c3d5d6 |
15
.github/dependabot.yml
vendored
Normal file
15
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: pip
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "13:00"
|
||||
groups:
|
||||
python-packages:
|
||||
patterns:
|
||||
- "*"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
2
.github/workflows/automatic-release.yml
vendored
2
.github/workflows/automatic-release.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: Install prerequisites
|
||||
|
||||
77
.github/workflows/docker.yml
vendored
Normal file
77
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
name: Create and publish a Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'main'
|
||||
- 'dev'
|
||||
|
||||
tags:
|
||||
- 'v*'
|
||||
- 'v*.*'
|
||||
- 'v*.*.*'
|
||||
- '*'
|
||||
- '*.*'
|
||||
- '*.*.*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'dev'
|
||||
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
11
.github/workflows/lint.yml
vendored
11
.github/workflows/lint.yml
vendored
@@ -5,11 +5,11 @@ name: "lint"
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
- "*"
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'master'
|
||||
- "main"
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
@@ -22,11 +22,12 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.8"
|
||||
cache: "pip"
|
||||
- run: pip install -r release-requirements.txt
|
||||
- run: pip install -r release-requirements.txt && pip install wheel
|
||||
- run: flake8 --ignore=E501,E203,W503
|
||||
- run: black .
|
||||
- run: rst-lint README.rst
|
||||
- run: python setup.py sdist bdist_wheel && twine check dist/*
|
||||
|
||||
13
.gitignore
vendored
13
.gitignore
vendored
@@ -18,13 +18,13 @@ pkg
|
||||
|
||||
# Debian Files
|
||||
debian/files
|
||||
debian/python-aws-hostname*
|
||||
debian/python-github-backup*
|
||||
|
||||
# Sphinx build
|
||||
doc/_build
|
||||
|
||||
# Generated man page
|
||||
doc/aws_hostname.1
|
||||
doc/github_backup.1
|
||||
|
||||
# Annoying macOS files
|
||||
.DS_Store
|
||||
@@ -34,4 +34,11 @@ doc/aws_hostname.1
|
||||
.vscode
|
||||
.atom
|
||||
|
||||
README
|
||||
README
|
||||
|
||||
# RSA
|
||||
id_rsa
|
||||
id_rsa.pub
|
||||
|
||||
# Virtual env
|
||||
venv
|
||||
|
||||
663
CHANGES.rst
663
CHANGES.rst
@@ -1,9 +1,670 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
0.44.1 (2023-12-09)
|
||||
0.45.2 (2024-05-04)
|
||||
-------------------
|
||||
------------------------
|
||||
- Chore(deps): bump idna from 3.6 to 3.7. [dependabot[bot]]
|
||||
|
||||
Bumps [idna](https://github.com/kjd/idna) from 3.6 to 3.7.
|
||||
- [Release notes](https://github.com/kjd/idna/releases)
|
||||
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
|
||||
- [Commits](https://github.com/kjd/idna/compare/v3.6...v3.7)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: idna
|
||||
dependency-type: direct:production
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [keyring](https://github.com/jaraco/keyring).
|
||||
|
||||
|
||||
Updates `keyring` from 25.0.0 to 25.1.0
|
||||
- [Release notes](https://github.com/jaraco/keyring/releases)
|
||||
- [Changelog](https://github.com/jaraco/keyring/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/keyring/compare/v25.0.0...v25.1.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: keyring
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [jaraco-classes](https://github.com/jaraco/jaraco.classes).
|
||||
|
||||
|
||||
Updates `jaraco-classes` from 3.3.1 to 3.4.0
|
||||
- [Release notes](https://github.com/jaraco/jaraco.classes/releases)
|
||||
- [Changelog](https://github.com/jaraco/jaraco.classes/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/jaraco.classes/compare/v3.3.1...v3.4.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: jaraco-classes
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [keyring](https://github.com/jaraco/keyring).
|
||||
|
||||
|
||||
Updates `keyring` from 24.3.1 to 25.0.0
|
||||
- [Release notes](https://github.com/jaraco/keyring/releases)
|
||||
- [Changelog](https://github.com/jaraco/keyring/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/keyring/compare/v24.3.1...v25.0.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: keyring
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [importlib-metadata](https://github.com/python/importlib_metadata).
|
||||
|
||||
|
||||
Updates `importlib-metadata` from 7.0.2 to 7.1.0
|
||||
- [Release notes](https://github.com/python/importlib_metadata/releases)
|
||||
- [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/python/importlib_metadata/compare/v7.0.2...v7.1.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: importlib-metadata
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump actions/setup-python from 4 to 5. [dependabot[bot]]
|
||||
|
||||
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
|
||||
- [Release notes](https://github.com/actions/setup-python/releases)
|
||||
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: actions/setup-python
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
...
|
||||
- Scheduled dependabot for GitHub Actions. [paranerd]
|
||||
- Chore(deps): bump the python-packages group with 2 updates.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 2 updates: [autopep8](https://github.com/hhatto/autopep8) and [black](https://github.com/psf/black).
|
||||
|
||||
|
||||
Updates `autopep8` from 2.0.4 to 2.1.0
|
||||
- [Release notes](https://github.com/hhatto/autopep8/releases)
|
||||
- [Commits](https://github.com/hhatto/autopep8/compare/v2.0.4...v2.1.0)
|
||||
|
||||
Updates `black` from 24.2.0 to 24.3.0
|
||||
- [Release notes](https://github.com/psf/black/releases)
|
||||
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
|
||||
- [Commits](https://github.com/psf/black/compare/24.2.0...24.3.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: autopep8
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: black
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Added Docker info to README. [paranerd]
|
||||
- Disable credential persistance on checkout. [paranerd]
|
||||
- Bumped actions versions to latest. [paranerd]
|
||||
|
||||
|
||||
0.45.1 (2024-03-17)
|
||||
-------------------
|
||||
- Remove trailing whitespaces. [dale-primer-e]
|
||||
|
||||
That are triggering flake.
|
||||
- Fix error with as_app flag. [dale-primer-e]
|
||||
- Fix error downloading assets. [dale-primer-e]
|
||||
|
||||
When downloading assets using a fine grained token you will get a "can't
|
||||
concat str to bytes" error. This is due to the fine grained token being
|
||||
concatenated onto bytes in the line:
|
||||
|
||||
`request.add_header("Authorization", "Basic ".encode("ascii") + auth)`
|
||||
|
||||
This is better handled in the function `_construct_request` so I changed
|
||||
the lines that construct the request in `download_file` to use the
|
||||
function `_construct_request` and updated the function signature to
|
||||
reflect that.
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [zipp](https://github.com/jaraco/zipp).
|
||||
|
||||
|
||||
Updates `zipp` from 3.18.0 to 3.18.1
|
||||
- [Release notes](https://github.com/jaraco/zipp/releases)
|
||||
- [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/zipp/compare/v3.18.0...v3.18.1)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: zipp
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [zipp](https://github.com/jaraco/zipp).
|
||||
|
||||
|
||||
Updates `zipp` from 3.17.0 to 3.18.0
|
||||
- [Release notes](https://github.com/jaraco/zipp/releases)
|
||||
- [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/zipp/compare/v3.17.0...v3.18.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: zipp
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 2 updates.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 2 updates: [importlib-metadata](https://github.com/python/importlib_metadata) and [packaging](https://github.com/pypa/packaging).
|
||||
|
||||
|
||||
Updates `importlib-metadata` from 7.0.1 to 7.0.2
|
||||
- [Release notes](https://github.com/python/importlib_metadata/releases)
|
||||
- [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/python/importlib_metadata/compare/v7.0.1...v7.0.2)
|
||||
|
||||
Updates `packaging` from 23.2 to 24.0
|
||||
- [Release notes](https://github.com/pypa/packaging/releases)
|
||||
- [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
|
||||
- [Commits](https://github.com/pypa/packaging/compare/23.2...24.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: importlib-metadata
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
- dependency-name: packaging
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 2 updates.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 2 updates: [pkginfo](https://code.launchpad.net/~tseaver/pkginfo/trunk) and [rich](https://github.com/Textualize/rich).
|
||||
|
||||
|
||||
Updates `pkginfo` from 1.9.6 to 1.10.0
|
||||
|
||||
Updates `rich` from 13.7.0 to 13.7.1
|
||||
- [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/v13.7.0...v13.7.1)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: pkginfo
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: rich
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [keyring](https://github.com/jaraco/keyring).
|
||||
|
||||
|
||||
Updates `keyring` from 24.3.0 to 24.3.1
|
||||
- [Release notes](https://github.com/jaraco/keyring/releases)
|
||||
- [Changelog](https://github.com/jaraco/keyring/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/keyring/compare/v24.3.0...v24.3.1)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: keyring
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [readme-renderer](https://github.com/pypa/readme_renderer).
|
||||
|
||||
|
||||
Updates `readme-renderer` from 42.0 to 43.0
|
||||
- [Release notes](https://github.com/pypa/readme_renderer/releases)
|
||||
- [Changelog](https://github.com/pypa/readme_renderer/blob/main/CHANGES.rst)
|
||||
- [Commits](https://github.com/pypa/readme_renderer/compare/42.0...43.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: readme-renderer
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [urllib3](https://github.com/urllib3/urllib3).
|
||||
|
||||
|
||||
Updates `urllib3` from 2.2.0 to 2.2.1
|
||||
- [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.2.0...2.2.1)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: urllib3
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [black](https://github.com/psf/black).
|
||||
|
||||
|
||||
Updates `black` from 24.1.1 to 24.2.0
|
||||
- [Release notes](https://github.com/psf/black/releases)
|
||||
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
|
||||
- [Commits](https://github.com/psf/black/compare/24.1.1...24.2.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: black
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 2 updates.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 2 updates: [tqdm](https://github.com/tqdm/tqdm) and [twine](https://github.com/pypa/twine).
|
||||
|
||||
|
||||
Updates `tqdm` from 4.66.1 to 4.66.2
|
||||
- [Release notes](https://github.com/tqdm/tqdm/releases)
|
||||
- [Commits](https://github.com/tqdm/tqdm/compare/v4.66.1...v4.66.2)
|
||||
|
||||
Updates `twine` from 4.0.2 to 5.0.0
|
||||
- [Release notes](https://github.com/pypa/twine/releases)
|
||||
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
|
||||
- [Commits](https://github.com/pypa/twine/compare/4.0.2...5.0.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: tqdm
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
- dependency-name: twine
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [jaraco-classes](https://github.com/jaraco/jaraco.classes).
|
||||
|
||||
|
||||
Updates `jaraco-classes` from 3.3.0 to 3.3.1
|
||||
- [Release notes](https://github.com/jaraco/jaraco.classes/releases)
|
||||
- [Changelog](https://github.com/jaraco/jaraco.classes/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/jaraco.classes/compare/v3.3.0...v3.3.1)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: jaraco-classes
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [certifi](https://github.com/certifi/python-certifi).
|
||||
|
||||
|
||||
Updates `certifi` from 2023.11.17 to 2024.2.2
|
||||
- [Commits](https://github.com/certifi/python-certifi/compare/2023.11.17...2024.02.02)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: certifi
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 2 updates.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 2 updates: [platformdirs](https://github.com/platformdirs/platformdirs) and [urllib3](https://github.com/urllib3/urllib3).
|
||||
|
||||
|
||||
Updates `platformdirs` from 4.1.0 to 4.2.0
|
||||
- [Release notes](https://github.com/platformdirs/platformdirs/releases)
|
||||
- [Changelog](https://github.com/platformdirs/platformdirs/blob/main/CHANGES.rst)
|
||||
- [Commits](https://github.com/platformdirs/platformdirs/compare/4.1.0...4.2.0)
|
||||
|
||||
Updates `urllib3` from 2.1.0 to 2.2.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.1.0...2.2.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: platformdirs
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: urllib3
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 1 update.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 1 update: [black](https://github.com/psf/black).
|
||||
|
||||
|
||||
Updates `black` from 24.1.0 to 24.1.1
|
||||
- [Release notes](https://github.com/psf/black/releases)
|
||||
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
|
||||
- [Commits](https://github.com/psf/black/compare/24.1.0...24.1.1)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: black
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
...
|
||||
|
||||
|
||||
0.45.0 (2024-01-29)
|
||||
-------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Catch 404s for non-existing hooks. Fixes #176. [Moritz Federspiel]
|
||||
- Ensure wheel is installed. [Jose Diaz-Gonzalez]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
- Fix code style. [BrOleg5]
|
||||
- Add option to skip prerelease versions. [BrOleg5]
|
||||
|
||||
Replace release sorting by tag with release sorting by creation date.
|
||||
- Add option to include certain number of the latest releases. [BrOleg5]
|
||||
- Auto docker build. [8cH9azbsFifZ]
|
||||
- Vs code. [8cH9azbsFifZ]
|
||||
- Chore(deps): bump the python-packages group with 6 updates.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 6 updates:
|
||||
|
||||
| Package | From | To |
|
||||
| --- | --- | --- |
|
||||
| [black](https://github.com/psf/black) | `23.11.0` | `24.1.0` |
|
||||
| [flake8](https://github.com/pycqa/flake8) | `6.1.0` | `7.0.0` |
|
||||
| [importlib-metadata](https://github.com/python/importlib_metadata) | `7.0.0` | `7.0.1` |
|
||||
| [more-itertools](https://github.com/more-itertools/more-itertools) | `10.1.0` | `10.2.0` |
|
||||
| [pathspec](https://github.com/cpburnz/python-pathspec) | `0.11.2` | `0.12.1` |
|
||||
| [pyflakes](https://github.com/PyCQA/pyflakes) | `3.1.0` | `3.2.0` |
|
||||
|
||||
|
||||
Updates `black` from 23.11.0 to 24.1.0
|
||||
- [Release notes](https://github.com/psf/black/releases)
|
||||
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
|
||||
- [Commits](https://github.com/psf/black/compare/23.11.0...24.1.0)
|
||||
|
||||
Updates `flake8` from 6.1.0 to 7.0.0
|
||||
- [Commits](https://github.com/pycqa/flake8/compare/6.1.0...7.0.0)
|
||||
|
||||
Updates `importlib-metadata` from 7.0.0 to 7.0.1
|
||||
- [Release notes](https://github.com/python/importlib_metadata/releases)
|
||||
- [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/python/importlib_metadata/compare/v7.0.0...v7.0.1)
|
||||
|
||||
Updates `more-itertools` from 10.1.0 to 10.2.0
|
||||
- [Release notes](https://github.com/more-itertools/more-itertools/releases)
|
||||
- [Commits](https://github.com/more-itertools/more-itertools/compare/v10.1.0...v10.2.0)
|
||||
|
||||
Updates `pathspec` from 0.11.2 to 0.12.1
|
||||
- [Release notes](https://github.com/cpburnz/python-pathspec/releases)
|
||||
- [Changelog](https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst)
|
||||
- [Commits](https://github.com/cpburnz/python-pathspec/compare/v0.11.2...v0.12.1)
|
||||
|
||||
Updates `pyflakes` from 3.1.0 to 3.2.0
|
||||
- [Changelog](https://github.com/PyCQA/pyflakes/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/PyCQA/pyflakes/compare/3.1.0...3.2.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: black
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
- dependency-name: flake8
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
- dependency-name: importlib-metadata
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-patch
|
||||
dependency-group: python-packages
|
||||
- dependency-name: more-itertools
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: pathspec
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: pyflakes
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore(deps): bump the python-packages group with 15 updates.
|
||||
[dependabot[bot]]
|
||||
|
||||
Bumps the python-packages group with 15 updates:
|
||||
|
||||
| Package | From | To |
|
||||
| --- | --- | --- |
|
||||
| [bleach](https://github.com/mozilla/bleach) | `6.0.0` | `6.1.0` |
|
||||
| [certifi](https://github.com/certifi/python-certifi) | `2023.7.22` | `2023.11.17` |
|
||||
| [charset-normalizer](https://github.com/Ousret/charset_normalizer) | `3.1.0` | `3.3.2` |
|
||||
| [idna](https://github.com/kjd/idna) | `3.4` | `3.6` |
|
||||
| [importlib-metadata](https://github.com/python/importlib_metadata) | `6.6.0` | `7.0.0` |
|
||||
| [jaraco-classes](https://github.com/jaraco/jaraco.classes) | `3.2.3` | `3.3.0` |
|
||||
| [keyring](https://github.com/jaraco/keyring) | `23.13.1` | `24.3.0` |
|
||||
| [markdown-it-py](https://github.com/executablebooks/markdown-it-py) | `2.2.0` | `3.0.0` |
|
||||
| [more-itertools](https://github.com/more-itertools/more-itertools) | `9.1.0` | `10.1.0` |
|
||||
| [pygments](https://github.com/pygments/pygments) | `2.15.1` | `2.17.2` |
|
||||
| [readme-renderer](https://github.com/pypa/readme_renderer) | `37.3` | `42.0` |
|
||||
| [rich](https://github.com/Textualize/rich) | `13.3.5` | `13.7.0` |
|
||||
| [tqdm](https://github.com/tqdm/tqdm) | `4.65.0` | `4.66.1` |
|
||||
| [urllib3](https://github.com/urllib3/urllib3) | `2.0.7` | `2.1.0` |
|
||||
| [zipp](https://github.com/jaraco/zipp) | `3.15.0` | `3.17.0` |
|
||||
|
||||
|
||||
Updates `bleach` from 6.0.0 to 6.1.0
|
||||
- [Changelog](https://github.com/mozilla/bleach/blob/main/CHANGES)
|
||||
- [Commits](https://github.com/mozilla/bleach/compare/v6.0.0...v6.1.0)
|
||||
|
||||
Updates `certifi` from 2023.7.22 to 2023.11.17
|
||||
- [Commits](https://github.com/certifi/python-certifi/compare/2023.07.22...2023.11.17)
|
||||
|
||||
Updates `charset-normalizer` from 3.1.0 to 3.3.2
|
||||
- [Release notes](https://github.com/Ousret/charset_normalizer/releases)
|
||||
- [Changelog](https://github.com/Ousret/charset_normalizer/blob/master/CHANGELOG.md)
|
||||
- [Commits](https://github.com/Ousret/charset_normalizer/compare/3.1.0...3.3.2)
|
||||
|
||||
Updates `idna` from 3.4 to 3.6
|
||||
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
|
||||
- [Commits](https://github.com/kjd/idna/compare/v3.4...v3.6)
|
||||
|
||||
Updates `importlib-metadata` from 6.6.0 to 7.0.0
|
||||
- [Release notes](https://github.com/python/importlib_metadata/releases)
|
||||
- [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/python/importlib_metadata/compare/v6.6.0...v7.0.0)
|
||||
|
||||
Updates `jaraco-classes` from 3.2.3 to 3.3.0
|
||||
- [Release notes](https://github.com/jaraco/jaraco.classes/releases)
|
||||
- [Changelog](https://github.com/jaraco/jaraco.classes/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/jaraco.classes/compare/v3.2.3...v3.3.0)
|
||||
|
||||
Updates `keyring` from 23.13.1 to 24.3.0
|
||||
- [Release notes](https://github.com/jaraco/keyring/releases)
|
||||
- [Changelog](https://github.com/jaraco/keyring/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/keyring/compare/v23.13.1...v24.3.0)
|
||||
|
||||
Updates `markdown-it-py` from 2.2.0 to 3.0.0
|
||||
- [Release notes](https://github.com/executablebooks/markdown-it-py/releases)
|
||||
- [Changelog](https://github.com/executablebooks/markdown-it-py/blob/master/CHANGELOG.md)
|
||||
- [Commits](https://github.com/executablebooks/markdown-it-py/compare/v2.2.0...v3.0.0)
|
||||
|
||||
Updates `more-itertools` from 9.1.0 to 10.1.0
|
||||
- [Release notes](https://github.com/more-itertools/more-itertools/releases)
|
||||
- [Commits](https://github.com/more-itertools/more-itertools/compare/v9.1.0...v10.1.0)
|
||||
|
||||
Updates `pygments` from 2.15.1 to 2.17.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.15.1...2.17.2)
|
||||
|
||||
Updates `readme-renderer` from 37.3 to 42.0
|
||||
- [Release notes](https://github.com/pypa/readme_renderer/releases)
|
||||
- [Changelog](https://github.com/pypa/readme_renderer/blob/main/CHANGES.rst)
|
||||
- [Commits](https://github.com/pypa/readme_renderer/compare/37.3...42.0)
|
||||
|
||||
Updates `rich` from 13.3.5 to 13.7.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/v13.3.5...v13.7.0)
|
||||
|
||||
Updates `tqdm` from 4.65.0 to 4.66.1
|
||||
- [Release notes](https://github.com/tqdm/tqdm/releases)
|
||||
- [Commits](https://github.com/tqdm/tqdm/compare/v4.65.0...v4.66.1)
|
||||
|
||||
Updates `urllib3` from 2.0.7 to 2.1.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.0.7...2.1.0)
|
||||
|
||||
Updates `zipp` from 3.15.0 to 3.17.0
|
||||
- [Release notes](https://github.com/jaraco/zipp/releases)
|
||||
- [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst)
|
||||
- [Commits](https://github.com/jaraco/zipp/compare/v3.15.0...v3.17.0)
|
||||
|
||||
---
|
||||
updated-dependencies:
|
||||
- dependency-name: bleach
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: certifi
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: charset-normalizer
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: idna
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: importlib-metadata
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
- dependency-name: jaraco-classes
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: keyring
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
- dependency-name: markdown-it-py
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
- dependency-name: more-itertools
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
- dependency-name: pygments
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: readme-renderer
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-major
|
||||
dependency-group: python-packages
|
||||
- dependency-name: rich
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: tqdm
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: urllib3
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
- dependency-name: zipp
|
||||
dependency-type: direct:production
|
||||
update-type: version-update:semver-minor
|
||||
dependency-group: python-packages
|
||||
...
|
||||
- Chore: format python code. [Jose Diaz-Gonzalez]
|
||||
- Chore: format yaml. [Jose Diaz-Gonzalez]
|
||||
- Chore: update gitignore. [Jose Diaz-Gonzalez]
|
||||
- Feat: add dependabot config to repository. [Jose Diaz-Gonzalez]
|
||||
|
||||
|
||||
0.44.1 (2023-12-09)
|
||||
-------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
|
||||
15
README.rst
15
README.rst
@@ -49,7 +49,9 @@ CLI Help output::
|
||||
[-P] [-F] [--prefer-ssh] [-v]
|
||||
[--keychain-name OSX_KEYCHAIN_ITEM_NAME]
|
||||
[--keychain-account OSX_KEYCHAIN_ITEM_ACCOUNT]
|
||||
[--releases] [--assets] [--exclude [REPOSITORY [REPOSITORY ...]]
|
||||
[--releases] [--latest-releases NUMBER_OF_LATEST_RELEASES]
|
||||
[--skip-prerelease] [--assets]
|
||||
[--exclude [REPOSITORY [REPOSITORY ...]]
|
||||
[--throttle-limit THROTTLE_LIMIT] [--throttle-pause THROTTLE_PAUSE]
|
||||
USER
|
||||
|
||||
@@ -124,6 +126,10 @@ CLI Help output::
|
||||
keychain that holds the personal access or OAuth token
|
||||
--releases include release information, not including assets or
|
||||
binaries
|
||||
--latest-releases NUMBER_OF_LATEST_RELEASES
|
||||
include certain number of the latest releases;
|
||||
only applies if including releases
|
||||
--skip-prerelease skip prerelease and draft versions; only applies if including releases
|
||||
--assets include assets alongside release information; only
|
||||
applies if including releases
|
||||
--exclude [REPOSITORY [REPOSITORY ...]]
|
||||
@@ -206,6 +212,13 @@ When you use the ``--lfs`` option, you will need to make sure you have Git LFS i
|
||||
Instructions on how to do this can be found on https://git-lfs.github.com.
|
||||
|
||||
|
||||
Run in Docker container
|
||||
-----------------------
|
||||
|
||||
To run the tool in a Docker container use the following command:
|
||||
|
||||
sudo docker run --rm -v /path/to/backup:/data --name github-backup ghcr.io/josegonzalez/python-github-backup -o /data $OPTIONS $USER
|
||||
|
||||
Gotchas / Known-issues
|
||||
======================
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os, sys, logging
|
||||
|
||||
logging.basicConfig(
|
||||
format='%(asctime)s.%(msecs)03d: %(message)s',
|
||||
datefmt='%Y-%m-%dT%H:%M:%S',
|
||||
level=logging.INFO
|
||||
)
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
from github_backup.github_backup import (
|
||||
backup_account,
|
||||
@@ -20,6 +16,12 @@ from github_backup.github_backup import (
|
||||
retrieve_repositories,
|
||||
)
|
||||
|
||||
logging.basicConfig(
|
||||
format="%(asctime)s.%(msecs)03d: %(message)s",
|
||||
datefmt="%Y-%m-%dT%H:%M:%S",
|
||||
level=logging.INFO,
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
@@ -29,7 +31,7 @@ def main():
|
||||
|
||||
output_directory = os.path.realpath(args.output_directory)
|
||||
if not os.path.isdir(output_directory):
|
||||
logger.info('Create output directory {0}'.format(output_directory))
|
||||
logger.info("Create output directory {0}".format(output_directory))
|
||||
mkdir_p(output_directory)
|
||||
|
||||
if args.lfs_clone:
|
||||
@@ -41,10 +43,10 @@ def main():
|
||||
logger.root.setLevel(log_level)
|
||||
|
||||
if not args.as_app:
|
||||
logger.info('Backing up user {0} to {1}'.format(args.user, output_directory))
|
||||
logger.info("Backing up user {0} to {1}".format(args.user, output_directory))
|
||||
authenticated_user = get_authenticated_user(args)
|
||||
else:
|
||||
authenticated_user = {'login': None}
|
||||
authenticated_user = {"login": None}
|
||||
|
||||
repositories = retrieve_repositories(args, authenticated_user)
|
||||
repositories = filter_repositories(args, repositories)
|
||||
@@ -52,7 +54,7 @@ def main():
|
||||
backup_account(args, output_directory)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except Exception as e:
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.44.1"
|
||||
__version__ = "0.45.2"
|
||||
|
||||
@@ -23,6 +23,7 @@ from urllib.error import HTTPError, URLError
|
||||
from urllib.parse import quote as urlquote
|
||||
from urllib.parse import urlencode, urlparse
|
||||
from urllib.request import HTTPRedirectHandler, Request, build_opener, urlopen
|
||||
from datetime import datetime
|
||||
|
||||
try:
|
||||
from . import __version__
|
||||
@@ -376,6 +377,19 @@ def parse_args(args=None):
|
||||
dest="include_releases",
|
||||
help="include release information, not including assets or binaries",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--latest-releases",
|
||||
type=int,
|
||||
default=0,
|
||||
dest="number_of_latest_releases",
|
||||
help="include certain number of the latest releases; only applies if including releases",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-prerelease",
|
||||
action="store_true",
|
||||
dest="skip_prerelease",
|
||||
help="skip prerelease and draft versions; only applies if including releases",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--assets",
|
||||
action="store_true",
|
||||
@@ -497,7 +511,7 @@ def get_github_host(args):
|
||||
|
||||
|
||||
def read_file_contents(file_uri):
|
||||
return open(file_uri[len(FILE_URI_PREFIX) :], "rt").readline().strip()
|
||||
return open(file_uri[len(FILE_URI_PREFIX):], "rt").readline().strip()
|
||||
|
||||
|
||||
def get_github_repo_url(args, repository):
|
||||
@@ -763,14 +777,19 @@ class S3HTTPRedirectHandler(HTTPRedirectHandler):
|
||||
return request
|
||||
|
||||
|
||||
def download_file(url, path, auth):
|
||||
def download_file(url, path, auth, as_app=False, fine=False):
|
||||
# Skip downloading release assets if they already exist on disk so we don't redownload on every sync
|
||||
if os.path.exists(path):
|
||||
return
|
||||
|
||||
request = Request(url)
|
||||
request = _construct_request(per_page=100,
|
||||
page=1,
|
||||
query_args={},
|
||||
template=url,
|
||||
auth=auth,
|
||||
as_app=as_app,
|
||||
fine=fine)
|
||||
request.add_header("Accept", "application/octet-stream")
|
||||
request.add_header("Authorization", "Basic ".encode("ascii") + auth)
|
||||
opener = build_opener(S3HTTPRedirectHandler)
|
||||
|
||||
try:
|
||||
@@ -1189,8 +1208,11 @@ def backup_hooks(args, repo_cwd, repository, repos_template):
|
||||
template = "{0}/{1}/hooks".format(repos_template, repository["full_name"])
|
||||
try:
|
||||
_backup_data(args, "hooks", template, output_file, hook_cwd)
|
||||
except SystemExit:
|
||||
logger.info("Unable to read hooks, skipping")
|
||||
except Exception as e:
|
||||
if "404" in str(e):
|
||||
logger.info("Unable to read hooks, skipping")
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
||||
def backup_releases(args, repo_cwd, repository, repos_template, include_assets=False):
|
||||
@@ -1206,8 +1228,18 @@ def backup_releases(args, repo_cwd, repository, repos_template, include_assets=F
|
||||
release_template = "{0}/{1}/releases".format(repos_template, repository_fullname)
|
||||
releases = retrieve_data(args, release_template, query_args=query_args)
|
||||
|
||||
if args.skip_prerelease:
|
||||
releases = [r for r in releases if not r["prerelease"] and not r["draft"]]
|
||||
|
||||
if args.number_of_latest_releases and args.number_of_latest_releases < len(releases):
|
||||
releases.sort(key=lambda item: datetime.strptime(item["created_at"], "%Y-%m-%dT%H:%M:%SZ"),
|
||||
reverse=True)
|
||||
releases = releases[:args.number_of_latest_releases]
|
||||
logger.info("Saving the latest {0} releases to disk".format(len(releases)))
|
||||
else:
|
||||
logger.info("Saving {0} releases to disk".format(len(releases)))
|
||||
|
||||
# for each release, store it
|
||||
logger.info("Saving {0} releases to disk".format(len(releases)))
|
||||
for release in releases:
|
||||
release_name = release["tag_name"]
|
||||
release_name_safe = release_name.replace("/", "__")
|
||||
@@ -1228,6 +1260,8 @@ def backup_releases(args, repo_cwd, repository, repos_template, include_assets=F
|
||||
asset["url"],
|
||||
os.path.join(release_assets_cwd, asset["name"]),
|
||||
get_auth(args),
|
||||
as_app=args.as_app,
|
||||
fine=True if args.token_fine is not None else False
|
||||
)
|
||||
|
||||
|
||||
|
||||
7
python-github-backup.code-workspace
Executable file
7
python-github-backup.code-workspace
Executable file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,38 +1,38 @@
|
||||
autopep8==2.0.4
|
||||
black==23.11.0
|
||||
bleach==6.0.0
|
||||
certifi==2023.7.22
|
||||
charset-normalizer==3.1.0
|
||||
autopep8==2.1.0
|
||||
black==24.3.0
|
||||
bleach==6.1.0
|
||||
certifi==2024.2.2
|
||||
charset-normalizer==3.3.2
|
||||
click==8.1.7
|
||||
colorama==0.4.6
|
||||
docutils==0.20.1
|
||||
flake8==6.1.0
|
||||
flake8==7.0.0
|
||||
gitchangelog==3.0.4
|
||||
idna==3.4
|
||||
importlib-metadata==6.6.0
|
||||
jaraco.classes==3.2.3
|
||||
keyring==23.13.1
|
||||
markdown-it-py==2.2.0
|
||||
idna==3.7
|
||||
importlib-metadata==7.1.0
|
||||
jaraco.classes==3.4.0
|
||||
keyring==25.1.0
|
||||
markdown-it-py==3.0.0
|
||||
mccabe==0.7.0
|
||||
mdurl==0.1.2
|
||||
more-itertools==9.1.0
|
||||
more-itertools==10.2.0
|
||||
mypy-extensions==1.0.0
|
||||
packaging==23.2
|
||||
pathspec==0.11.2
|
||||
pkginfo==1.9.6
|
||||
platformdirs==4.1.0
|
||||
packaging==24.0
|
||||
pathspec==0.12.1
|
||||
pkginfo==1.10.0
|
||||
platformdirs==4.2.0
|
||||
pycodestyle==2.11.1
|
||||
pyflakes==3.1.0
|
||||
Pygments==2.15.1
|
||||
readme-renderer==37.3
|
||||
pyflakes==3.2.0
|
||||
Pygments==2.17.2
|
||||
readme-renderer==43.0
|
||||
requests==2.31.0
|
||||
requests-toolbelt==1.0.0
|
||||
restructuredtext-lint==1.4.0
|
||||
rfc3986==2.0.0
|
||||
rich==13.3.5
|
||||
rich==13.7.1
|
||||
six==1.16.0
|
||||
tqdm==4.65.0
|
||||
twine==4.0.2
|
||||
urllib3==2.0.7
|
||||
tqdm==4.66.2
|
||||
twine==5.0.0
|
||||
urllib3==2.2.1
|
||||
webencodings==0.5.1
|
||||
zipp==3.15.0
|
||||
zipp==3.18.1
|
||||
|
||||
Reference in New Issue
Block a user