From d8ade387921acff1fa03eef3bf1c6c1b82557b3c Mon Sep 17 00:00:00 2001 From: Alex Malins Date: Fri, 8 Sep 2023 02:48:13 +0900 Subject: [PATCH 01/10] Fix oath doc typo (#302) --- docs/oauth.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/oauth.rst b/docs/oauth.rst index f52a70f7..b14d6ed4 100644 --- a/docs/oauth.rst +++ b/docs/oauth.rst @@ -176,7 +176,7 @@ Typically, service accounts are used in scenarios such as: - Running workloads which are not tied to the lifecycle of a human user. If we use OAuth client ID we need to do one manual login into the account with -`LocalWebserverAuth()`_. if we use a service account the login is automatic. +`LocalWebserverAuth()`_. If we use a service account the login is automatic. .. code-block:: python From ccad3de628a1aca3baa12344c6f6b504b08b4de8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:36:05 -0700 Subject: [PATCH 02/10] build(deps-dev): bump black from 23.7.0 to 23.9.1 (#303) Bumps [black](https://github.com/psf/black) from 23.7.0 to 23.9.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/23.7.0...23.9.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 978a371b..9e5e132b 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ "importlib_resources < 6; python_version < '3.10'", ] -tests_requirements.append("black==23.7.0") +tests_requirements.append("black==23.9.1") setup( name="PyDrive2", From 2fccba0e895a334f8e5bb4870ef1380a25954b93 Mon Sep 17 00:00:00 2001 From: Ivan Shcheklein Date: Sun, 10 Sep 2023 18:36:45 -0700 Subject: [PATCH 03/10] chore(deps): bump black --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcdf8626..c94bd2e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - id: black language_version: python3 repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 - hooks: - id: flake8 language_version: python3 From 4d83d04948f16804026eaf4449ac02c75ba907a4 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Tue, 12 Sep 2023 19:10:27 +0200 Subject: [PATCH 04/10] Migrate from PyPI tokens to Trusted Publishers (#304) --- .github/workflows/publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ee39061d..089617bb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,6 +10,10 @@ name: Publish jobs: publish: + environment: pypi + permissions: + contents: read + id-token: write runs-on: ubuntu-latest steps: @@ -30,5 +34,3 @@ jobs: - name: Publish if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_TOKEN }} From c57355dc2033ad90b7050d681b2c3ba548ff0004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Rowlands=20=28=EB=B3=80=EA=B8=B0=ED=98=B8=29?= Date: Wed, 29 Nov 2023 00:05:14 +0900 Subject: [PATCH 05/10] Merge pull request from GHSA-v5f6-hjmf-9mc5 --- pydrive2/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pydrive2/settings.py b/pydrive2/settings.py index 15ff567e..a7d12304 100644 --- a/pydrive2/settings.py +++ b/pydrive2/settings.py @@ -2,9 +2,9 @@ from yaml import YAMLError try: - from yaml import CLoader as Loader + from yaml import CSafeLoader as SafeLoader except ImportError: - from yaml import Loader + from yaml import SafeLoader SETTINGS_FILE = "settings.yaml" SETTINGS_STRUCT = { @@ -114,7 +114,7 @@ def LoadSettingsFile(filename=SETTINGS_FILE): """ try: with open(filename) as stream: - data = load(stream, Loader=Loader) + data = load(stream, Loader=SafeLoader) except (YAMLError, OSError) as e: raise SettingsError(e) return data From ad07a3e02ae55bcc1046b6a2eecf2267b8223ff4 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 28 Nov 2023 17:27:19 +0200 Subject: [PATCH 06/10] Delete .github/release-drafter.yml github releases are more than enough. --- .github/release-drafter.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 0a92a9a4..00000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Config for https://github.com/apps/release-drafter -branches: - - main -template: | - $CHANGES From ea9a09bc8fbdeb7f3147b47f5fc87bab7cc3e76f Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Thu, 7 Dec 2023 16:46:11 +0200 Subject: [PATCH 07/10] Delete .github/workflows/release-drafter.yml --- .github/workflows/release-drafter.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 4ddf5a2e..00000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Release Drafter - -on: - push: - # branches to consider in the event; optional, defaults to all - branches: - - main - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into "main" - - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From afbd91dba98c1fa803fcc6c2d0d28d198f05bc68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 01:30:22 +0000 Subject: [PATCH 08/10] build(deps): bump actions/setup-python from 4 to 5 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 ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6f5b7534..d8d380c0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.8' diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ad71791c..5fbaac8f 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -10,5 +10,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 089617bb..23e2abe2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.8' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e2d073e9..e8c2dcf7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: # NOTE: needed for pull_request_target to use PR code ref: ${{ github.event.pull_request.head.sha || github.ref }} - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.pyv }} From a3c9e45845facee82f6e83f44f85339c4b6c83db Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:03:09 +0545 Subject: [PATCH 09/10] prevent tags from publishing without creating releases --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 23e2abe2..81ae96be 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,5 +32,5 @@ jobs: --outdir dist/ . - name: Publish - if: startsWith(github.ref, 'refs/tags') + if: github.event.action == 'published' uses: pypa/gh-action-pypi-publish@release/v1 From af35d4b7315810d9dee327e2c010974ca8cd3af2 Mon Sep 17 00:00:00 2001 From: Ivan Shcheklein Date: Mon, 18 Dec 2023 12:39:40 -0800 Subject: [PATCH 10/10] fix(fs): remove DVC-specific broken cache optimization (#321) --- pydrive2/fs/spec.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pydrive2/fs/spec.py b/pydrive2/fs/spec.py index c5abe03d..363e626d 100644 --- a/pydrive2/fs/spec.py +++ b/pydrive2/fs/spec.py @@ -256,13 +256,6 @@ def _ids_cache(self): } self._cache_path_id(self.base, cache["root_id"], cache=cache) - - for item in self._gdrive_list( - "'{}' in parents and trashed=false".format(cache["root_id"]) - ): - item_path = posixpath.join(self.base, item["title"]) - self._cache_path_id(item_path, item["id"], cache=cache) - return cache def _cache_path_id(self, path, *item_ids, cache=None): @@ -392,9 +385,7 @@ def _create_dir(self, parent_id, title, remote_path): return cached[0] item = self._gdrive_create_dir(parent_id, title) - - if parent_id == self._ids_cache["root_id"]: - self._cache_path_id(remote_path, item["id"]) + self._cache_path_id(remote_path, item["id"]) return item["id"]