feat: v1.0 SDK rewrite — resource-based API, httpx, pydantic v2#15
Merged
im-voracity merged 27 commits intomasterfrom Mar 26, 2026
Merged
feat: v1.0 SDK rewrite — resource-based API, httpx, pydantic v2#15im-voracity merged 27 commits intomasterfrom
im-voracity merged 27 commits intomasterfrom
Conversation
added 27 commits
March 25, 2026 23:55
…events, negotiation)
- Split long method signatures in club.py and products.py to stay under 120 chars - Fixed E701 in test_auth.py (split for loops to separate lines) - Set line-length = 120 in pyproject.toml (was 100)
- tests/test_integration.py: 30 testes cobrindo auth, sales, subscriptions,
products e coupons contra a API real (requer HOTMART_* env vars)
- Testes pulados automaticamente se credenciais não estiverem configuradas
- .env.example: template de credenciais para novos devs
- _base_client.py: trata HTTP 200 com body vazio como model vazio
(workaround para bug Hotmart em /coupon/product/{id})
- pyproject.toml: registra marker 'integration'
Bugs Hotmart documentados:
- /products/{ucode}/plans retorna HTTP 400 para produtos sem planos (deveria retornar [])
- /coupon/product/{id} retorna HTTP 200 com body vazio (deveria retornar {"items": []})
- checks.yml: migra de Poetry/flake8 para uv/ruff, testa Python 3.10/3.11/3.12 - publish.yml: pipeline tag-triggered com 4 stages: 1. unit tests + lint 2. build (wheel + sdist) 3. publish Test PyPI (automático, environment: test-release) 4. publish PyPI (requer aprovação manual, environment: release)
StrEnum (stdlib) requer 3.11+. Matrix de testes atualizada para 3.11/3.12/3.13.
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.
Summary
client.sales.history(),client.subscriptions.list(), etc.) replacing the monolithicHotmartclassrequestswithhttpx, addspydantic v2for all response modelsuv+hatchlingWhat changed
sales,subscriptions,products,coupons,club,events,negotiationTokenManagerwith double-checked locking (thread-safe) and proactive refresh 5 min before expiry0.5 × 2^attempt + jitter, cap 30s), respectingRateLimit-Reset*_autopaginateiterators on all paginated endpoints_build_params(locals())— kwargs passed directly as query paramsHotmart API bugs documented
6 bugs found during integration testing, documented in
docs/HOTMART-API-BUGS.md:sandbox.hotmart.comhas no DNS record (sandbox environment unreachable)subscriptions?status=CANCELLED_BY_BUYERreturns 400products/{ucode}/plansreturns 400 for products without planscoupon/product/{id}returns 200 with empty bodyclub/studentsreturns 200 empty even with existing membersTest plan
uv run pytest tests/ --ignore=tests/test_integration.py— 67 unit tests passingset -a && source .env && set +a && uv run pytest tests/test_integration.py -v— 27 passed, 2 skipped, 1 xfailed (Hotmart bug)uv run ruff check .— no violations