def make_test_cfg(tmpdir, colons=False):
    """
    Set up a config file we can test read_cfg_file on
    """
    urlpfx = "git+https://github.com/tbarron"
    data = {'root': "{}/pypi".format(tmpdir.strpath),
            'tstcfg': tmpdir.join("test.cfg"),
            'packages':
            {'foobar': [{'version': "0.0.0",
                         'url': "{}/foobar#egg=foobar-0.0.0".format(urlpfx)},
                        {'version': "0.0.1",
                         'url': "{}/foobar#egg=foobar-0.0.1".format(urlpfx)},
                        ],
             'tbx': [{'version': "0.1.0",
                      'url': "{}/tbx#egg=tbx-0.1.0".format(urlpfx),
                      'minpy': "3.8.0"},
                     ],
             'dtm': [{'version': "2.0.0",
                      'url': "{}/dtm#egg=dtm-2.0.0".format(urlpfx)},
                     ]}
            }
    colchr = ":" if colons else ""
    cfgs = "root{}       {}\n\n".format(colchr, data['root'])
    pkg_l = data['packages']
    for pkg in pkg_l:
        cfgs += "package{}       {}\n".format(colchr, pkg)
        for rel in pkg_l[pkg]:
            cfgs += "    version{}   {}\n".format(colchr, rel['version'])
            cfgs += "    url{}       {}\n".format(colchr, rel['url'])
            if 'minpy' in rel:
                cfgs += "    minpy{}     {}\n".format(colchr, rel['minpy'])
        cfgs += "\n"

    data['tstcfg'].write(cfgs)
    return data