Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
Browse files Browse the repository at this point in the history
  • Loading branch information
shcheklein authored Dec 18, 2023
2 parents d65a956 + af35d4b commit 18674b0
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 43 deletions.
5 changes: 0 additions & 5 deletions .github/release-drafter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ name: Publish

jobs:
publish:
environment: pypi
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'

Expand All @@ -28,7 +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
with:
password: ${{ secrets.PYPI_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/oauth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 1 addition & 10 deletions pydrive2/fs/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"]

Expand Down
6 changes: 3 additions & 3 deletions pydrive2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 18674b0

Please sign in to comment.