Skip to content

fix: load .env using find_dotenv with usecwd=True (issue #726)#747

Open
djconnexion77 wants to merge 1 commit intoTauricResearch:mainfrom
djconnexion77:fix-env-loading-726
Open

fix: load .env using find_dotenv with usecwd=True (issue #726)#747
djconnexion77 wants to merge 1 commit intoTauricResearch:mainfrom
djconnexion77:fix-env-loading-726

Conversation

@djconnexion77
Copy link
Copy Markdown

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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CHANGELOG.md Outdated
Comment on lines +9 to +17
## [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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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 Fixed entry for the .env file loading issue, as mentioned in the pull request title (fix: load .env using find_dotenv...).
  • An Added or Changed entry for making news-related parameters (ticker_news_count, global_news_look_back_days, etc.) configurable.

Comment thread CLAUDE.md Outdated
- **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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@djconnexion77 djconnexion77 force-pushed the fix-env-loading-726 branch from 374977d to b89497d Compare May 6, 2026 09:56
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