Repository: pypa/setuptools_scm

Issue:
AttributeError: 'str' object has no attribute 'absolute_root'
It seems that our Appveyor builds have started failing with the newly-released 3.0.0:
```
(arrow) C:\projects\arrow\python>python setup.py build_ext     install -q --single-version-externally-managed --record=record.text     bdist_wheel -q   || exit /B 
Traceback (most recent call last):
  File "setup.py", line 545, in <module>
    url="https://arrow.apache.org/"
  File "C:\Miniconda36-x64\envs\arrow\lib\site-packages\setuptools\__init__.py", line 131, in setup
    return distutils.core.setup(**attrs)
  File "C:\Miniconda36-x64\envs\arrow\lib\distutils\core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "C:\Miniconda36-x64\envs\arrow\lib\site-packages\setuptools\dist.py", line 370, in __init__
    k: v for k, v in attrs.items()
  File "C:\Miniconda36-x64\envs\arrow\lib\distutils\dist.py", line 281, in __init__
    self.finalize_options()
  File "C:\Miniconda36-x64\envs\arrow\lib\site-packages\setuptools\dist.py", line 529, in finalize_options
    ep.load()(self, ep.name, value)
  File "c:\projects\arrow\python\.eggs\setuptools_scm-3.0.0-py3.6.egg\setuptools_scm\integration.py", line 23, in version_keyword
    dist.metadata.version = get_version(**value)
  File "c:\projects\arrow\python\.eggs\setuptools_scm-3.0.0-py3.6.egg\setuptools_scm\__init__.py", line 128, in get_version
    parsed_version = _do_parse(config)
  File "c:\projects\arrow\python\.eggs\setuptools_scm-3.0.0-py3.6.egg\setuptools_scm\__init__.py", line 73, in _do_parse
    parse_result = _call_entrypoint_fn(config, config.parse)
  File "c:\projects\arrow\python\.eggs\setuptools_scm-3.0.0-py3.6.egg\setuptools_scm\__init__.py", line 36, in _call_entrypoint_fn
    return fn(config.absolute_root)
  File "setup.py", line 496, in parse_version
    version = setuptools_scm.git.parse(root, describe)
  File "c:\projects\arrow\python\.eggs\setuptools_scm-3.0.0-py3.6.egg\setuptools_scm\git.py", line 96, in parse
    wd = GitWorkdir.from_potential_worktree(config.absolute_root)
AttributeError: 'str' object has no attribute 'absolute_root'
```

Discussion:

Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index a8d023c..bd68fab 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,8 @@
+v3.0.1
+=======
+
+* fix a regression in setuptools_scm.git.parse - reorder arguments so the positional invocation from before works as expected
+
 v3.0.0
 =======
 
diff --git a/src/setuptools_scm/git.py b/src/setuptools_scm/git.py
index 07b976b..5ba9ecf 100644
--- a/src/setuptools_scm/git.py
+++ b/src/setuptools_scm/git.py
@@ -83,7 +83,9 @@ def fail_on_shallow(wd):
         )
 
 
-def parse(root, config=None, describe_command=DEFAULT_DESCRIBE, pre_parse=warn_on_shallow):
+def parse(
+    root, describe_command=DEFAULT_DESCRIBE, pre_parse=warn_on_shallow, config=None
+):
     """
     :param pre_parse: experimental pre_parse action, may change at any time
     """
@@ -120,7 +122,14 @@ def parse(root, config=None, describe_command=DEFAULT_DESCRIBE, pre_parse=warn_o
 
         branch = wd.get_branch()
         if number:
-            return meta(tag, config=config, distance=number, node=node, dirty=dirty, branch=branch)
+            return meta(
+                tag,
+                config=config,
+                distance=number,
+                node=node,
+                dirty=dirty,
+                branch=branch,
+            )
         else:
             return meta(tag, config=config, node=node, dirty=dirty, branch=branch)
 


Test patch:
diff --git a/testing/test_git.py b/testing/test_git.py
index dd5f817..d854a7c 100644
--- a/testing/test_git.py
+++ b/testing/test_git.py
@@ -28,6 +28,11 @@ def test_parse_describe_output(given, tag, number, node, dirty):
     assert parsed == (tag, number, node, dirty)
 
 
+@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/281")
+def test_parse_call_order(wd):
+    git.parse(str(wd.cwd), git.DEFAULT_DESCRIBE)
+
+
 def test_version_from_git(wd):
     assert wd.version == "0.1.dev0"