Skip to content

Substitute using values from env vars / Soften detection of missing values#5

Merged
anandjoshi91 merged 4 commits into
anandjoshi91:masterfrom
aturetta:master
Feb 22, 2023
Merged

Substitute using values from env vars / Soften detection of missing values#5
anandjoshi91 merged 4 commits into
anandjoshi91:masterfrom
aturetta:master

Conversation

@aturetta
Copy link
Copy Markdown
Contributor

The spring property loading resolves values from environment, so I couldn't use this module in my app because it always failed with key not found exception

I refactored a bit the recursive substitution to achieve:

  • missing values do not throw exceptions
  • as last resort, try finding values from environment vars (optional)

I also updated the test properties-file and test.py to demonstrate the updated code

aturetta and others added 4 commits February 13, 2023 14:52
defaults to false for backward compatibility
collect missing keys instead of throwing exception
remove python version from command
Copy link
Copy Markdown
Owner

@anandjoshi91 anandjoshi91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anandjoshi91 anandjoshi91 merged commit 35f5d90 into anandjoshi91:master Feb 22, 2023
@anandjoshi91
Copy link
Copy Markdown
Owner

anandjoshi91 commented Feb 23, 2023

Thanks @aturetta for the PR. It's merged and available on https://pypi.org/project/property/ (v2.6)

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.

2 participants