Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add environment variable parsing. #20

Merged
merged 3 commits into from
Dec 16, 2023
Merged

Feature: Add environment variable parsing. #20

merged 3 commits into from
Dec 16, 2023

Conversation

BrianPugh
Copy link
Owner

@BrianPugh BrianPugh commented Dec 14, 2023

Allows for environment variable parsing fallbacks:

@app.default
def foo(bar: Annotated[int, Parameter(env_var="BAR")] = 123):
    pass

The priority order is:

  1. CLI-provided values
  2. Values parsed from Parameter.env_var.
  3. Default values from the function signature.

Addresses #18.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bcabd8f) 92.50% compared to head (537b428) 92.64%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   92.50%   92.64%   +0.14%     
==========================================
  Files          10       10              
  Lines        1080     1102      +22     
  Branches      258      262       +4     
==========================================
+ Hits          999     1021      +22     
  Misses         45       45              
  Partials       36       36              
Flag Coverage Δ
unittests 92.55% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BrianPugh BrianPugh marked this pull request as ready for review December 15, 2023 00:51
@BrianPugh
Copy link
Owner Author

@rbonthond let me know what you think of this.

@rbonthond
Copy link

that works for me, thank you!

@BrianPugh BrianPugh merged commit 7408a13 into main Dec 16, 2023
15 checks passed
@BrianPugh BrianPugh deleted the env-var branch December 16, 2023 00:27
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.

3 participants