diff --git a/recipes/mojo-dotenv/recipe.yaml b/recipes/mojo-dotenv/recipe.yaml new file mode 100644 index 00000000..98987798 --- /dev/null +++ b/recipes/mojo-dotenv/recipe.yaml @@ -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 diff --git a/recipes/mojo-dotenv/test.mojo b/recipes/mojo-dotenv/test.mojo new file mode 100644 index 00000000..9e2018e4 --- /dev/null +++ b/recipes/mojo-dotenv/test.mojo @@ -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!")