docs: use tigris-boto3-ext in Python rename examples#455
Conversation
Replaces the manual before-sign.s3.CopyObject event registration with the rename_object helper and TigrisRename context manager from tigris-boto3-ext, which scopes the X-Tigris-Rename header to the intended calls and is easier to read. Assisted-by: Claude Opus 4.7 (1M context) via Claude Code
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR replaces the manual
Confidence Score: 4/5Safe to merge after fixing the python_version marker in requirements.txt. One P1 defect: the wrong Python version marker for tigris-boto3-ext in requirements.txt would cause an install failure for Python 3.8 users. The rest of the changes are clean and correct. examples/python/requirements.txt — wrong python_version marker for tigris-boto3-ext. Important Files Changed
Reviews (1): Last reviewed commit: "docs: use tigris-boto3-ext in Python ren..." | Re-trigger Greptile |
| python-dateutil==2.9.0.post0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2' | ||
| s3transfer==0.11.2; python_version >= '3.8' | ||
| six==1.17.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2' | ||
| tigris-boto3-ext==0.3.0; python_version >= '3.8' |
There was a problem hiding this comment.
The Python version marker for
tigris-boto3-ext here says >= '3.8', but the Pipfile.lock resolves the package with python_version >= '3.9'. If a user on Python 3.8 installs from this file, pip will attempt to install tigris-boto3-ext==0.3.0, but the package itself requires Python 3.9+, causing a hard install failure.
| tigris-boto3-ext==0.3.0; python_version >= '3.8' | |
| tigris-boto3-ext==0.3.0; python_version >= '3.9' |
| pairs = [ | ||
| ("a.txt", "renamed-a.txt"), | ||
| ("b.txt", "renamed-b.txt"), | ||
| ("c.txt", "renamed-c.txt"), | ||
| ] | ||
|
|
||
| with TigrisRename(s3): | ||
| for src, dst in pairs: | ||
| s3.copy_object( | ||
| Bucket="my-bucket", | ||
| CopySource=f"my-bucket/{src}", | ||
| Key=dst, | ||
| ) | ||
| ``` |
There was a problem hiding this comment.
Missing context-manager scope warning
The old Python tab included an explicit note that registering the before-sign event affects every copy_object call. TigrisRename scopes that effect to the with block, but the docs don't mention this — users might not realise that any copy_object call made on the same client inside that block is treated as a rename, including incidental copies unrelated to the rename batch.
Summary
before-sign.s3.CopyObjectevent registration in the Python rename docs and runnable example withrename_objectandTigrisRenamefromtigris-boto3-ext.tigris-boto3-exttoexamples/python/requirements.txt,Pipfile, and regeneratedPipfile.lock.Test plan
npm run devand verify the Python tab on/docs/objects/object-rename/renders the new helper / context-manager snippets.examples/python/rename-object.pyagainst a real bucket to confirm the rename succeeds end-to-end.🤖 Generated with Claude Code
Note
Low Risk
Low risk documentation/example-only change; main risk is potential dependency/version drift in the Python example environment due to updated
Pipfile.lock(not production code).Overview
Updates the Python rename-object docs and runnable example to use
tigris-boto3-ext(rename_objecthelper andTigrisRenamecontext manager) instead of manually registering abefore-sign.s3.CopyObjectevent header.Adds
tigris-boto3-extto the Python example dependencies (requirements.txt,Pipfile) and regeneratesPipfile.lock, bringing in updated pinned versions forboto3/related packages in that lockfile.Reviewed by Cursor Bugbot for commit c8f2e75. Bugbot is set up for automated code reviews on this repo. Configure here.