You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
api_version tests fail on 5.7.0 after the custom code was reverted #2745
The tests expect api_version to fall back to CLOUDFLARE_API_VERSION, an invalid api_version to raise ValueError, and the API-Version header to be omitted when no
version is configured. Cloudflare.__init__ does none of those. It defaults api_version
to datetime.today().strftime("%Y-%m-%d") and always sends the header, so every request
advertises a value like 2026-09-20, which does not match the <date>.<channel> form the
tests describe.
4e822eb ("feat: add API-Version header support") added the implementation and the tests
together. ecdba20 ("chore: revert api_version custom code") reverted the implementation
in _base_client.py, _client.py and _version.py but left the tests, and they have
failed since.
Part of the feature is still generated: 5618be9 ("Update bundle: brapi") put __api_version__ = "" back into _version.py after the revert, so codegen still emits the
symbol while the code that read it is gone.
Was the revert intentional? If the API-Version header is not shipping, the tests should
go too. If it is shipping, the implementation needs to come back, and presumably from the
Stainless config rather than as edits to _client.py, since direct edits are what got
reverted. I have a local branch restoring the reverted code and can open a PR either way,
but I would rather know which direction is wanted first.
To Reproduce
git clone https://github.com/cloudflare/cloudflare-python && cd cloudflare-python
They are the only tests/test_client.py failures in that run. Two things keep them out of
sight: the "Run tests" step sets continue-on-error: true (ci.yml:100), so the job reports
success either way, and the run ends at 2196 failed, 44619 passed, 15898 skipped, 76 errors. Most of the rest are PydanticSchemaGenerationError on workers types and look
unrelated to this.
Activity
mattst88 commentedon Sep 20, 2026
These six also fail in CI on
main, so this is not specific to my setup:https://github.com/cloudflare/cloudflare-python/actions/runs/33923302594 (
testjob,commit 68dc486, Python 3.9.18).
They are the only
tests/test_client.pyfailures in that run. Two things keep them out ofsight: the "Run tests" step sets
continue-on-error: true(ci.yml:100), so the job reportssuccess either way, and the run ends at
2196 failed, 44619 passed, 15898 skipped, 76 errors. Most of the rest arePydanticSchemaGenerationErroron workers types and lookunrelated to this.
mattst88 commentedon Sep 24, 2026
cc: @musa-cf & @ssicard