diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 78b6a0bf..6f311d97 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,8 +5,16 @@ All notable changes to this project will be documented in this file. The format is inspired by `Keep a Changelog `_ and this project adheres to `Semantic Versioning `_. +`v0.11.1`_ - 30-August-2023 +--------------------------- +Fixed ++++++ +- Revert "Add interpolate argument to avoid resolving proxied values." feature + due to `#485 `_. + + `v0.11.0`_ - 30-August-2023 -------------------------------- +--------------------------- Added +++++ - Added support for Django 4.2 @@ -372,7 +380,8 @@ Added - Initial release. -.. _v0.11.0: https://github.com/joke2k/django-environ/compare/v0.10.0...develop +.. _v0.11.1: https://github.com/joke2k/django-environ/compare/v0.11.0...v0.11.1 +.. _v0.11.0: https://github.com/joke2k/django-environ/compare/v0.10.0...v0.11.0 .. _v0.10.0: https://github.com/joke2k/django-environ/compare/v0.9.0...v0.10.0 .. _v0.9.0: https://github.com/joke2k/django-environ/compare/v0.8.1...v0.9.0 .. _v0.8.1: https://github.com/joke2k/django-environ/compare/v0.8.0...v0.8.1 diff --git a/docs/tips.rst b/docs/tips.rst index ab59f691..20b8c3e1 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -226,7 +226,7 @@ Proxy value =========== Values that being with a ``$`` may be interpolated. Pass ``interpolate=True`` to -``environ.Env()`` to enable this feature (``True`` by default): +``environ.Env()`` to enable this feature: .. code-block:: python diff --git a/environ/__init__.py b/environ/__init__.py index 54e9465c..38b5b6dc 100644 --- a/environ/__init__.py +++ b/environ/__init__.py @@ -21,7 +21,7 @@ __copyright__ = 'Copyright (C) 2013-2022 Daniele Faraglia' """The copyright notice of the package.""" -__version__ = '0.11.0' +__version__ = '0.11.1' """The version of the package.""" __license__ = 'MIT' diff --git a/environ/environ.py b/environ/environ.py index f35470c5..644286e1 100644 --- a/environ/environ.py +++ b/environ/environ.py @@ -197,12 +197,11 @@ class Env: VAR = re.compile(r'(?[A-Z_][0-9A-Z_]*)}?', re.IGNORECASE) - def __init__(self, interpolate=True, **scheme): + def __init__(self, **scheme): self._local = threading.local() self.smart_cast = True self.escape_proxy = False self.prefix = "" - self.interpolate = interpolate self.scheme = scheme def __call__(self, var, cast=None, default=NOTSET, parse_default=False): @@ -426,8 +425,7 @@ def _get_value(self, var_name, cast=None, default=NOTSET, value = default # Expand variables - if self.interpolate and isinstance(value, (bytes, str)) \ - and var_name not in NOT_EXPANDED: + if isinstance(value, (bytes, str)) and var_name not in NOT_EXPANDED: def repl(match_): return self.get_value( match_.group('name'), cast=cast, default=default, diff --git a/tests/test_env.py b/tests/test_env.py index 1f2df156..0b105f55 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -134,10 +134,6 @@ def test_bool_true(self, value, variable): def test_proxied_value(self): assert self.env('PROXIED_VAR') == 'bar' - def test_not_interpolated_proxied_value(self): - env = Env(interpolate=False) - assert env('PROXIED_VAR') == '$STR_VAR' - def test_escaped_dollar_sign(self): self.env.escape_proxy = True assert self.env('ESCAPED_VAR') == '$baz'