Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions recipes/mojo-dotenv/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
context:
version: "0.2.1"

package:
name: mojo-dotenv
version: ${{ version }}

source:
git: https://github.com/DataBooth/mojo-dotenv
tag: v${{ version }}

build:
number: 0
noarch: generic
script:
- mkdir -p $PREFIX/lib/mojo/dotenv
- cp -r src/dotenv/* $PREFIX/lib/mojo/dotenv/

requirements:
host:
- max >=25.1.0
run:
- max >=25.1.0

tests:
- script:
- test -f $PREFIX/lib/mojo/dotenv/__init__.mojo
- test -f $PREFIX/lib/mojo/dotenv/parser.mojo
- test -f $PREFIX/lib/mojo/dotenv/loader.mojo
- test -f $PREFIX/lib/mojo/dotenv/finder.mojo

about:
homepage: https://github.com/DataBooth/mojo-dotenv
repository: https://github.com/DataBooth/mojo-dotenv
documentation: https://github.com/DataBooth/mojo-dotenv/blob/main/README.md
license: MIT
license_file: LICENSE
summary: Load environment variables from .env files in Mojo
description: |
A production-ready .env file parser and loader for Mojo with near-100% python-dotenv compatibility.

Features:
- Parse .env files to Dict or load into environment
- Variable expansion (${VAR} and $VAR syntax)
- Multiline values and escape sequences
- Auto-discovery with find_dotenv()
- 98%+ compatible with python-dotenv
- 49 comprehensive tests using Mojo's TestSuite framework
13 changes: 13 additions & 0 deletions recipes/mojo-dotenv/test.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from dotenv import dotenv_values, load_dotenv

fn main() raises:
# Basic smoke test
print("Testing mojo-dotenv import...")

# Test that functions exist and are callable
# Note: We can't actually load files in the test environment
# but we can verify the functions are importable
print("✓ dotenv_values imported")
print("✓ load_dotenv imported")

print("All import tests passed!")