Repository: conda/conda

Issue:
Version constraint ignored depending on order of args to `conda create` (4.3.13)
All of these command lines should resolve `python=2.7.12` I think but some choose `python=2.7.13`.
To reproduce I have to use both a certain package (python-dateutil) along with python, and put the packages in a certain order (python-dateutil first breaks, python-dateutil second works). `six` instead of `python-dateutil` never seems to break.

If I actually create the environment and it chooses 2.7.13, I am able to subsequently `conda install python=2.7.12=0`, so there doesn't seem to be a hard version constraint preventing that.

```
$ echo n | conda create --prefix=/tmp/blahblahboo "python-dateutil=2.6.0=py27_0"  "python=2.7.12=0" | grep 'python:'
Exiting
    python:          2.7.13-0     

$ echo n | conda create --prefix=/tmp/blahblahboo  "python=2.7.12=0"  "python-dateutil=2.6.0=py27_0" | grep 'python:'
Exiting
    python:          2.7.12-0     

$ echo n | conda create --prefix=/tmp/blahblahboo  "python=2.7.12=0" "six=1.10.0=py27_0" | grep 'python:' 
Exiting

    python:     2.7.12-0     
$ echo n | conda create --prefix=/tmp/blahblahboo "six=1.10.0=py27_0"  "python=2.7.12=0" | grep 'python:' 
Exiting

    python:     2.7.12-0     
$ echo n | conda create --prefix=/tmp/blahblahboo "six=1.10.0=py27_0" "python-dateutil=2.6.0=py27_0"  "python=2.7.12=0" | grep 'python:'
Exiting

    python:          2.7.13-0     
$ echo n | conda create --prefix=/tmp/blahblahboo "six=1.10.0=py27_0" "python=2.7.12=0" "python-dateutil=2.6.0=py27_0" | grep 'python:'
Exiting
    python:          2.7.12-0     

```

conda info
```
$ conda info -a
Current conda install:

               platform : linux-64
          conda version : 4.3.13
       conda is private : False
      conda-env version : 4.3.13
    conda-build version : 2.0.2
         python version : 2.7.12.final.0
       requests version : 2.13.0
       root environment : /home/hp/bin/anaconda2  (writable)
    default environment : /home/hp/bin/anaconda2/envs/kapsel
       envs directories : /home/hp/bin/anaconda2/envs
                          /home/hp/.conda/envs
          package cache : /home/hp/bin/anaconda2/pkgs
                          /home/hp/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://conda.anaconda.org/t/<TOKEN>/binstar/linux-64
                          https://conda.anaconda.org/t/<TOKEN>/binstar/noarch
            config file : /home/hp/.condarc
           offline mode : False
             user-agent : conda/4.3.13 requests/2.13.0 CPython/2.7.12 Linux/4.9.12-100.fc24.x86_64 Fedora/24 glibc/2.23
                UID:GID : 1000:1000

# conda environments:
#
anaconda-platform        /home/hp/bin/anaconda2/envs/anaconda-platform
kapsel                *  /home/hp/bin/anaconda2/envs/kapsel
kapsel-canary            /home/hp/bin/anaconda2/envs/kapsel-canary
py2                      /home/hp/bin/anaconda2/envs/py2
testing                  /home/hp/bin/anaconda2/envs/testing
root                     /home/hp/bin/anaconda2

sys.version: 2.7.12 |Anaconda 4.2.0 (64-bit)| (defaul...
sys.prefix: /home/hp/bin/anaconda2
sys.executable: /home/hp/bin/anaconda2/bin/python
conda location: /home/hp/bin/anaconda2/lib/python2.7/site-packages/conda
conda-build: /home/hp/bin/anaconda2/bin/conda-build
conda-convert: /home/hp/bin/anaconda2/bin/conda-convert
conda-develop: /home/hp/bin/anaconda2/bin/conda-develop
conda-env: /home/hp/bin/anaconda2/bin/conda-env
conda-index: /home/hp/bin/anaconda2/bin/conda-index
conda-inspect: /home/hp/bin/anaconda2/bin/conda-inspect
conda-kapsel: /home/hp/bin/anaconda2/envs/kapsel/bin/conda-kapsel
conda-metapackage: /home/hp/bin/anaconda2/bin/conda-metapackage
conda-render: /home/hp/bin/anaconda2/bin/conda-render
conda-server: /home/hp/bin/anaconda2/envs/kapsel/bin/conda-server
conda-sign: /home/hp/bin/anaconda2/bin/conda-sign
conda-skeleton: /home/hp/bin/anaconda2/bin/conda-skeleton
user site dirs: 

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: kapsel
CONDA_ENVS_PATH: <not set>
LD_LIBRARY_PATH: <not set>
PATH: /home/hp/bin/anaconda2/envs/kapsel/bin:/home/hp/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
PYTHONHOME: <not set>
PYTHONPATH: <not set>

License directories:
    /home/hp/.continuum
    /home/hp/bin/anaconda2/licenses
License files (license*.txt):
    /home/hp/.continuum/license_anaconda_repo_20161003210957.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160804160500.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160727174434.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728092403.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160830123618.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160803091557.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160830104354.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo.txt
               Reading license file : 6
                    Signature valid : 6
                       Vendor match : 3
                            product : u'mkl-optimizations'
                           packages : u'mkl'
                           end_date : u'2017-05-24'
                               type : u'Trial'
                            product : u'iopro'
                           packages : u'iopro'
                           end_date : u'2017-05-24'
                               type : u'Trial'
                            product : u'accelerate'
                           packages : u'numbapro mkl'
                           end_date : u'2017-05-24'
                               type : u'Trial'
    /home/hp/.continuum/license_anaconda_repo_20160823133054.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160927143648.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160803113033.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728095857.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728094900.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160830104619.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728093131.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20161003210908.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728094321.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
Package/feature end dates:
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



`$ /home/hp/bin/anaconda2/envs/kapsel/bin/conda info -a`




    Traceback (most recent call last):
      File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 591, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 134, in _main
        exit_code = args.func(args, p)
      File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/cli/main_info.py", line 324, in execute
        show_info()
      File "_license.pyx", line 363, in _license.show_info (_license.c:10610)
      File "_license.pyx", line 310, in _license.get_end_dates (_license.c:9015)
      File "_license.pyx", line 166, in _license.filter_vendor (_license.c:6214)
    KeyError: 'vendor'

$ conda --version
conda 4.3.13
```

Version constraint ignored depending on order of args to `conda create` (4.3.13)
All of these command lines should resolve `python=2.7.12` I think but some choose `python=2.7.13`.
To reproduce I have to use both a certain package (python-dateutil) along with python, and put the packages in a certain order (python-dateutil first breaks, python-dateutil second works). `six` instead of `python-dateutil` never seems to break.

If I actually create the environment and it chooses 2.7.13, I am able to subsequently `conda install python=2.7.12=0`, so there doesn't seem to be a hard version constraint preventing that.

```
$ echo n | conda create --prefix=/tmp/blahblahboo "python-dateutil=2.6.0=py27_0"  "python=2.7.12=0" | grep 'python:'
Exiting
    python:          2.7.13-0     

$ echo n | conda create --prefix=/tmp/blahblahboo  "python=2.7.12=0"  "python-dateutil=2.6.0=py27_0" | grep 'python:'
Exiting
    python:          2.7.12-0     

$ echo n | conda create --prefix=/tmp/blahblahboo  "python=2.7.12=0" "six=1.10.0=py27_0" | grep 'python:' 
Exiting

    python:     2.7.12-0     
$ echo n | conda create --prefix=/tmp/blahblahboo "six=1.10.0=py27_0"  "python=2.7.12=0" | grep 'python:' 
Exiting

    python:     2.7.12-0     
$ echo n | conda create --prefix=/tmp/blahblahboo "six=1.10.0=py27_0" "python-dateutil=2.6.0=py27_0"  "python=2.7.12=0" | grep 'python:'
Exiting

    python:          2.7.13-0     
$ echo n | conda create --prefix=/tmp/blahblahboo "six=1.10.0=py27_0" "python=2.7.12=0" "python-dateutil=2.6.0=py27_0" | grep 'python:'
Exiting
    python:          2.7.12-0     

```

conda info
```
$ conda info -a
Current conda install:

               platform : linux-64
          conda version : 4.3.13
       conda is private : False
      conda-env version : 4.3.13
    conda-build version : 2.0.2
         python version : 2.7.12.final.0
       requests version : 2.13.0
       root environment : /home/hp/bin/anaconda2  (writable)
    default environment : /home/hp/bin/anaconda2/envs/kapsel
       envs directories : /home/hp/bin/anaconda2/envs
                          /home/hp/.conda/envs
          package cache : /home/hp/bin/anaconda2/pkgs
                          /home/hp/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://conda.anaconda.org/t/<TOKEN>/binstar/linux-64
                          https://conda.anaconda.org/t/<TOKEN>/binstar/noarch
            config file : /home/hp/.condarc
           offline mode : False
             user-agent : conda/4.3.13 requests/2.13.0 CPython/2.7.12 Linux/4.9.12-100.fc24.x86_64 Fedora/24 glibc/2.23
                UID:GID : 1000:1000

# conda environments:
#
anaconda-platform        /home/hp/bin/anaconda2/envs/anaconda-platform
kapsel                *  /home/hp/bin/anaconda2/envs/kapsel
kapsel-canary            /home/hp/bin/anaconda2/envs/kapsel-canary
py2                      /home/hp/bin/anaconda2/envs/py2
testing                  /home/hp/bin/anaconda2/envs/testing
root                     /home/hp/bin/anaconda2

sys.version: 2.7.12 |Anaconda 4.2.0 (64-bit)| (defaul...
sys.prefix: /home/hp/bin/anaconda2
sys.executable: /home/hp/bin/anaconda2/bin/python
conda location: /home/hp/bin/anaconda2/lib/python2.7/site-packages/conda
conda-build: /home/hp/bin/anaconda2/bin/conda-build
conda-convert: /home/hp/bin/anaconda2/bin/conda-convert
conda-develop: /home/hp/bin/anaconda2/bin/conda-develop
conda-env: /home/hp/bin/anaconda2/bin/conda-env
conda-index: /home/hp/bin/anaconda2/bin/conda-index
conda-inspect: /home/hp/bin/anaconda2/bin/conda-inspect
conda-kapsel: /home/hp/bin/anaconda2/envs/kapsel/bin/conda-kapsel
conda-metapackage: /home/hp/bin/anaconda2/bin/conda-metapackage
conda-render: /home/hp/bin/anaconda2/bin/conda-render
conda-server: /home/hp/bin/anaconda2/envs/kapsel/bin/conda-server
conda-sign: /home/hp/bin/anaconda2/bin/conda-sign
conda-skeleton: /home/hp/bin/anaconda2/bin/conda-skeleton
user site dirs: 

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: kapsel
CONDA_ENVS_PATH: <not set>
LD_LIBRARY_PATH: <not set>
PATH: /home/hp/bin/anaconda2/envs/kapsel/bin:/home/hp/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
PYTHONHOME: <not set>
PYTHONPATH: <not set>

License directories:
    /home/hp/.continuum
    /home/hp/bin/anaconda2/licenses
License files (license*.txt):
    /home/hp/.continuum/license_anaconda_repo_20161003210957.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160804160500.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160727174434.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728092403.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160830123618.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160803091557.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160830104354.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo.txt
               Reading license file : 6
                    Signature valid : 6
                       Vendor match : 3
                            product : u'mkl-optimizations'
                           packages : u'mkl'
                           end_date : u'2017-05-24'
                               type : u'Trial'
                            product : u'iopro'
                           packages : u'iopro'
                           end_date : u'2017-05-24'
                               type : u'Trial'
                            product : u'accelerate'
                           packages : u'numbapro mkl'
                           end_date : u'2017-05-24'
                               type : u'Trial'
    /home/hp/.continuum/license_anaconda_repo_20160823133054.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160927143648.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160803113033.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728095857.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728094900.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160830104619.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728093131.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20161003210908.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
    /home/hp/.continuum/license_anaconda_repo_20160728094321.txt
               Reading license file : 1
Error: no signature in license: {u'license': u'test'}
                    Signature valid : 0
                       Vendor match : 0
Package/feature end dates:
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



`$ /home/hp/bin/anaconda2/envs/kapsel/bin/conda info -a`




    Traceback (most recent call last):
      File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 591, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 134, in _main
        exit_code = args.func(args, p)
      File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/cli/main_info.py", line 324, in execute
        show_info()
      File "_license.pyx", line 363, in _license.show_info (_license.c:10610)
      File "_license.pyx", line 310, in _license.get_end_dates (_license.c:9015)
      File "_license.pyx", line 166, in _license.filter_vendor (_license.c:6214)
    KeyError: 'vendor'

$ conda --version
conda 4.3.13
```



Discussion:

Resolving patch:
diff --git a/conda/plan.py b/conda/plan.py
--- a/conda/plan.py
+++ b/conda/plan.py
@@ -467,7 +467,6 @@ def install_actions_list(prefix, index, specs, force=False, only_names=None, alw
                          channel_priority_map=None, is_update=False):
     # type: (str, Dict[Dist, Record], List[str], bool, Option[List[str]], bool, bool, bool,
     #        bool, bool, bool, Dict[str, Sequence[str, int]]) -> List[Dict[weird]]
-    str_specs = specs
     specs = [MatchSpec(spec) for spec in specs]
     r = get_resolve_object(index.copy(), prefix)
 
@@ -483,11 +482,11 @@ def install_actions_list(prefix, index, specs, force=False, only_names=None, alw
 
     # Replace SpecsForPrefix specs with specs that were passed in in order to retain
     #   version information
-    required_solves = match_to_original_specs(str_specs, grouped_specs)
+    required_solves = match_to_original_specs(specs, grouped_specs)
 
-    actions = [get_actions_for_dists(dists_by_prefix, only_names, index, force,
+    actions = [get_actions_for_dists(specs_by_prefix, only_names, index, force,
                                      always_copy, prune, update_deps, pinned)
-               for dists_by_prefix in required_solves]
+               for specs_by_prefix in required_solves]
 
     # Need to add unlink actions if updating a private env from root
     if is_update and prefix == context.root_prefix:
@@ -601,8 +600,8 @@ def get_r(preferred_env):
     return prefix_with_dists_no_deps_has_resolve
 
 
-def match_to_original_specs(str_specs, specs_for_prefix):
-    matches_any_spec = lambda dst: next(spc for spc in str_specs if spc.startswith(dst))
+def match_to_original_specs(specs, specs_for_prefix):
+    matches_any_spec = lambda dst: next(spc for spc in specs if spc.name == dst)
     matched_specs_for_prefix = []
     for prefix_with_dists in specs_for_prefix:
         linked = linked_data(prefix_with_dists.prefix)
@@ -618,13 +617,12 @@ def match_to_original_specs(str_specs, specs_for_prefix):
     return matched_specs_for_prefix
 
 
-def get_actions_for_dists(dists_for_prefix, only_names, index, force, always_copy, prune,
+def get_actions_for_dists(specs_by_prefix, only_names, index, force, always_copy, prune,
                           update_deps, pinned):
     root_only = ('conda', 'conda-env')
-    prefix = dists_for_prefix.prefix
-    dists = dists_for_prefix.specs
-    r = dists_for_prefix.r
-    specs = [MatchSpec(dist) for dist in dists]
+    prefix = specs_by_prefix.prefix
+    r = specs_by_prefix.r
+    specs = [MatchSpec(s) for s in specs_by_prefix.specs]
     specs = augment_specs(prefix, specs, pinned)
 
     linked = linked_data(prefix)


Test patch:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -925,13 +925,16 @@ def test_install_mkdir(self):
         try:
             prefix = make_temp_prefix()
             assert isdir(prefix)
-            run_command(Commands.INSTALL, prefix, "python=3.5", "--mkdir")
-            assert_package_is_installed(prefix, "python-3.5")
+            run_command(Commands.INSTALL, prefix, "python=3.5.2", "--mkdir")
+            assert_package_is_installed(prefix, "python-3.5.2")
 
             rm_rf(prefix)
             assert not isdir(prefix)
-            run_command(Commands.INSTALL, prefix, "python=3.5", "--mkdir")
-            assert_package_is_installed(prefix, "python-3.5")
+
+            # this part also a regression test for #4849
+            run_command(Commands.INSTALL, prefix, "python-dateutil=2.6.0", "python=3.5.2", "--mkdir")
+            assert_package_is_installed(prefix, "python-3.5.2")
+            assert_package_is_installed(prefix, "python-dateutil-2.6.0")
 
         finally:
             rmtree(prefix, ignore_errors=True)
diff --git a/tests/test_plan.py b/tests/test_plan.py
--- a/tests/test_plan.py
+++ b/tests/test_plan.py
@@ -1062,13 +1062,14 @@ def test_match_to_original_specs(self):
                                 specs=IndexedSet(("test",))),
             plan.SpecsForPrefix(prefix="some/prefix", r=self.res,
                                 specs=IndexedSet(("test-spec", "test-spec2")))]
-        matched = plan.match_to_original_specs(str_specs, grouped_specs)
+        matched = plan.match_to_original_specs(tuple(MatchSpec(s) for s in str_specs),
+                                               grouped_specs)
         expected_output = [
             plan.SpecsForPrefix(prefix="some/prefix/envs/_ranenv_",
                                 r=test_r,
-                                specs=["test 1.2.0"]),
+                                specs=[MatchSpec("test 1.2.0")]),
             plan.SpecsForPrefix(prefix="some/prefix", r=self.res,
-                                specs=["test-spec 1.1*", "test-spec2 <4.3"])]
+                                specs=[MatchSpec("test-spec 1.1*"), MatchSpec("test-spec2 <4.3")])]
 
         assert len(matched) == len(expected_output)
         assert matched == expected_output