Skip to content

Rename pwb_toolbox to pwb (paperswithbacktest 0.2.0 = 0.1.57 renamed), with the pwb-toolbox deprecation alias (preparation, do not merge yet) - #103

Merged
edarchimbaud merged 3 commits into
mainfrom
feat/rename-pwb-0156
Dec 1, 2026
Merged

edarchimbaud merged 3 commits into
mainfrom
feat/rename-pwb-0156

Conversation

@edarchimbaud

@edarchimbaud edarchimbaud commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Preparation only: do not merge or publish without Édouard. Supersedes the rename part of #79 (conflicting since #98/#99; its engine runner is already on main). Nothing is published.

What

  • Rename: everything in 0.1.57 (Tradewind by default, PWB_ENGINE=backtrader to go back, load_futures_chain, tradewind>=0.0.4) moves to the import name pwb, distribution paperswithbacktest 0.2.0. Done with git mv (history kept), then main 0.1.57 merged in rather than rebased, to avoid a force-push: futures_chain.py lands under pwb/datasets/. Engine, defaults and NAVs are unchanged.
  • Deprecation alias: compat/pwb-toolbox is the last pwb-toolbox release (0.2.0), Requires-Dist: paperswithbacktest>=0.2.0. Every pwb_toolbox.<module> is the same module object as pwb.<module>: one BaseStrategy, one engine choice, one cache, one DeprecationWarning. python -m pwb_toolbox.engine still works.
  • pwb.backtesting.bt as an import path: from pwb.backtesting import bt, from pwb.backtesting.bt import indicators as btind. It follows PWB_ENGINE; this is the form papers#818 writes.
  • pwb_toolbox_legacy: not in the 0.1.57 wheel either. It has no __init__.py, so packages = find: never picked it up (the PyPI 0.1.57 wheel holds pwb_toolbox/ only). include = pwb, pwb.* therefore drops nothing that was shipped; the directory stays in the repository as before.
  • Kept: ~/.cache/pwb_toolbox/ (no re-download), the PWB_* variables, the repository name.

Checks

  • Full suite with backtrader and Tradewind 0.0.4: 497 passed, 6 skipped. This includes tests/test_compat_shim.py::test_each_release_owns_one_import_name, the wheel-consistency test: the alias requires paperswithbacktest>=<version>, both carry the same version, and their import names are disjoint.
  • Wheels built from this branch: paperswithbacktest-0.2.0 (45 files, pwb/ only, futures_chain.py included); pwb_toolbox-0.2.0 (shim only, Requires-Dist: paperswithbacktest>=0.2.0).
  • Catalogue (papers#818, wheels of the 0.1.56-based state of this branch): 60 cards under Tradewind, NAV before = after within 1e-9 on 58 (57 bit for bit), 2 with the same environment error, 0 divergence.

Publication order (exact), and what breaks if a step is inverted

# step if done earlier / inverted
1 publish paperswithbacktest 0.2.0 (this repository's root; replaces the 0.0.1 placeholder) —
2 publish the alias pwb-toolbox 0.2.0 (compat/pwb-toolbox) before 1: pip install pwb-toolbox==0.2.0 cannot resolve paperswithbacktest>=0.2.0. Any pip install -U pwb-toolbox then fails, or pip falls back to 0.1.57 (unpinned installs).
3 install the alias pwb-toolbox==0.2.0 (it pulls paperswithbacktest) in the Airflow image (website services/airflow/requirements.txt) and on the campaign server, after checking that no DAG run is in progress Installing only paperswithbacktest: website provenance.py reads package_version("pwb-toolbox"), so toolboxVersion becomes unknown, every card's skip guard fails and every card is re-measured on every run. backtester.py (papers and site) and the skills still import pwb_toolbox, and those imports fail. Doing this before 1-2: the install fails.
4 merge paperswithbacktest/tradewind#24 (the codemod tool) It does not depend on the packages (a tool, nothing published), but merging it before 3 invites running its default pwb form on code whose runners have no pwb yet.
5 merge paperswithbacktest/papers#818 (6 541 strategy.py rewritten to import pwb / pwb.backtesting.bt) Before 3: every card fails on import pwb in Airflow and on the campaign server (ModuleNotFoundError), and the monthly run marks the whole catalogue stale. Before 4: the PR names a tool main does not have, so its re-run cannot be reproduced.
6 merge paperswithbacktest/website#781 (engine trial removed, NAV control kept as a monthly drift alert), after the run of 1 Dec 2026 and the reading of its navParityReports Before the end of that run: the run's per-card switch comparison stops mid-run. Cards measured after the deploy are only compared if their version or commit changed, and the report is only mailed above 1 %, so the switch check is lost.

Then, later: drop the alias at 1.0, once the site, docs, Tradewind's live/daily and the server name pwb only.

🤖 Generated with Claude Code

https://claude.ai/code/session_012zrKmQA3f7zJ5y5EL6MNjT

…, with the pwb-toolbox alias

The 0.1.56 code (Tradewind by default, PWB_ENGINE=backtrader to go back) moves to
the import name `pwb`, distributed as `paperswithbacktest` 0.2.0 (`git mv`,
history kept; internal imports, tests and docs rewritten). Nothing about the
engine or the NAVs changes.

* Deprecation alias: compat/pwb-toolbox is the last `pwb-toolbox` release (0.2.0,
  requires paperswithbacktest>=0.2.0). Every `pwb_toolbox.<module>` is the same
  module object as `pwb.<module>` (import hook): one BaseStrategy, one engine
  choice, one cache; one DeprecationWarning; `python -m pwb_toolbox.engine` works.
  Ported from #79 (7d1c99f), licence now Apache-2.0 like the package.
* `pwb.backtesting.bt` is an import path with feeds/indicators/analyzers (from
  #79, e242c9f): the engine-neutral form the catalogue codemod writes
  (paperswithbacktest/tradewind#24); it follows PWB_ENGINE.
* Kept: the cache directory ~/.cache/pwb_toolbox, the PWB_* variables. The
  harness' warning recorder accepts callers from `pwb` and `pwb_toolbox`.

Tests: 486 passed, 6 skipped (backtrader and Tradewind installed), compat shim
included. Nothing is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zrKmQA3f7zJ5y5EL6MNjT
@read-the-docs-community

read-the-docs-community Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 pwb-toolbox | 🛠️ Build #36288394 | 📁 Comparing da4944f against latest (847680d)

  🔍 Preview build  

6 files changed · + 1 added · ± 5 modified

+ Added

± Modified

@edarchimbaud

Copy link
Copy Markdown
Collaborator Author

Relecture indépendante (lecture seule).

  • Alias : testé avec le __init__.py du PR sur un faux pwb : un seul DeprecationWarning, pwb_toolbox.backtesting is pwb.backtesting, from pwb_toolbox.engine import … et python -m pwb_toolbox.engine résolvent le même module, ImportError propre pour un sous-module inexistant.
  • Wheels construits : paperswithbacktest 0.2.0 (44 fichiers, seulement pwb/) et pwb-toolbox 0.2.0 (seulement pwb_toolbox/, Requires-Dist: paperswithbacktest>=0.2.0). Aucune boucle de dépendance, deux noms d'import disjoints. PWB_ENGINE=backtrader : seules des chaînes changent dans engine.py.
  • À corriger avant de fusionner : la branche part de 0.1.56 mais main est à 0.1.57 (PyPI 0.1.57 publié le 30 nov., tradewind>=0.0.4, load_futures_chain). Rebaser, refaire le renommage sur 0.1.57 (le git mv doit suivre) et passer tradewind>=0.0.4, sinon 0.2.0 perd 0.1.57.
  • packages = find: devient include = pwb, pwb.* : pwb_toolbox_legacy n'est plus livré. Voulu ?
  • paperswithbacktest 0.0.1 existe déjà sur PyPI (espace réservé, pwb/__init__.py seul) : 0.2.0 le remplace sans problème.
  • Ordre de publication : paperswithbacktest 0.2.0 d'abord, puis l'alias pwb-toolbox 0.2.0 (sinon sa dépendance ne se résout pas). Le fichier CI ne publie rien : l'envoi est manuel.
  • Côté site : provenance.py lit package_version("pwb-toolbox") ; si l'image n'installe que paperswithbacktest, toolboxVersion devient inconnu et toute fiche est remesurée à chaque run. Installer l'alias, ou lire paperswithbacktest d'abord.

paperswithbacktest 0.2.0 now carries everything in 0.1.57: futures_chain.py
lands under pwb/datasets/, tradewind>=0.0.4, its tests and docs name `pwb`.
Version stays 0.2.0; the changelog keeps the 0.1.57 entry below the 0.2.0 one.

pwb_toolbox_legacy: not in the 0.1.57 wheel either (it has no __init__.py, so
`packages = find:` never picked it up; the PyPI wheel holds pwb_toolbox/ only),
so `include = pwb, pwb.*` drops nothing that was shipped.

Tests: 497 passed, 6 skipped (backtrader and Tradewind 0.0.4 installed),
including the wheel-consistency test (alias requires paperswithbacktest>=0.2.0,
same version, disjoint import names).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zrKmQA3f7zJ5y5EL6MNjT
@edarchimbaud edarchimbaud changed the title Rename pwb_toolbox to pwb (paperswithbacktest 0.2.0) on 0.1.56, with the pwb-toolbox deprecation alias (preparation, do not merge yet) Rename pwb_toolbox to pwb (paperswithbacktest 0.2.0 = 0.1.57 renamed), with the pwb-toolbox deprecation alias (preparation, do not merge yet) Nov 30, 2026
propagate.py lands under pwb/world_model/; the new tests and docs import pwb.
CHANGELOG: the 0.2.0 section carries both changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zrKmQA3f7zJ5y5EL6MNjT
@edarchimbaud

Copy link
Copy Markdown
Collaborator Author

Main (#100 WM9 L2, #104) intégrée par merge (da4944f, pas de force-push, comme le reste de la branche) ; propagate.py sous pwb/world_model/, tests et doc en pwb. CI verte (3.10, 3.12). En local : 514 passed / 6 skipped (Tradewind), 44 passed (backtrader).

Artefacts construits depuis git archive de da4944f, twine check PASSED, dans /tmp/pwb020/ :

6ae4d9e5f6d1c4ba47d171a33339bb620546537eb34e593c63ecde01ee7a9260  paperswithbacktest-0.2.0-py3-none-any.whl
3fb17e744274a74cdc932a6fbb86e68bb1b8f772facb463aa0d8a4bfe4b26e12  paperswithbacktest-0.2.0.tar.gz
a3c6a9bc8dd1484026b8e1cc459330c5c9168bad1ce781526ca5ec4d485f243b  pwb_toolbox-0.2.0-py3-none-any.whl
dc2c3b776cc7cbdb34b76d9bc36afc9b6e32bbd8a098fb0b60d7d53e7ade675f  pwb_toolbox-0.2.0.tar.gz

E2E (venv neuf Python 3.13, dépendances de campagne requirements-0154, les deux wheels locales, tradewind 0.0.4 de PyPI) : import pwb, import pwb_toolbox (DeprecationWarning, mêmes objets module), get_pricing par les deux chemins (identiques) ; 2 cartes réelles (the_optimism_cycle_sell_in_may, how_to_design_a_simple_multi_timeframe_trend_strategy_on_bitcoin) par le harnais papers : NAV ancien import = nouvel import (codemod) = nouvel import sans alias backtrader, bit à bit, 0 module backtrader chargé.

Rien n'est publié ni fusionné.

🤖 Generated with Claude Code

@edarchimbaud
edarchimbaud marked this pull request as ready for review December 1, 2026 07:14
@edarchimbaud
edarchimbaud merged commit 33e6b8f into main Dec 1, 2026
3 checks passed
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