Skip to content

fix: declare python-dotenv dependency#996

Closed
AyushKar2005 wants to merge 1 commit into
TauricResearch:mainfrom
AyushKar2005:fix/add-python-dotenv-dependency
Closed

fix: declare python-dotenv dependency#996
AyushKar2005 wants to merge 1 commit into
TauricResearch:mainfrom
AyushKar2005:fix/add-python-dotenv-dependency

Conversation

@AyushKar2005

Copy link
Copy Markdown

Fixes #994

This PR adds python-dotenv as a direct runtime dependency.

The CLI imports from dotenv in cli/utils.py, specifically find_dotenv, load_dotenv, and set_key. But python-dotenv was not declared directly in pyproject.toml.

Because of that, a clean install could fail at runtime with:

ModuleNotFoundError: No module named 'dotenv'

if no transitive package happens to install it.

What changed

  • Added python-dotenv>=1.0 to pyproject.toml
  • Verified the CLI still compiles
  • Verified the dotenv imports work after installing the package

Why this helps

Since the CLI directly imports dotenv, it should also declare python-dotenv directly instead of relying on some other dependency to bring it indirectly.

This makes clean installs more reliable.

Validation

I ran:

python -m compileall cli
python -m pip install -e .
python -c "from dotenv import find_dotenv, set_key; print('python-dotenv import ok')"

Result:

python-dotenv import ok

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

Copy link
Copy Markdown

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 adds the python-dotenv dependency to pyproject.toml. The reviewer suggested adjusting the placement of this new dependency to maintain the alphabetical sorting of the dependencies list.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pyproject.toml
Comment on lines 22 to +23
"pytz>=2025.2",
"python-dotenv>=1.0",

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

The dependencies list in pyproject.toml is sorted alphabetically. To maintain this order, python-dotenv should be placed before pytz (pyth comes before pytz).

Suggested change
"pytz>=2025.2",
"python-dotenv>=1.0",
"python-dotenv>=1.0",
"pytz>=2025.2",

@Yijia-Xiao

Copy link
Copy Markdown
Member

Thanks @AyushKar2005. python-dotenv is already declared on main (2a58c22); closing as resolved.

@Yijia-Xiao Yijia-Xiao closed this Jun 21, 2026
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.

Bug: python-dotenv is imported by the CLI but not declared as a direct dependency

3 participants