Repository: pypa/setuptools_scm

Issue:
in version 3 tags_to_versions returns a iterator instead of a list
I get this issue when using `setuptools>=3` and `<=3.0.2`

```
(venv) macbeth $ pip install --no-binary :all: cheroot
Looking in indexes: http://artifactory.factset.com/artifactory/api/pypi/python/simple/
Collecting cheroot
  Downloading http://artifactory.factset.com/artifactory/api/pypi/python/packages/a3/fe/60797128186577348abc612fdd1011e737d7f01137c0c927dba489360fc3/cheroot-6.3.3.tar.gz (73kB)
    100% |████████████████████████████████| 81kB 65.5MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-otm5evwb/cheroot/setup.py", line 113, in <module>
        setuptools.setup(**params)
      File "/REDACTED_DIR/venv/lib/python3.6/site-packages/setuptools/__init__.py", line 131, in setup
        return distutils.core.setup(**attrs)
      File "/home/user/macbeth/.local/share/pyenv/versions/3.6.4/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/REDACTED_DIR/venv/lib/python3.6/site-packages/setuptools/dist.py", line 370, in __init__
        k: v for k, v in attrs.items()
      File "/home/user/macbeth/.local/share/pyenv/versions/3.6.4/lib/python3.6/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/REDACTED_DIR/venv/lib/python3.6/site-packages/setuptools/dist.py", line 529, in finalize_options
        ep.load()(self, ep.name, value)
      File "/tmp/pip-install-otm5evwb/cheroot/.eggs/setuptools_scm-3.0.2-py3.6.egg/setuptools_scm/integration.py", line 23, in version_keyword
        dist.metadata.version = get_version(**value)
      File "/tmp/pip-install-otm5evwb/cheroot/.eggs/setuptools_scm-3.0.2-py3.6.egg/setuptools_scm/__init__.py", line 135, in get_version
        parsed_version = _do_parse(config)
      File "/tmp/pip-install-otm5evwb/cheroot/.eggs/setuptools_scm-3.0.2-py3.6.egg/setuptools_scm/__init__.py", line 88, in _do_parse
        config, "setuptools_scm.parse_scm"
      File "/tmp/pip-install-otm5evwb/cheroot/.eggs/setuptools_scm-3.0.2-py3.6.egg/setuptools_scm/__init__.py", line 45, in _version_from_entrypoint
        version = _call_entrypoint_fn(config, ep.load())
      File "/tmp/pip-install-otm5evwb/cheroot/.eggs/setuptools_scm-3.0.2-py3.6.egg/setuptools_scm/__init__.py", line 40, in _call_entrypoint_fn
        return fn(config.absolute_root)
      File "/tmp/pip-install-otm5evwb/cheroot/.eggs/setuptools_scm_git_archive-1.0-py3.6.egg/setuptools_scm_git_archive/__init__.py", line 21, in parse
        return archival_to_version(data)
      File "/tmp/pip-install-otm5evwb/cheroot/.eggs/setuptools_scm_git_archive-1.0-py3.6.egg/setuptools_scm_git_archive/__init__.py", line 15, in archival_to_version
        return meta(versions[0])
    TypeError: 'filter' object is not subscriptable

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-otm5evwb/cheroot/
(venv) macbeth $ pip freeze --all
pip==18.0
setuptools==40.0.0
(venv) macbeth $ python --version
Python 3.6.4
```

Comments:

Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index ea83b4e..ad7ca4f 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,9 @@
+v3.0.3
+======
+
+* fix #286 - duo an oversight a helper functio nwas returning a generator instead of a list
+
+
 v3.0.2
 ======
 
diff --git a/src/setuptools_scm/version.py b/src/setuptools_scm/version.py
index 47ad6d3..b2ad2f7 100644
--- a/src/setuptools_scm/version.py
+++ b/src/setuptools_scm/version.py
@@ -30,12 +30,12 @@ def _parse_version_tag(tag, config):
         if len(match.groups()) == 1:
             key = 1
         else:
-            key = 'version'
-        
+            key = "version"
+
         result = {
-            'version': match.group(key),
-            'prefix': match.group(0)[:match.start(key)],
-            'suffix': match.group(0)[match.end(key):],
+            "version": match.group(key),
+            "prefix": match.group(0)[:match.start(key)],
+            "suffix": match.group(0)[match.end(key):],
         }
 
     trace("tag '%s' parsed to %s" % (tag, result))
@@ -88,20 +88,21 @@ def tag_to_version(tag, config=None):
         config = Configuration()
 
     tagdict = _parse_version_tag(tag, config)
-    if not isinstance(tagdict, dict) or not tagdict.get('version', None):
+    if not isinstance(tagdict, dict) or not tagdict.get("version", None):
         warnings.warn("tag %r no version found" % (tag,))
         return None
 
-    version = tagdict['version']
+    version = tagdict["version"]
     trace("version pre parse", version)
 
-    if tagdict.get('suffix', ''):
-        warnings.warn("tag %r will be stripped of its suffix '%s'" % (tag, tagdict['suffix']))
+    if tagdict.get("suffix", ""):
+        warnings.warn(
+            "tag %r will be stripped of its suffix '%s'" % (tag, tagdict["suffix"])
+        )
 
     if VERSION_CLASS is not None:
         version = pkg_parse_version(version)
         trace("version", repr(version))
-    
     return version
 
 
@@ -111,7 +112,12 @@ def tags_to_versions(tags, config=None):
     :param tags: an iterable of tags
     :param config: optional configuration object
     """
-    return filter(None, map(lambda tag: tag_to_version(tag, config=config), tags))
+    result = []
+    for tag in tags:
+        tag = tag_to_version(tag, config=config)
+        if tag:
+            result.append(tag)
+    return result
 
 
 class ScmVersion(object):
@@ -176,9 +182,14 @@ def _parse_tag(tag, preformatted, config):
     return tag
 
 
-def meta(tag, distance=None, dirty=False, node=None, preformatted=False, config=None, **kw):
+def meta(
+    tag, distance=None, dirty=False, node=None, preformatted=False, config=None, **kw
+):
     if not config:
-        warnings.warn("meta invoked without explicit configuration, will use defaults where required.")
+        warnings.warn(
+            "meta invoked without explicit configuration,"
+            " will use defaults where required."
+        )
     parsed_version = _parse_tag(tag, preformatted, config)
     trace("version", tag, "->", parsed_version)
     assert parsed_version is not None, "cant parse version %s" % tag


Test patch:
diff --git a/testing/test_version.py b/testing/test_version.py
index 4de545c..31f33f7 100644
--- a/testing/test_version.py
+++ b/testing/test_version.py
@@ -1,6 +1,6 @@
 import pytest
 from setuptools_scm.config import Configuration
-from setuptools_scm.version import meta, simplified_semver_version
+from setuptools_scm.version import meta, simplified_semver_version, tags_to_versions
 
 
 @pytest.mark.parametrize(
@@ -49,6 +49,13 @@ def test_next_semver(version, expected_next):
     ],
 )
 def test_tag_regex1(tag, expected):
-    Configuration().tag_regex = r'^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$'
+    Configuration().tag_regex = r"^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$"
     result = meta(tag)
     assert result.tag.public == expected
+
+
+@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/286")
+def test_tags_to_versions():
+    config = Configuration()
+    versions = tags_to_versions(["1", "2", "3"], config=config)
+    assert isinstance(versions, list)  # enable subscription