fix: load .env using find_dotenv with usecwd=True (issue #726)#747
fix: load .env using find_dotenv with usecwd=True (issue #726)#747djconnexion77 wants to merge 1 commit intoTauricResearch:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements configurable alpha benchmarks for non-US tickers, enabling regional performance comparisons (e.g., Nikkei 225 or Hang Seng) instead of defaulting to SPY. It also externalizes news parameters like article limits and look-back periods into DEFAULT_CONFIG, improves .env file discovery using find_dotenv, and introduces a CLAUDE.md guide for contributors. Review feedback recommends expanding the CHANGELOG.md to cover the environment loading fix and news configuration updates, and suggests adding pytest to the development dependencies to simplify the contributor setup.
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
| - Configurable alpha benchmark for non-US tickers. `DEFAULT_CONFIG` now exposes | ||
| `benchmark_ticker` (explicit override) and `benchmark_map` (suffix-based | ||
| auto-detection: `.T` → `^N225`, `.HK` → `^HSI`, `.NS` → `^NSEI`, etc.). | ||
| US tickers continue to use SPY by default. The reflection log now labels | ||
| alpha against the actual benchmark used (e.g. `Alpha vs ^N225`) instead of | ||
| the hardcoded `Alpha vs SPY`. (#628) |
There was a problem hiding this comment.
This pull request includes multiple changes, but the changelog only documents the new configurable alpha benchmark feature. To ensure the changelog is complete and accurate for future releases, please also add entries for the other changes introduced in this PR:
- A
Fixedentry for the.envfile loading issue, as mentioned in the pull request title (fix: load .env using find_dotenv...). - An
AddedorChangedentry for making news-related parameters (ticker_news_count,global_news_look_back_days, etc.) configurable.
| - **Python:** 3.10+ (`.venv/` at project root; this repo runs on 3.13 locally) | ||
| - **Activate:** `source .venv/bin/activate` | ||
| - **Install (editable):** `pip install -e .` | ||
| - **Test runner:** `python -m pytest` (pytest not in `pyproject.toml`; install separately) |
There was a problem hiding this comment.
To improve the developer setup experience, consider adding pytest to the project's development dependencies in pyproject.toml. This would allow new contributors to install all required testing tools with a single command (e.g., pip install -e .[dev]) instead of needing to install pytest separately.
The instruction here could then be simplified.
374977d to
b89497d
Compare
Fixes issue #726: environment variables were not loaded when the CLI is executed via the installed console script. Updated cli/main.py to use find_dotenv(usecwd=True) for both .env and .env.enterprise files.