Skip to content

Migrate transport to httpx (requests to httpx)#444

Merged
TKIPisalegacycipher merged 231 commits into
mainfrom
migrate/httpx
Jul 8, 2026
Merged

Migrate transport to httpx (requests to httpx)#444
TKIPisalegacycipher merged 231 commits into
mainfrom
migrate/httpx

Conversation

@TKIPisalegacycipher

Copy link
Copy Markdown
Collaborator

Merges the httpx transport rewrite into main, preserving both histories.

  • read-tree merge: tree = httpx, main+httpx both in ancestry
  • X-Request-Id-on-5xx cherry-picked (18e47b1)
  • GA release pipeline restored (deleted by httpx-wins merge)
  • Version still beta (4.3.0b1); GA regen to 4.3.0 / 1.72.0 follows on main after merge

Merge with a MERGE COMMIT, not squash/rebase, to preserve the 2-parent history.

TKIPisalegacycipher and others added 30 commits May 4, 2026 11:06
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eate baseline dir

- Add pytest-json-report to dev dependency group
- Fix stale FILE_ORDER entries: test_pagination_iterator_policy_objects_*.py -> test_iterator_*.py
- Create tests/integration/baseline/ with README documenting regression gate purpose
…estions, reframe truths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 8 unit tests + 2 property-based (hypothesis) roundtrip tests
- Tests import from meraki.encoding which does not exist yet (RED)
- hypothesis>=6.122.0 added to dev dependencies
- Pure urllib.parse-based encoding, zero requests dependency
- Supports str/bytes/file-like passthrough, dict, list-of-tuples
- Array-of-objects encoding (Meraki-specific key concatenation)
- All 11 tests pass (8 unit + 1 no-requests + 2 hypothesis roundtrip)
dependabot Bot and others added 27 commits June 10, 2026 18:32
…dates (#395)

Bumps the all-deps group with 2 updates in the / directory: [ruff](https://github.com/astral-sh/ruff) and [hypothesis](https://github.com/HypothesisWorks/hypothesis).


Updates `ruff` from 0.15.15 to 0.15.16
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.15...0.15.16)

Updates `hypothesis` from 6.155.1 to 6.155.2
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@v6.155.1...v6.155.2)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.155.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
- dependency-name: ruff
  dependency-version: 0.15.16
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
test_delete_network retries createOrganizationActionBatch up to 5 times,
but action batches are asynchronous: a prior attempt's batch can finish
deleting the network after the test stops polling. The next attempt then
hits 400 "Network not found", flaking the suite (#393, #394, #395).

A delete is idempotent, so a 400 not-found on the create call means the
network is already gone, which is the desired end state. Catch it and
return success in both the sync and async lifecycle tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: GitHub Action <support@meraki.com>
… push (#402) (#404)

create-release.yml's "Build changelog" step rendered CHANGELOG.md and pushed
the commit straight to the release branch (main/beta/httpx). Those branches
require status checks, and a bot commit pushed directly has none, so the push
was rejected with GH013 (run 27302232244):

    remote: error: GH013: Repository rule violations found for refs/heads/httpx
    - 9 of 9 required status checks are expected.

The step also ran unconditionally, so it fired even when the release already
existed and "Create release" was skipped. The changelog edit never fails the
checks; it just never reached them.

Move the towncrier build into regenerate-library.yml, right after the version
bump, so the rendered CHANGELOG.md and consumed fragments ride the regeneration
PR through its required checks (towncrier is in the dev group, already synced).
Drop the push step from create-release.yml; the changelog is on the branch
before the release is cut.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The "Build changelog" step that pushed to the branch was removed in #402, so
this workflow no longer writes to contents. Update the stale header comment and
lower permissions from contents: write to contents: read (checkout + the
gh release view read are read-only; the release itself uses the App token).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…#406)

httpx's copy lagged main: missing the 'release already exists'
short-circuit and pinned create-github-app-token@v2. Sync to main's
exact content so a workflow_dispatch against httpx runs identical
release logic. The httpx-prerelease guard and httpx trigger entry are
preserved (main carries them too). File-level sync only.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These workflows are only ever executed from the default branch (main):

- create-release.yml      (workflow_run + dispatch; workflow_run always
                           uses main's copy, and dispatch automation passes
                           no --ref so it also runs main's)
- regenerate-library.yml  (dispatch only; main's copy is the sole
                           orchestrator and checks out httpx via ref:)
- publish-release.yml     (release + dispatch; release event uses main's copy)
- watch-openapi-release.yml (schedule + dispatch; schedule only fires on
                           the default branch)

Their httpx copies could never fire from automation and had drifted into
a stale, superseded architecture, making a manual dispatch actively
harmful. Single-source them on main. Branch-scoped workflows (test-pr,
test-library, test-library-generator, dependabot-auto-merge) are kept.
(httpx has no enable-early-access.yml.)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: GitHub Action <support@meraki.com>
…oup (#412)

Bumps the all-deps group with 1 update: [ruff](https://github.com/astral-sh/ruff).


Updates `ruff` from 0.15.16 to 0.15.17
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.16...0.15.17)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.17
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#416)

Bumps the all-deps group with 1 update: [pytest](https://github.com/pytest-dev/pytest).


Updates `pytest` from 9.0.3 to 9.1.0
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@9.0.3...9.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the all-deps group with 1 update: [hypothesis](https://github.com/HypothesisWorks/hypothesis).


Updates `hypothesis` from 6.155.2 to 6.155.3
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@v6.155.2...v6.155.3)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.155.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <support@meraki.com>
Bumps the all-deps group with 3 updates: [pytest](https://github.com/pytest-dev/pytest), [ruff](https://github.com/astral-sh/ruff) and [hypothesis](https://github.com/HypothesisWorks/hypothesis).


Updates `pytest` from 9.1.0 to 9.1.1
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@9.1.0...9.1.1)

Updates `ruff` from 0.15.17 to 0.15.18
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.17...0.15.18)

Updates `hypothesis` from 6.155.3 to 6.155.6
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@v6.155.3...v6.155.6)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.1.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
- dependency-name: ruff
  dependency-version: 0.15.18
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
- dependency-name: hypothesis
  dependency-version: 6.155.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the all-deps group with 1 update: [hypothesis](https://github.com/HypothesisWorks/hypothesis).


Updates `hypothesis` from 6.155.6 to 6.155.7
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@v6.155.6...v6.155.7)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.155.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <support@meraki.com>
…oup (#430)

Bumps the all-deps group with 1 update: [ruff](https://github.com/astral-sh/ruff).


Updates `ruff` from 0.15.18 to 0.15.19
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.18...0.15.19)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.19
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…oup (#434)

Bumps the all-deps group with 1 update: [ruff](https://github.com/astral-sh/ruff).


Updates `ruff` from 0.15.19 to 0.15.20
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.19...0.15.20)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.20
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <support@meraki.com>
Bumps the all-deps group with 1 update: [hypothesis](https://github.com/HypothesisWorks/hypothesis).


Updates `hypothesis` from 6.155.7 to 6.156.1
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@v6.155.7...v6.156.1)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.156.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <support@meraki.com>
Bumps the all-deps group with 1 update: [hypothesis](https://github.com/HypothesisWorks/hypothesis).


Updates `hypothesis` from 6.156.1 to 6.156.3
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@v6.156.1...v6.156.3)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.156.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Wire two new optional session args/config items, meraki_app_id and
meraki_app_bearer_token, through DashboardAPI/AsyncDashboardAPI into both
sync and async sessions. Each falls back to the MERAKI_APP_ID /
MERAKI_APP_BEARER_TOKEN environment variable and is capped at 127
characters via a shared validator.

When populated, they are sent as the X-MerakiApp and
X-MerakiApp-Authorization (Bearer-prefixed) headers; unpopulated values
are omitted entirely. The bearer token is masked in the session-init log.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire two new optional session args/config items, meraki_app_id and
meraki_app_bearer_token, through DashboardAPI/AsyncDashboardAPI into the
shared SessionBase. Each falls back to the MERAKI_APP_ID /
MERAKI_APP_BEARER_TOKEN environment variable and is capped at 127
characters via a shared validator.

When populated, they are sent as the X-MerakiApp and
X-MerakiApp-Authorization (Bearer-prefixed) headers via _build_headers;
unpopulated values are omitted entirely. The bearer token is masked in
the session-init log.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	.github/workflows/publish-release.yml
#	.github/workflows/regenerate-library.yml
#	CHANGELOG.md
#	docs/generation-report.md
#	examples/ssid_tool/ssid_tool.py
#	generator/generate_library.py
#	generator/generate_stubs.py
#	meraki/__init__.py
#	meraki/_version.py
#	meraki/aio/api/appliance.py
#	meraki/aio/api/devices.py
#	meraki/aio/api/organizations.py
#	meraki/aio/api/wireless.py
#	meraki/aio/rest_session.py
#	meraki/api/appliance.py
#	meraki/api/batch/appliance.py
#	meraki/api/batch/devices.py
#	meraki/api/batch/networks.py
#	meraki/api/batch/organizations.py
#	meraki/api/batch/switch.py
#	meraki/api/batch/wireless.py
#	meraki/api/devices.py
#	meraki/api/organizations.py
#	meraki/api/wireless.py
#	meraki/config.py
#	meraki/rest_session.py
#	pyproject.toml
#	tests/integration/test_client_crud_lifecycle_async.py
#	tests/unit/test_rest_session.py
#	uv.lock
Forward-port of #420 to the httpx branch. The session refactor moved 5xx
handling into SessionBase._handle_server_error (sync) and the inline async
dispatch, so the warning now includes the X-Request-Id and a new
_log_server_error_exhausted helper logs it at error level once retries are
exhausted. Async unifies on APIError (no AsyncAPIError) and tests target the
new meraki/session/ paths and _client.request mocks.

When the header is absent, "none" is logged in its place.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The httpx branch deleted create-release, publish-release, regenerate-library,
watch-openapi-release, and enable-early-access (commit 1f84868) because they
only run on the default branch and were dead weight on a non-default branch.
Now that httpx's tree becomes main, these must be restored or main loses all
release/regenerate/publish automation. Main's copies are transport-agnostic
(git/gh/generator only), so they apply cleanly onto the httpx transport.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The implementation plan for merging httpx into main (history-preserving
read-tree merge, x-request-id cherry-pick, release-pipeline restore) plus the
root-cause appendix for the beta/dev PyPI publish outage (release-triggered
workflows run from the tag's tree, not the default branch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread meraki/aio/__init__.py
networks = await self.organizations.getOrganizationNetworks(org_id, total_pages="all", perPage=1000)
for net in networks:
rate_limiter.register_network(net["id"], org_id)
except Exception:
Comment thread meraki/aio/__init__.py
for device in devices:
if device.get("serial"):
rate_limiter.register_device(device["serial"], org_id)
except Exception:
Comment thread meraki/__init__.py
networks = self.organizations.getOrganizationNetworks(org_id, total_pages="all", perPage=1000)
for net in networks:
rate_limiter.register_network(net["id"], org_id)
except Exception:
Comment thread meraki/__init__.py
for device in devices:
if device.get("serial"):
rate_limiter.register_device(device["serial"], org_id)
except Exception:
responses = endpoint[
"responses"
] # not actually used here for library generation
description = endpoint.get("summary", endpoint.get("description", ""))
@TKIPisalegacycipher TKIPisalegacycipher merged commit 572c50e into main Jul 8, 2026
16 of 18 checks passed
@TKIPisalegacycipher TKIPisalegacycipher deleted the migrate/httpx branch July 8, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant