Repository: rochacbruno/dynaconf
Pull request #287 (2020-01-20 08:29:50)

Update python-dotenv requirement from <=0.10.3 to <0.10.6
Updates the requirements on [python-dotenv](https://github.com/theskumar/python-dotenv) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md">python-dotenv's changelog</a>.</em></p>
<blockquote>
<h2>0.10.5</h2>
<ul>
<li>Fix handling of malformed lines and lines without a value ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/222">#222</a>):
<ul>
<li>Don't print warning when key has no value.</li>
<li>Reject more malformed lines (e.g. &quot;A: B&quot;).</li>
</ul>
</li>
<li>Fix handling of lines with just a comment ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/224">#224</a>).</li>
</ul>
<h2>0.10.4</h2>
<ul>
<li>Make typing optional ([<a href="https://github.com/techalchemy">@techalchemy</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/179">#179</a>).</li>
<li>Print a warning on malformed line ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/211">#211</a>).</li>
<li>Support keys without a value ([<a href="https://github.com/ulyssessouza">@ulyssessouza</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/220">#220</a>).</li>
</ul>
<h2>0.10.3</h2>
<ul>
<li>Improve interactive mode detection ([<a href="https://github.com/andrewsmith">@andrewsmith</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/183">#183</a>).</li>
<li>Refactor parser to fix parsing inconsistencies ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/170">#170</a>).
<ul>
<li>Interpret escapes as control characters only in double-quoted strings.</li>
<li>Interpret <code>#</code> as start of comment only if preceded by whitespace.</li>
</ul>
</li>
</ul>
<h2>0.10.2</h2>
<ul>
<li>Add type hints and expose them to users ([<a href="https://github.com/qnighy">@qnighy</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/172">#172</a>)</li>
<li><code>load_dotenv</code> and <code>dotenv_values</code> now accept an <code>encoding</code> parameter, defaults to <code>None</code>
([<a href="https://github.com/theskumar">@theskumar</a>])([<a href="https://github.com/earlbread">@earlbread</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/161">#161</a>)</li>
<li>Fix <code>str</code>/<code>unicode</code> inconsistency in Python 2: values are always <code>str</code> now. ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/121">#121</a>)</li>
<li>Fix Unicode error in Python 2, introduced in 0.10.0. ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/176">#176</a>)</li>
</ul>
<h2>0.10.1</h2>
<ul>
<li>Fix parsing of variable without a value ([<a href="https://github.com/asyncee">@asyncee</a>])([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/158">#158</a>)</li>
</ul>
<h2>0.10.0</h2>
<ul>
<li>Add support for UTF-8 in unquoted values ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/148">#148</a>)</li>
<li>Add support for trailing comments ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/148">#148</a>)</li>
<li>Add backslashes support in values ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/148">#148</a>)</li>
<li>Add support for newlines in values ([<a href="https://github.com/bbc2">@bbc2</a>])(<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/148">#148</a>)</li>
<li>Force environment variables to str with Python2 on Windows ([<a href="https://github.com/greyli">@greyli</a>])</li>
<li>Drop Python 3.3 support ([<a href="https://github.com/greyli">@greyli</a>])</li>
<li>Fix stderr/-out/-in redirection ([<a href="https://github.com/venthur">@venthur</a>])</li>
</ul>
<h2>0.9.0</h2>
</tr></table> ... (truncated)
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/theskumar/python-dotenv/commit/3637b3e114b9a3084457594ccfa3cb3e6d3d4ee4"><code>3637b3e</code></a> Bump version: 0.10.4 → 0.10.5</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/70d0c19cfae688dc333f753f880a8062b43b9333"><code>70d0c19</code></a> Fix handling of lines with just a comment</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/c68e78fe8dddbe7453f5e14251097f7d0be3beee"><code>c68e78f</code></a> Fix handling of malformed lines</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/ae1f1a906feddb23f4fa05c968c52df99c487ead"><code>ae1f1a9</code></a> Bump version: 0.10.3 → 0.10.4</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/c5b47f42f9b21be3cae1545bc4c758b30eb4b3dc"><code>c5b47f4</code></a> Clarify env var substitution format (<a href="https://github-redirect.dependabot.com/theskumar/python-dotenv/issues/221">#221</a>)</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/c00ccbb7ebdd0715717d13bf8b1685ae62d1e2f6"><code>c00ccbb</code></a> Remove Python 3.4 in .travis (EOL mid 2019)</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/23509f2f8856305f18c3e6dd28c42623ba320ae1"><code>23509f2</code></a> Support no value keys</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/723809fd9e5b6bb5c016c48bc42246f369e8485b"><code>723809f</code></a> Print a warning on malformed line</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/b1e83cafa8d0b09a2958106b7a35a0ee4d6aec22"><code>b1e83ca</code></a> Remove useless try/except</li>
<li><a href="https://github.com/theskumar/python-dotenv/commit/af192b7956e50c8cc07dc287047a524bb3b10ebb"><code>af192b7</code></a> Minor tweaks</li>
<li>Additional commits viewable in <a href="https://github.com/theskumar/python-dotenv/compare/v0.1.1...v0.10.5">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

codecov[bot]: # [Codecov](https://codecov.io/gh/rochacbruno/dynaconf/pull/287?src=pr&el=h1) Report
> Merging [#287](https://codecov.io/gh/rochacbruno/dynaconf/pull/287?src=pr&el=desc) into [master](https://codecov.io/gh/rochacbruno/dynaconf/commit/25fed5dc27d1dd78c368d7464f7d160b46aa1d24?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/rochacbruno/dynaconf/pull/287/graphs/tree.svg?width=650&token=GXszVzJcqW&height=150&src=pr)](https://codecov.io/gh/rochacbruno/dynaconf/pull/287?src=pr&el=tree)

```diff
@@          Coverage Diff          @@
##           master   #287   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          18     18           
  Lines         799    799           
=====================================
  Hits          799    799
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/rochacbruno/dynaconf/pull/287?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/rochacbruno/dynaconf/pull/287?src=pr&el=footer). Last update [25fed5d...fd8b8f6](https://codecov.io/gh/rochacbruno/dynaconf/pull/287?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/dynaconf/utils/__init__.py b/dynaconf/utils/__init__.py
index b53c55d..03fd061 100644
--- a/dynaconf/utils/__init__.py
+++ b/dynaconf/utils/__init__.py
@@ -40,7 +40,7 @@ def object_merge(old, new, unique=False):
                 object_merge(value, new[key])
 
         # Cleanup of MetaValues on New dict
-        for key, value in new.items():
+        for key, value in list(new.items()):
             if getattr(new[key], "dynaconf_reset", False):
                 # new Reset triggers cleanup of existing data
                 new[key] = new[key].value
diff --git a/requirements_dev.txt b/requirements_dev.txt
index e4b7cc7..89e07ae 100644
--- a/requirements_dev.txt
+++ b/requirements_dev.txt
@@ -11,7 +11,7 @@ django
 gitchangelog
 
 python-box<4.0.0
-python-dotenv<=0.10.3
+python-dotenv<0.10.6
 toml<=0.10.0
 click<=7.0
 
diff --git a/setup.py b/setup.py
index d8af763..c9b3c3f 100644
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(
     platforms="any",
     install_requires=[
         "python-box<4.0.0",
-        "python-dotenv<=0.10.3",
+        "python-dotenv<0.10.6",
         "toml<=0.10.0",
         "click<=7.0",
     ],


Test patch:
diff --git a/tests/test_utils.py b/tests/test_utils.py
index a87ff5d..1abc3cd 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -165,6 +165,16 @@ def test_merge_existing_dict():
     assert new == {"host": "localhost", "port": 666, "user": "admin"}
 
 
+def test_merge_dict_with_meta_values():
+    existing = {"A": 1, "B": 2, "C": 3}
+    new = {
+        "B": parse_conf_data("@del", tomlfy=True),
+        "C": parse_conf_data("@reset 4", tomlfy=True),
+    }
+    object_merge(existing, new)
+    assert new == {"A": 1, "C": 4}
+
+
 def test_trimmed_split():
     # No sep
     assert trimmed_split("hello") == ["hello"]