Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
6ce9ea9
Switch to uv for dependency management.
Light2Dark Jun 18, 2026
4dc94bd
Rework CI with uv setup and split jobs.
Light2Dark Jun 18, 2026
7b423a2
Bump pre-commit hook versions.
Light2Dark Jun 18, 2026
e5508e9
move checkout back to workflow
Light2Dark Jun 18, 2026
606de4a
remove uv lock
Light2Dark Jun 20, 2026
05a9972
add uv.lock to gitignore
Light2Dark Jun 20, 2026
56bbae3
move to src layout
Light2Dark Jun 22, 2026
85f94ed
update readme
Light2Dark Jun 24, 2026
d24bb61
update note
Light2Dark Jun 24, 2026
0fc17a5
fix link
Light2Dark Jun 24, 2026
3292e55
add pyrefly typechecker
Light2Dark Jun 26, 2026
dd10432
set venv on path for pre-commit
Light2Dark Jun 26, 2026
f53415f
add comment
Light2Dark Jun 26, 2026
0048b36
Merge pull request #2 from Light2Dark/sham/upgrade-repo-v2
Light2Dark Jun 26, 2026
4a6883e
add logo, docs
Light2Dark Jun 27, 2026
6b57392
Merge pull request #4 from Light2Dark/sham/update-readme-contributing
Light2Dark Jun 27, 2026
6a050bf
update links, remove text
Light2Dark Jun 27, 2026
7846d04
Merge pull request #5 from Light2Dark/sham/docs-addition
Light2Dark Jun 27, 2026
601e107
add pytest-cov
Light2Dark Jun 27, 2026
f749f52
Merge pull request #6 from Light2Dark/sham/add-test-coverage
Light2Dark Jun 27, 2026
5a7c984
check root id is valid
Light2Dark Jun 27, 2026
4bf33d8
validate root_file_id is a folder
Light2Dark Jun 27, 2026
6e169ec
test: add root_file_id integration tests and FS factory fixture
Light2Dark Jun 27, 2026
dbd70b0
Merge pull request #7 from Light2Dark/sham/validate-root-id
Light2Dark Jun 28, 2026
f64def3
validate drive/root consistency and accept drive id or name
Light2Dark Jun 28, 2026
9f18332
Merge pull request #8 from Light2Dark/sham/validate-drive-root-consis…
Light2Dark Jun 28, 2026
e87c16e
update image, add service account docs
Light2Dark Jun 28, 2026
70f987f
Merge pull request #9 from Light2Dark/update-contributing-and-image
Light2Dark Jun 28, 2026
c24cf01
add unit tests, break up into folders, add integration tests
Light2Dark Jun 28, 2026
fc65ce8
address review feedback on test suite
Light2Dark Jun 28, 2026
3fee9af
Merge pull request #10 from Light2Dark/sham/add-tests
Light2Dark Jun 28, 2026
103ad3a
add docstring for main funcs
Light2Dark Jun 29, 2026
5953069
Merge pull request #12 from Light2Dark/sham/add-docstrings
Light2Dark Jun 29, 2026
788d3dc
add templates
Light2Dark Jun 29, 2026
230a16d
95% coverage
Light2Dark Jun 29, 2026
de41a17
Merge pull request #13 from Light2Dark/sham/add-templates
Light2Dark Jun 29, 2026
c6764f1
Merge pull request #14 from Light2Dark/sham/enforce-coverage
Light2Dark Jun 29, 2026
43be0bf
remove unecessary name
Light2Dark Jun 29, 2026
e20e982
Merge pull request #16 from Light2Dark/sham/typos
Light2Dark Jun 29, 2026
475f9e2
Tighten typing in core.py and align with fsspec API
Light2Dark Jun 29, 2026
4f92025
Add typed Drive schemas, FileInfo TypedDict, and ls overloads
Light2Dark Jun 29, 2026
f47f6f8
Address PR review: normalize PathLike in _rm and GoogleDriveFile
Light2Dark Jun 29, 2026
2157bf2
Merge pull request #17 from Light2Dark/sham/typing-cleanup-core
Light2Dark Jun 29, 2026
12d411d
Fix export() and validate export MIME types
Light2Dark Jun 29, 2026
ef644a4
Restore srv deprecated-alias property and its test
Light2Dark Jun 29, 2026
cd2964c
Merge pull request #47 from Light2Dark/sham/fix-export
Light2Dark Jun 29, 2026
5e37a04
Update existing files in place instead of creating duplicates (#22)
Light2Dark Jun 29, 2026
4d28bac
Reject directory targets on wb open; tighten info typing
Light2Dark Jun 29, 2026
1e1d540
Merge pull request #48 from Light2Dark/sham/fix-overwrite-duplicate
Light2Dark Jun 29, 2026
a57ae42
Merge remote-tracking branch 'upstream/master'
Light2Dark Jun 30, 2026
44bec38
Merge pull request #50 from Light2Dark/sham/merge
Light2Dark Jun 30, 2026
70f0ec1
Fix discard() and broken multi-chunk resumable uploads (#31)
Light2Dark Jun 29, 2026
d28e211
Address review: harden Range parsing, force supportsAllDrives, assert…
Light2Dark Jun 29, 2026
874fdfd
Raise on a 308 to the finalizing PUT instead of silently not committing
Light2Dark Jun 30, 2026
c321750
add a comment, and do a small test cleanup
Light2Dark Jul 2, 2026
2461e7f
Merge pull request #51 from Light2Dark/sham/cleanup-test
Light2Dark Jul 2, 2026
d4c9fcc
check for perms first before delete
Light2Dark Jul 2, 2026
8696e3c
fix cache stashing and retrieval
Light2Dark Jul 3, 2026
dc9f241
raise error on detail
Light2Dark Jul 3, 2026
a6b324b
reduce roundtrip
Light2Dark Jul 3, 2026
5b3b769
Merge pull request #53 from Light2Dark/sham/fix-cache
Light2Dark Jul 3, 2026
a87b53a
Merge branch 'master' into sham/fix-rm-perms
Light2Dark Jul 3, 2026
50a4748
Fix merged-in rm tests for permission-aware _rm
Light2Dark Jul 3, 2026
082b620
Address review: kwargs collision, blank fields, root delete guard
Light2Dark Jul 3, 2026
f7f4f3a
Merge pull request #52 from Light2Dark/sham/fix-rm-perms
Light2Dark Jul 3, 2026
309fa5a
rm to trash by default
Light2Dark Jul 7, 2026
46b8fcc
address comments
Light2Dark Jul 7, 2026
d6ffe25
remove rm_file implementation
Light2Dark Jul 7, 2026
202a88b
Merge pull request #54 from Light2Dark/add-rm-trash-by-default
Light2Dark Jul 7, 2026
bd8e302
update references
Light2Dark Jul 8, 2026
1bd563b
Merge pull request #56 from marimo-team/sham/update-template-repo
Light2Dark Jul 8, 2026
0f74e1c
change from master
Light2Dark Jul 8, 2026
5a7b6e1
Merge pull request #57 from marimo-team/sham/switch-refs-to-main
Light2Dark Jul 8, 2026
faf7cbc
add multiple profiles testing (#58)
Light2Dark Jul 8, 2026
d41c59a
Retry transient Drive API errors on discovery-client calls (#59)
Light2Dark Jul 8, 2026
73c0650
Retry transient failures on hand-rolled resumable uploads (#60)
Light2Dark Jul 8, 2026
75c82a6
add demo notebook (#61)
Light2Dark Jul 9, 2026
9c1a8ba
Drive-native path resolution, targeted lookups, and opt-in cache sync…
Light2Dark Jul 13, 2026
44e5687
Split core.py into modules and tighten typing (#63)
Light2Dark Jul 13, 2026
a207313
Export Google-native files on read (#64)
Light2Dark Jul 14, 2026
651791d
Add native server-side copy (cp_file) (#65)
Light2Dark Jul 15, 2026
59f792c
Speed up integration tests with session fixtures and pytest-xdist (#66)
Light2Dark Jul 15, 2026
d30c3bb
Add native move / rename (mv)
Light2Dark Jul 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .agents/verifying-drive-api-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Verifying Google Drive API parameters

When adding or changing a Drive API call, **verify each parameter against the
live discovery document** before trusting it. Do not rely on:

- **Type stubs** (`googleapiclient-stubs`). Most methods are typed
`def method(self, *, fileId, ..., **kwargs)`. The `**kwargs` swallows *any*
keyword, so the stub accepting `supportsAllDrives=True` proves only that
Python won't raise — not that the API supports the parameter.
- **Human docs / blog posts / memory.** They lag, omit per-method differences,
and frequently copy a parameter (like `supportsAllDrives`) onto methods that
don't actually take it.

The discovery document is the source of truth: the Python client is generated
from it, and it lists the exact parameters each method accepts.

## How to check

```bash
# Fetch once
curl -s "https://www.googleapis.com/discovery/v1/apis/drive/v3/rest" -o drive_v3.json

# List the accepted parameters for a given method, e.g. files.export
uv run python -c "
import json
d = json.load(open('drive_v3.json'))
m = d['resources']['files']['methods']['export'] # <resource>.methods.<method>
print(sorted(m.get('parameters', {}).keys()))
"
```

Swap `'files'` / `'export'` for the resource and method you care about
(`files.get`, `files.list`, `files.create`, `drives.list`, ...).

To see a parameter's type / required-ness / description:

```bash
uv run python -c "
import json
d = json.load(open('drive_v3.json'))
import pprint; pprint.pprint(d['resources']['files']['methods']['export']['parameters'])
"
```

## Worked example (the bug this guide came from)

```
files.export -> ['fileId', 'mimeType'] # NO supportsAllDrives
files.get -> ['acknowledgeAbuse', 'fileId', 'includeLabels',
'includePermissionsForView', 'supportsAllDrives',
'supportsTeamDrives'] # has it
```

`files.export`/`export_media` accept **only** `fileId` and `mimeType`. Passing
`supportsAllDrives=True` was silently serialized as an ignored query param —
no error, mocked tests still passed — but it was wrong. `files.get` *does*
take it, which is why it's correct elsewhere in the code. Per-method
differences like this are exactly what the discovery doc catches and stubs hide.

## Checklist when touching a Drive call

1. Find the method: `resources.<resource>.methods.<method>` in the discovery doc.
2. Confirm **every** kwarg you pass is in that method's `parameters`.
3. If a kwarg isn't listed, remove it (it does nothing) or find the right method.
4. Remember mocked unit tests won't catch an unsupported-but-ignored param —
the discovery doc is the only cheap pre-flight check.
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 🐛 Bug report
description: Report a bug or unexpected behavior in gdrive_fsspec
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thank you for contributing to gdrive_fsspec! ✊
Please provide as much information as possible to help us reproduce and fix your issue quickly.
- type: checkboxes
id: checks
attributes:
label: Initial Checks
description: Just making sure we're on the same page.
options:
- label: I'm using the [latest version](https://github.com/marimo-team/gdrive-fsspec/releases/latest) of gdrive_fsspec
required: true
- label: I've searched for my issue in [the issue tracker](https://github.com/marimo-team/gdrive-fsspec/issues) before opening this issue
required: true
- type: textarea
id: description
attributes:
label: Description
description: |
Please explain what you're seeing and what you would expect to see.
- **A line of code is worth a thousand words**: you can include a minimal, reproducible example below.
validations:
required: true
- type: textarea
id: example
attributes:
label: Minimal, Reproducible Example
description: >
If at all possible, please add a self-contained,
[minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)
that demonstrates the bug.
(This will be automatically formatted as code, so no need for backticks.)
placeholder: |
from gdrive_fsspec import GoogleDriveFileSystem

fs = GoogleDriveFileSystem(
token="browser",
skip_instance_cache=True
)
...
render: Python
- type: textarea
id: version
attributes:
label: Python, gdrive_fsspec & fsspec version
description: |
Which version of Python, gdrive_fsspec, and fsspec are you using?
value: |
- Python:
- gdrive_fsspec:
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Questions & Discussions
url: https://github.com/marimo-team/gdrive-fsspec/discussions
about: Have a question or want to discuss an idea? Start a discussion here instead of opening an issue.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 🚀 Feature Request
description: "Suggest a new feature for gdrive_fsspec"
labels: ["feature"]
body:
- type: markdown
attributes:
value: Thank you for contributing to gdrive_fsspec! ✊
- type: textarea
id: description
attributes:
label: Description
description: |
Please give as much detail as possible about the feature you would like to suggest. 🙏
You might like to add:
* A demo of how code might look when using the feature
* Your use case(s) for the feature
* Reference to other projects that have a similar feature
validations:
required: true
- type: textarea
id: references
attributes:
label: References
description: |
Please add any links or references that might help us understand your feature request better. 📚
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Summary

Fixes #

## Checklist

- [ ] Tests added/updated for new behavior
- [ ] Docstrings use RST double backticks for inline code (e.g. ``drive``, not `drive`)
51 changes: 45 additions & 6 deletions .github/workflows/tests.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [master]
branches: [main]
pull_request:
workflow_dispatch:

Expand All @@ -25,8 +25,25 @@ jobs:

- uses: ./.github/actions/setup

# pyrefly-check uses language: system and expects pyrefly on PATH.
- name: Run pre-commit
run: uvx pre-commit run --all-files
run: PATH="$PWD/.venv/bin:$PATH" uvx pre-commit run --all-files

typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false

- uses: ./.github/actions/setup
with:
python-version: "3.13"

- name: Run pyrefly
run: uv run pyrefly check --output-format=github

test:
name: Test (Python ${{ matrix.python-version }})
Expand All @@ -49,14 +66,34 @@ jobs:
- name: Run unit tests
run: uv run pytest -v

coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: ./.github/actions/setup
with:
python-version: "3.13"

- name: Run tests with coverage
run: |
uv run pytest \
--cov=gdrive_fsspec \
--cov-report=term-missing \
--cov-report=xml \
--cov-fail-under=95

integration:
name: Integration tests
runs-on: ubuntu-latest
# Run only when Drive credentials are available: manual dispatch, pushes to
# master, or PRs from this repo (fork PRs are skipped — they cannot use secrets).
# main, or PRs from this repo (fork PRs are skipped — they cannot use secrets).
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository)
timeout-minutes: 15
Expand All @@ -75,6 +112,8 @@ jobs:

- name: Run integration tests
env:
GDRIVE_FSSPEC_DRIVE: gdrivefs-testing
GDRIVE_FSSPEC_CREDENTIALS_PATH: ${{ secrets.GDRIVE_FSSPEC_CREDENTIALS_PATH }}
run: uv run pytest -v -m integration
GDRIVE_FSSPEC_DRIVE_FULL_ACCESS: drive-full-access
GDRIVE_FSSPEC_DRIVE_CONTENT_MANAGER: drive-test
GDRIVE_FSSPEC_DRIVE_READONLY: drive-readonly
run: uv run pytest -v -m integration -n auto --dist loadgroup
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ uv.lock

/src/gdrive_fsspec/_version.py
/tmp/*
.DS_Store
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ repos:
args: [--fix, --show-fixes]
- id: ruff-format
types_or: [python]
- repo: https://github.com/facebook/pyrefly-pre-commit
rev: 1.1.1 # Note: this is the version of the pre-commit hook, NOT the pyrefly version used for type checking
hooks:
- id: pyrefly-check
name: Pyrefly (type checking)
pass_filenames: false # Recommended to do full repo checks. However, you can change this to `true` to only check changed files
language: system # Use system-installed pyrefly
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Set up the environment as described in [CONTRIBUTING.md](CONTRIBUTING.md).

To verify Google Drive APIs, refer to [verifying-drive-api-params.md](.agents/verifying-drive-api-params.md).
Loading
Loading