Repository navigation
bug: ignore non-deployment entries in the project's live directory - #677
Martin-Molinero merged 4 commits into
Conversation
…tory name format - A deployment made with `--output live/<name>` was skipped by the name parser, so a newer local deployment lost to an older cloud one. Fall back to the result file's mtime when the name is not a timestamp. - Converting a parseable but pre-1970 name to UTC raises OSError on Windows; catch it instead of aborting the deploy. - Move the directory name parser to `output_config_manager` and reuse it from `optimize.py` and `live_utils.py`, with the format in `OUTPUT_DIRECTORY_NAME_FORMAT`. - Log ignored entries at debug level, and test `_get_last_portfolio` directly with a state file so "ignored" and "still read" differ.
|
Thanks for the fix. I pushed a follow-up commit (d2c9a37) on top of it. Cases that still failed with the previous commit
The test could not catch these: its deployment directory was empty, so What changed
The |
On Linux and macOS the name converts to UTC and is just an older deployment, so nothing is logged for it. Assert only that the newer deployment's state is still returned.
|
Pushed 96ae80c to fix CI: the |
On Python 3.9 and 3.10 mock.patch resolves the dotted path with getattr, and lean.commands.live is the click group there, not the package.
|
Pushed eb2f4ea for the Python 3.9 failure: |
|
Thanks for the follow-ups, @jhonabreul. I read d2c9a37, 96ae80c and eb2f4ea: matching only the timestamped deployment entries covers the --output live/ case I missed, and the notes on the Windows-only timestamp conversion and the Python 3.9 mock.patch behavior are useful for the next tests I write. |
Closes #676.
lean live deployandlean cloud live deployaborted withtime data '.DS_Store' does not match format '%Y-%m-%d_%H-%M-%S'when<project>/livecontained an entry that isn't a deployment timestamp, like a Finder.DS_Storeor a directory from an earlier--output._get_last_portfolionow skips the entries whose name doesn't parse, asis_backtest_output_directoryinoptimize.pyalready does. Deployment directories are read as before..DS_Storefile and a custom directory next to a real deployment) that runslean live deploy. It fails on master and passes with the fix.pytest tests/commands/test_live.py tests/commands/cloud/livepasses (1553 passed, 18 skipped, Python 3.12) andpython static_analysis.pyis clean.🤖 Generated with Claude Code