Handle versioned egg fragments in dependency URLs

If you include a dependency URL in your requirements file that has an
egg fragment e.g.

  http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a2.tar.gz#egg=oslo.config

we include the full URL in dependency_links (as you'd expect), but also
include the egg fragment in our requires.

With oslo.config, we're seeing a situation where 1.1.1 is installed and,
while pip knows that 1.2.0a2 is available (via dependency_links),
because our requires only say 'oslo.config' and we haven't passed
--upgrade, then pip sees the requirement as satisfied and doesn't
install 1.2.0a2.

What we really want to express is "we require at least 1.2.0a2 and
here's where you can find it" so, for example, we'll be happy if a newer
version is installed or available from pypi but, if not, then we'll
install from the supplied URL.

Now, egg fragments can be versioned e.g.

  http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a2.tar.gz#egg=oslo.config-1.2.0a2

but we need to transform the fragment so our requires becomes:

  oslo.config>=1.2.0a2

We should be fine for a backwards compatibility perspective, because
an egg fragment which included a hyphen just wouldn't have worked.

Change-Id: I6ec1b935d08ed5db993a3e47f591104528582101
Merge "Handle versioned egg fragments in dependency URLs"