Repository navigation
feat(files): the five public-file endpoints for Python, plus the Files route tests - #2
Merged
Merged
Conversation
…he API Files docs page - hub/files.py had no test_files_integration (POST /files/integrations/test). The shared contract already has it, so the generated module was out of date; added sync and async in the same shape the generator produces. - The generated Files tests only check the HTTP verb and that the address starts with https, so a method pointed at the wrong path would still pass. Adds tests/test_files_routes.py: one case per endpoint (12 hub, 8 public API) that checks the path itself and the values sent. - docs/api/files.md did not exist. docs/hub/files.md was missing get_folder_files, get_file and test_files_integration. Both fixed, with the module counts in the two index pages. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Slice PUB gave the gateway public file links. This brings them into the Python SDK, sync and async: - hub.files.make_file_public / make_file_private / make_folder_public / make_folder_private - api.files.get_public_file — sends NO Authorization header and gives back the file's raw bytes Two transport additions the public link needs to work at all: - response_type="binary". send() parsed every body as JSON, so a method that answers with a file could only ever hand back its text. download_file_api has the same blind spot today — reported, not fixed here. - follow_redirects. httpx does not follow redirects by default, so when the provider signs its own link (S3, Azure, Google Cloud) the 302 came back as an empty body and looked like an empty file. One test pins this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The SDK coverage matrix (sdks/tests/coverage/build_matrix.py) decides
"implemented" by searching each SDK's source for the gateway's route string,
verbatim and case-sensitive. The gateway declares the public file link as
/{version}/files/public/{PublicId}/{Name*}; this SDK writes {publicId}/{name},
so the endpoint read as missing even though the method is there and tested.
The route is now written out next to the method exactly as the gateway spells
it. That is also the thing a reader wants when checking the two agree
(knowledge.md K23 — an SDK is only covered when its routes are compared
against the gateway's).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the five public-file addresses that slice PUB opened in the gateway (make a file or a folder public, make them private again, and read a public file without signing in) to the Python SDK, together with the two new file fields
public_urlandis_public, and the documentation page that goes with them.get_public_filedeliberately sends noAuthorizationheader even when the client it is called on is signed in. It also carries slice SDK's commit, which was never merged on its own: the missingtest_files_integrationmethod, the first real Files route tests, and the API Files documentation page.Test evidence — run in the worktree after rebasing on
origin/main:uv run pytest— 595 tests passed, 0 failed.make typecheck(mypy oversrc) — Success: no issues found in 36 source files.10 files changed, 873 insertions, 2 deletions. The rebase was clean, no conflicts.
Report:
docs/tasks/sdk-2-pull-requests.mdinnorbix-code/cli, landing with the CLI pull request of this set.🤖 Generated with Claude Code