-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Was slated for removal in 2.2 The deprecation of ${env} was handled in issue #573 This addresses issue #821
- Loading branch information
Showing
6 changed files
with
6 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Removed support for `${env}` interpolations. `${oc.env}` should be used instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,5 @@ | ||
import os | ||
import warnings | ||
from typing import Any, Optional | ||
|
||
from omegaconf._utils import decode_primitive | ||
from omegaconf.errors import ValidationError | ||
from omegaconf.resolvers import oc | ||
|
||
|
||
# DEPRECATED: remove in 2.2 | ||
def env(key: str, default: Optional[str] = None) -> Any: | ||
warnings.warn( | ||
"The `env` resolver is deprecated, see https://github.com/omry/omegaconf/issues/573" | ||
) | ||
|
||
try: | ||
return decode_primitive(os.environ[key]) | ||
except KeyError: | ||
if default is not None: | ||
return decode_primitive(default) | ||
else: | ||
raise ValidationError(f"Environment variable '{key}' not found") | ||
|
||
|
||
__all__ = [ | ||
"env", | ||
"oc", | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters