Skip to content

chore: migrate SDK to httpx with full test infrastructure#5

Closed
thoumasd wants to merge 1 commit intodevelopfrom
chore/python-sdk-tooling-setup
Closed

chore: migrate SDK to httpx with full test infrastructure#5
thoumasd wants to merge 1 commit intodevelopfrom
chore/python-sdk-tooling-setup

Conversation

@thoumasd
Copy link
Collaborator

@thoumasd thoumasd commented Mar 4, 2026

Summary

  • Spec: Converted automation-api-specs-1.0.jsonautomation.yaml (OpenAPI 3.1.0, source of truth)
  • Generator: Rewrote generate.sh to be version-aware, use httpx library, clean output before regenerating; added generate-tests.sh to bootstrap test stubs without overwriting existing work
  • Package: Renamed opendatasoft_automationhuwise_automation, switched transport from urllib3 to httpx (async-only)
  • DX: Added ApiClient(host=, api_key=) shorthand and Configuration.from_api_key() — no separate config object needed for the common case
  • Tests: Moved test project to tests/python/ (committed); 350 pytest-style stubs generated; real tests for DatasetMetadataValue (11 tests) and SDK client mode (async + asyncio.run sync entry point with respx mocks)
  • CI/CD: Added .github/workflows/ci.yml (generate → lint → test) and release.yml (generate → test → build → GitHub Release on tag)
  • Tooling: CLAUDE.md, .claude/settings.json, docs/python/README.md
  • Fix: Anchored /python/ in .gitignore to root so generators/python/ and tests/python/ are no longer silently ignored

Test plan

  • ./generators/python/generate.sh runs cleanly with Docker
  • uv --directory tests/python sync --extra dev installs correctly
  • uv --directory tests/python run ruff check . — no errors
  • uv --directory tests/python run ruff format --check . — no reformats needed
  • uv --directory tests/python run pytest — 14 passed, 529 skipped
  • CI workflow passes on push

🤖 Generated with Claude Code

…improve tooling

- Convert OpenAPI spec from JSON to YAML (automation.yaml)
- Switch generated SDK from urllib3 to httpx (async-only client)
- Rename package from opendatasoft_automation to huwise_automation
- Add ApiClient(host=, api_key=) shorthand constructor and Configuration.from_api_key()
- Add Mustache template overrides: pyproject, configuration, api_client, api_test, model_test
- Rewrite generate.sh: version-aware, cleans output dir, suppresses test generation
- Add generate-tests.sh: bootstraps test stubs for new operations without overwriting existing tests
- Move test project to tests/python/ with its own pyproject.toml and uv.lock
- Add pytest-style test stubs for all API operations and models (350 files)
- Add real tests for DatasetMetadataValue (11 tests)
- Add SDK client mode tests proving async and sync (asyncio.run) usage with respx mocks
- Add CI and Release GitHub Actions workflows
- Add CLAUDE.md with project conventions and workflow documentation
- Add .claude/settings.json with allowed/denied operations
- Fix .gitignore: anchor /python/ to root to stop ignoring generators/python/ and tests/python/
- Remove deprecated examples/ and legacy openapi/ spec files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thoumasd thoumasd closed this Mar 6, 2026
@thoumasd thoumasd deleted the chore/python-sdk-tooling-setup branch March 6, 2026 10:09
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