Skip to content

fix: add python-dotenv so .env works without export or sourcing#10

Merged
lassebenni merged 3 commits into
mainfrom
fix/dotenv-loading
Jun 12, 2026
Merged

fix: add python-dotenv so .env works without export or sourcing#10
lassebenni merged 3 commits into
mainfrom
fix/dotenv-loading

Conversation

@lassebenni

Copy link
Copy Markdown
Collaborator

Summary

Students on Windows (Git Bash) or running uv run python -m src.pipeline directly hit a confusing issue: env vars in .env aren't visible to Python unless they manually source .env (with export prefix) first. Docker --env-file worked fine but direct runs didn't.

Fix: add python-dotenv and call load_dotenv() at the top of pipeline.py. The .env file format is unchanged — plain VAR=value, no export needed.

Test plan

  • uv run python -m src.pipeline loads .env without any shell sourcing
  • docker run --env-file .env still works (dotenv is a no-op when vars are already set)
  • CI passes (dotenv has no effect in CI where vars come from secrets)

🤖 Generated with Claude Code

Lasse Benninga and others added 3 commits June 12, 2026 16:01
Pinned tags cause the ACA job to run stale code after updates.
Using :latest ensures every push is picked up automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Students running `uv run python -m src.pipeline` locally now get
env vars loaded automatically from .env — no export prefix needed,
no `source .env` workaround, works on macOS/Linux/Windows Git Bash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Works with source .env, python-dotenv, and docker --env-file.
Removes the need to manually export vars before running locally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lassebenni lassebenni merged commit d4ea67a into main Jun 12, 2026
2 of 4 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