Context ------- Closes out the Trading212 provider's retry + pagination surface so the "Add Trading212Provider core fetch" commit has everything the CronJob needs: cursor-based pagination, 429 honouring Retry-After, jittered exponential backoff for 429-without-header and 5xx, bailout after _MAX_RETRIES, and checkpoint-after-page semantics so a crashed run resumes at the start of the unfinished page. Also pins click<8.2 — typer 0.12 calls Parameter.make_metavar() without a ctx argument, which click 8.2 removed; `broker-sync --help` was crashing with TypeError until this pin. typer 0.15+ would also fix it; the pin is lower friction. One test fix: test_checkpoint_advances_only_after_page_yielded had a handler that unconditionally returned a next_path → infinite loop. The assertion was always about "a cursor was saved after page 1", so I changed the handler to return page 2 as empty-with-no-next, which terminates the loop cleanly. Test plan --------- ## Automated - poetry run pytest -q → 70 passed - poetry run mypy broker_sync tests → Success: no issues found in 29 source files - poetry run ruff check . → All checks passed! - poetry run broker-sync --help → renders without crash; lists version + auth-spike ## Manual Verification End-to-end against a live T212 key is in the next commit once the CLI subcommand and pipeline land.
49 lines
1.1 KiB
TOML
49 lines
1.1 KiB
TOML
[tool.poetry]
|
|
name = "broker-sync"
|
|
version = "0.1.0"
|
|
description = "Sync UK brokerage activity (Trading212, InvestEngine, Schwab, CSV) into Wealthfolio"
|
|
authors = ["Viktor Barzin <viktorbarzin@meta.com>"]
|
|
readme = "pyproject.toml"
|
|
packages = [{ include = "broker_sync" }]
|
|
|
|
[tool.poetry.dependencies]
|
|
python = ">=3.11,<3.13"
|
|
httpx = "^0.27"
|
|
beautifulsoup4 = "^4.12"
|
|
python-dateutil = "^2.9"
|
|
typer = "^0.12"
|
|
click = "<8.2" # typer 0.12 uses make_metavar() without ctx; click 8.2 made ctx required
|
|
|
|
[tool.poetry.group.dev.dependencies]
|
|
pytest = "^8.3"
|
|
pytest-asyncio = "^0.23"
|
|
mypy = "^1.11"
|
|
ruff = "^0.6"
|
|
yapf = "^0.43"
|
|
|
|
[tool.poetry.scripts]
|
|
broker-sync = "broker_sync.cli:app"
|
|
|
|
[build-system]
|
|
requires = ["poetry-core"]
|
|
build-backend = "poetry.core.masonry.api"
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.11"
|
|
strict = true
|
|
files = ["broker_sync", "tests"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py311"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
|
|
|
|
[tool.yapf]
|
|
based_on_style = "pep8"
|
|
column_limit = 100
|