Repository: bradenm/micropy-cli
Issue: TypeError when adding stubs to existing project

<!--- Found a bug? Thanks for letting us know! -->

<!--- Provide a general summary of the issue in the Title above -->

**Describe the bug**
When using `micropy stubs add` to add a stubs to an existing project, a `TypeError` is raised. This does not impact using `micropy add` to install stubs normally.

**Expected Behavior**
In an active project, `micropy stubs add` should install the stubs and add them to the active project.

**Current Behavior**
In an active project, the stubs install but a `TypeError` is raised when attempting to add them to the project.

**Steps to Reproduce**
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->

1. Create New Project
2. cd to New Project
3. Execute `micropy stubs add <some_stub_package>`


**Logs**

Traceback:
```
Traceback (most recent call last):
  File "/home/bradenmars/.local/bin/micropy", line 10, in <module>
    sys.exit(cli())
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/micropy/cli.py", line 216, in add
    proj.add_stub(stub)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 147, in __call__
    return getattr(*proxy)(*args, **kwargs)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/micropy/project/modules/modules.py", line 96, in wrapper
    return func(*args, **kwargs)
  File "/home/bradenmars/.local/lib/python3.7/site-packages/micropy/project/modules/stubs.py", line 150, in add_stub
    self.context.extend('stubs', [stub])
  File "/home/bradenmars/.local/lib/python3.7/site-packages/micropy/config/config.py", line 177, in extend
    dpath.merge(to_update, value, flags=dpath.MERGE_ADDITIVE)
  File "/home/bradenmars/.pyenv/versions/3.7.3/lib/python3.7/site-packages/dpath/util.py", line 213, in merge
    dst += [None] * (dsti - (len(dst) - 1))
TypeError: unsupported operand type(s) for +=: 'set' and 'list'
```


Changed files:
micropy/config/config.py

diff --git a/micropy/config/config.py b/micropy/config/config.py
index cfce3da..688da75 100644
--- a/micropy/config/config.py
+++ b/micropy/config/config.py
@@ -159,7 +159,7 @@ class Config:
         self.log.debug(f"popped config value {value} <- [{key}]")
         return self.sync()
 
-    def extend(self, key: str, value: List[Any], unique: bool = False):
+    def extend(self, key: str, value: List[Any], unique: bool = False) -> dict:
         """Extend a list in config at key path.
 
         Args:
@@ -171,14 +171,14 @@ class Config:
             Updated Config
 
         """
-        to_update = deepcopy(self.get(key, value))
+        to_update = list(deepcopy(self.get(key, value)))
         if unique:
             value = [v for v in value if v not in to_update]
         dpath.merge(to_update, value, flags=dpath.MERGE_ADDITIVE)
         self.set(key, to_update)
         return self.sync()
 
-    def upsert(self, key: str, value: Union[List[Any], dict]):
+    def upsert(self, key: str, value: Union[List[Any], dict]) -> dict:
         """Update or insert values into key list or dict.
 
         Args: