# Buggy code
def _resolve_one_round(self):
    """
    Resolves one level of the current constraints, by finding the best
    match for each package in the repository and adding all requirements
    for those best package versions.  Some of these constraints may be new
    or updated.

    Returns whether new constraints appeared in this round.  If no
    constraints were added or changed, this indicates a stable
    configuration.
    """
    # Sort this list for readability of terminal output
    constraints = sorted(self.constraints, key=key_from_ireq)

    log.debug("Current constraints:")
    for constraint in constraints:
        log.debug("  {}".format(constraint))

    log.debug("")
    log.debug("Finding the best candidates:")
    best_matches = {self.get_best_match(ireq) for ireq in constraints}

    # Find the new set of secondary dependencies
    log.debug("")
    log.debug("Finding secondary dependencies:")

    their_constraints = []
    for best_match in best_matches:
        their_constraints.extend(self._iter_dependencies(best_match))
    # Grouping constraints to make clean diff between rounds
    theirs = set(self._group_constraints(their_constraints))

    # NOTE: We need to compare RequirementSummary objects, since
    # InstallRequirement does not define equality
    diff = {RequirementSummary(t) for t in theirs} - {
        RequirementSummary(t) for t in self.their_constraints
    }
    removed = {RequirementSummary(t) for t in self.their_constraints} - {
        RequirementSummary(t) for t in theirs
    }

    has_changed = len(diff) > 0 or len(removed) > 0
    if has_changed:
        log.debug("")
        log.debug("New dependencies found in this round:")
        for new_dependency in sorted(diff, key=lambda req: key_from_req(req.req)):
            log.debug("  adding {}".format(new_dependency))
        log.debug("Removed dependencies in this round:")
        for removed_dependency in sorted(
            removed, key=lambda req: key_from_req(req.req)
        ):
            log.debug("  removing {}".format(removed_dependency))

    # Store the last round's results in the their_constraints
    self.their_constraints = theirs
    return has_changed, best_matches


# Traceback (pip._internal.exceptions.DistributionNotFound)
$ cat good.in
-e git+https://github.com/edx/django-rest-framework-oauth.git@0a43e8525f1e3048efe4bc70c03de308a277197c#egg=djangorestframework-oauth==1.1.1
edx-enterprise==1.7.2

$ cat bad.in
git+https://github.com/edx/django-rest-framework-oauth.git@0a43e8525f1e3048efe4bc70c03de308a277197c#egg=djangorestframework-oauth==1.1.1
edx-enterprise==1.7.2

$ cat doit.sh
rm -f *.txt
pip install pip-tools==3.8.0
pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o good38.txt good.in
pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o bad38.txt bad.in
pip install pip-tools==3.9.0
pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o good39.txt good.in
pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o bad39.txt bad.in
diff good*.txt

$ sh -x doit.sh
+ rm -f '*.txt'
+ pip install pip-tools==3.8.0
Collecting pip-tools==3.8.0
Using cached https://files.pythonhosted.org/packages/1c/a1/fc5d034448ca3ab0a8d8b97a064db05fcce6ac8d197bc1fd55e8daa84299/pip_tools-3.8.0-py2.py3-none-any.whl
Requirement already satisfied: six in /usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages (from pip-tools==3.8.0) (1.12.0)
Requirement already satisfied: click>=6 in /usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages (from pip-tools==3.8.0) (7.0)
Installing collected packages: pip-tools
Successfully installed pip-tools-3.8.0
+ pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o good38.txt good.in
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --no-emit-trusted-host --no-index --output-file=good38.txt good.in
#
-e git+https://github.com/edx/django-rest-framework-oauth.git@0a43e8525f1e3048efe4bc70c03de308a277197c#egg=djangorestframework-oauth==1.1.1
amqp==1.4.9               # via edx-enterprise, kombu
aniso8601==7.0.0          # via edx-enterprise, tincan
anyjson==0.3.3            # via edx-enterprise, kombu
asn1crypto==0.24.0        # via cryptography, edx-enterprise
billiard==3.3.0.23        # via celery, edx-enterprise
bleach==2.1.4             # via edx-enterprise
celery==3.1.25            # via edx-enterprise
certifi==2019.6.16        # via edx-enterprise, requests
cffi==1.12.3              # via cryptography, edx-enterprise
chardet==3.0.4            # via edx-enterprise, requests
click==7.0                # via code-annotations, edx-enterprise
code-annotations==0.3.1   # via edx-enterprise
cryptography==2.7         # via django-fernet-fields, edx-enterprise
defusedxml==0.5.0         # via djangorestframework-xml, edx-enterprise
django-config-models==1.0.1  # via edx-enterprise
django-countries==4.6.1   # via edx-enterprise
django-crum==0.7.3        # via edx-enterprise, edx-rbac
django-fernet-fields==0.6  # via edx-enterprise
django-filter==1.0.4      # via edx-enterprise
django-ipware==2.1.0      # via edx-enterprise
django-model-utils==3.0.0  # via edx-enterprise, edx-rbac
django-multi-email-field==0.5.1  # via edx-enterprise
django-object-actions==0.10.0  # via edx-enterprise
django-simple-history==2.7.0  # via edx-enterprise
django-waffle==0.12.0     # via edx-django-utils, edx-drf-extensions, edx-enterprise
django==1.11.22           # via code-annotations, django-config-models, django-crum, django-fernet-fields, django-model-utils, django-multi-email-field, edx-django-oauth2-provider, edx-django-utils, edx-drf-extensions, edx-enterprise, edx-opaque-keys, edx-rbac, jsonfield, rest-condition
djangorestframework-jwt==1.11.0  # via edx-drf-extensions, edx-enterprise
djangorestframework-xml==1.3.0  # via edx-enterprise
djangorestframework==3.7.7  # via django-config-models, edx-drf-extensions, edx-enterprise, rest-condition
edx-django-oauth2-provider==1.3.5  # via edx-enterprise
edx-django-utils==2.0.0   # via edx-drf-extensions, edx-enterprise
edx-drf-extensions==2.3.1  # via edx-enterprise, edx-rbac
edx-enterprise==1.7.2
edx-opaque-keys[django]==1.0.1  # via edx-drf-extensions, edx-enterprise
edx-rbac==0.2.1           # via edx-enterprise
edx-rest-api-client==1.9.2  # via edx-enterprise
enum34==1.1.6             # via edx-enterprise
future==0.17.1            # via edx-enterprise, pyjwkest
html5lib==1.0.1           # via bleach, edx-enterprise
idna==2.8                 # via edx-enterprise, requests
ipaddress==1.0.22         # via edx-enterprise
jinja2==2.10.1            # via code-annotations, edx-enterprise
jsondiff==1.1.1           # via edx-enterprise
jsonfield==2.0.2          # via edx-enterprise
kombu==3.0.37             # via celery, edx-enterprise
markupsafe==1.1.1         # via edx-enterprise, jinja2
newrelic==4.20.1.121      # via edx-django-utils, edx-enterprise
path.py==8.2.1            # via edx-enterprise
pbr==5.4.0                # via edx-enterprise, stevedore
pillow==6.1.0             # via edx-enterprise
psutil==1.2.1             # via edx-django-utils, edx-drf-extensions, edx-enterprise
pycparser==2.19           # via cffi, edx-enterprise
pycryptodomex==3.4.7      # via edx-enterprise, pyjwkest
pyjwkest==1.3.2           # via edx-drf-extensions, edx-enterprise
pyjwt==1.5.2              # via djangorestframework-jwt, edx-enterprise, edx-rest-api-client
pymongo==2.9.1            # via edx-enterprise, edx-opaque-keys
python-dateutil==2.4.0    # via edx-drf-extensions, edx-enterprise
python-slugify==1.2.6     # via code-annotations, edx-enterprise
pytz==2019.1              # via celery, django, edx-enterprise, tincan
pyyaml==5.1.1             # via code-annotations, edx-enterprise
requests==2.22.0          # via edx-drf-extensions, edx-enterprise, edx-rest-api-client, pyjwkest, slumber
rest-condition==1.0.3     # via edx-drf-extensions, edx-enterprise
rules==2.0.1              # via edx-enterprise
semantic-version==2.6.0   # via edx-drf-extensions, edx-enterprise
shortuuid==0.5.0          # via edx-django-oauth2-provider, edx-enterprise
six==1.11.0               # via bleach, cryptography, edx-drf-extensions, edx-enterprise, edx-opaque-keys, edx-rbac, html5lib, pyjwkest, python-dateutil, stevedore
slumber==0.7.1            # via edx-enterprise, edx-rest-api-client
stevedore==1.30.1         # via code-annotations, edx-enterprise, edx-opaque-keys
testfixtures==6.10.0      # via edx-enterprise
tincan==0.0.5             # via edx-enterprise
unicodecsv==0.14.1        # via edx-enterprise
unidecode==1.1.1          # via edx-enterprise, python-slugify
urllib3==1.23             # via edx-enterprise, requests
webencodings==0.5.1       # via edx-enterprise, html5lib
+ pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o bad38.txt bad.in
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --no-emit-trusted-host --no-index --output-file=bad38.txt bad.in
#
amqp==1.4.9               # via edx-enterprise, kombu
aniso8601==7.0.0          # via edx-enterprise, tincan
anyjson==0.3.3            # via edx-enterprise, kombu
asn1crypto==0.24.0        # via cryptography, edx-enterprise
billiard==3.3.0.23        # via celery, edx-enterprise
bleach==2.1.4             # via edx-enterprise
celery==3.1.25            # via edx-enterprise
certifi==2019.6.16        # via edx-enterprise, requests
cffi==1.12.3              # via cryptography, edx-enterprise
chardet==3.0.4            # via edx-enterprise, requests
click==7.0                # via code-annotations, edx-enterprise
code-annotations==0.3.1   # via edx-enterprise
cryptography==2.7         # via django-fernet-fields, edx-enterprise
defusedxml==0.5.0         # via djangorestframework-xml, edx-enterprise
django-config-models==1.0.1  # via edx-enterprise
django-countries==4.6.1   # via edx-enterprise
django-crum==0.7.3        # via edx-enterprise, edx-rbac
django-fernet-fields==0.6  # via edx-enterprise
django-filter==1.0.4      # via edx-enterprise
django-ipware==2.1.0      # via edx-enterprise
django-model-utils==3.0.0  # via edx-enterprise, edx-rbac
django-multi-email-field==0.5.1  # via edx-enterprise
django-object-actions==0.10.0  # via edx-enterprise
django-simple-history==2.7.0  # via edx-enterprise
django-waffle==0.12.0     # via edx-django-utils, edx-drf-extensions, edx-enterprise
django==1.11.22           # via code-annotations, django-config-models, django-crum, django-fernet-fields, django-model-utils, django-multi-email-field, edx-django-oauth2-provider, edx-django-utils, edx-drf-extensions, edx-enterprise, edx-opaque-keys, edx-rbac, jsonfield, rest-condition
djangorestframework-jwt==1.11.0  # via edx-drf-extensions, edx-enterprise
git+https://github.com/edx/django-rest-framework-oauth.git@0a43e8525f1e3048efe4bc70c03de308a277197c#egg=djangorestframework-oauth==1.1.1
djangorestframework-xml==1.3.0  # via edx-enterprise
djangorestframework==3.7.7  # via django-config-models, edx-drf-extensions, edx-enterprise, rest-condition
edx-django-oauth2-provider==1.3.5  # via edx-enterprise
edx-django-utils==2.0.0   # via edx-drf-extensions, edx-enterprise
edx-drf-extensions==2.3.1  # via edx-enterprise, edx-rbac
edx-enterprise==1.7.2
edx-opaque-keys[django]==1.0.1  # via edx-drf-extensions, edx-enterprise
edx-rbac==0.2.1           # via edx-enterprise
edx-rest-api-client==1.9.2  # via edx-enterprise
enum34==1.1.6             # via edx-enterprise
future==0.17.1            # via edx-enterprise, pyjwkest
html5lib==1.0.1           # via bleach, edx-enterprise
idna==2.8                 # via edx-enterprise, requests
ipaddress==1.0.22         # via edx-enterprise
jinja2==2.10.1            # via code-annotations, edx-enterprise
jsondiff==1.1.1           # via edx-enterprise
jsonfield==2.0.2          # via edx-enterprise
kombu==3.0.37             # via celery, edx-enterprise
markupsafe==1.1.1         # via edx-enterprise, jinja2
newrelic==4.20.1.121      # via edx-django-utils, edx-enterprise
path.py==8.2.1            # via edx-enterprise
pbr==5.4.0                # via edx-enterprise, stevedore
pillow==6.1.0             # via edx-enterprise
psutil==1.2.1             # via edx-django-utils, edx-drf-extensions, edx-enterprise
pycparser==2.19           # via cffi, edx-enterprise
pycryptodomex==3.4.7      # via edx-enterprise, pyjwkest
pyjwkest==1.3.2           # via edx-drf-extensions, edx-enterprise
pyjwt==1.5.2              # via djangorestframework-jwt, edx-enterprise, edx-rest-api-client
pymongo==2.9.1            # via edx-enterprise, edx-opaque-keys
python-dateutil==2.4.0    # via edx-drf-extensions, edx-enterprise
python-slugify==1.2.6     # via code-annotations, edx-enterprise
pytz==2019.1              # via celery, django, edx-enterprise, tincan
pyyaml==5.1.1             # via code-annotations, edx-enterprise
requests==2.22.0          # via edx-drf-extensions, edx-enterprise, edx-rest-api-client, pyjwkest, slumber
rest-condition==1.0.3     # via edx-drf-extensions, edx-enterprise
rules==2.0.1              # via edx-enterprise
semantic-version==2.6.0   # via edx-drf-extensions, edx-enterprise
shortuuid==0.5.0          # via edx-django-oauth2-provider, edx-enterprise
six==1.11.0               # via bleach, cryptography, edx-drf-extensions, edx-enterprise, edx-opaque-keys, edx-rbac, html5lib, pyjwkest, python-dateutil, stevedore
slumber==0.7.1            # via edx-enterprise, edx-rest-api-client
stevedore==1.30.1         # via code-annotations, edx-enterprise, edx-opaque-keys
testfixtures==6.10.0      # via edx-enterprise
tincan==0.0.5             # via edx-enterprise
unicodecsv==0.14.1        # via edx-enterprise
unidecode==1.1.1          # via edx-enterprise, python-slugify
urllib3==1.23             # via edx-enterprise, requests
webencodings==0.5.1       # via edx-enterprise, html5lib
+ pip install pip-tools==3.9.0
Collecting pip-tools==3.9.0
Using cached https://files.pythonhosted.org/packages/9e/57/f793afe4057a90f072fbe9ecf20599a6b141e4ba06d0dacb0b8ab3722aa6/pip_tools-3.9.0-py2.py3-none-any.whl
Requirement already satisfied: click>=6 in /usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages (from pip-tools==3.9.0) (7.0)
Requirement already satisfied: six in /usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages (from pip-tools==3.9.0) (1.12.0)
Installing collected packages: pip-tools
Found existing installation: pip-tools 3.8.0
Uninstalling pip-tools-3.8.0:
Successfully uninstalled pip-tools-3.8.0
Successfully installed pip-tools-3.9.0
+ pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o good39.txt good.in
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --no-emit-trusted-host --no-index --output-file=good39.txt good.in
#
-e git+https://github.com/edx/django-rest-framework-oauth.git@0a43e8525f1e3048efe4bc70c03de308a277197c#egg=djangorestframework-oauth==1.1.1
amqp==1.4.9               # via edx-enterprise, kombu
aniso8601==7.0.0          # via edx-enterprise, tincan
anyjson==0.3.3            # via edx-enterprise, kombu
asn1crypto==0.24.0        # via cryptography, edx-enterprise
billiard==3.3.0.23        # via celery, edx-enterprise
bleach==2.1.4             # via edx-enterprise
celery==3.1.25            # via edx-enterprise
certifi==2019.6.16        # via edx-enterprise, requests
cffi==1.12.3              # via cryptography, edx-enterprise
chardet==3.0.4            # via edx-enterprise, requests
click==7.0                # via code-annotations, edx-enterprise
code-annotations==0.3.1   # via edx-enterprise
cryptography==2.7         # via django-fernet-fields, edx-enterprise
defusedxml==0.5.0         # via djangorestframework-xml, edx-enterprise
django-config-models==1.0.1  # via edx-enterprise
django-countries==4.6.1   # via edx-enterprise
django-crum==0.7.3        # via edx-enterprise, edx-rbac
django-fernet-fields==0.6  # via edx-enterprise
django-filter==1.0.4      # via edx-enterprise
django-ipware==2.1.0      # via edx-enterprise
django-model-utils==3.0.0  # via edx-enterprise, edx-rbac
django-multi-email-field==0.5.1  # via edx-enterprise
django-object-actions==0.10.0  # via edx-enterprise
django-simple-history==2.7.0  # via edx-enterprise
django-waffle==0.12.0     # via edx-django-utils, edx-drf-extensions, edx-enterprise
django==1.11.22           # via code-annotations, django-config-models, django-crum, django-fernet-fields, django-model-utils, django-multi-email-field, edx-django-oauth2-provider, edx-django-utils, edx-drf-extensions, edx-enterprise, edx-opaque-keys, edx-rbac, jsonfield, rest-condition
djangorestframework-jwt==1.11.0  # via edx-drf-extensions, edx-enterprise
djangorestframework-xml==1.3.0  # via edx-enterprise
djangorestframework==3.7.7  # via django-config-models, edx-drf-extensions, edx-enterprise, rest-condition
edx-django-oauth2-provider==1.3.5  # via edx-enterprise
edx-django-utils==2.0.0   # via edx-drf-extensions, edx-enterprise
edx-drf-extensions==2.3.1  # via edx-enterprise, edx-rbac
edx-enterprise==1.7.2
edx-opaque-keys==1.0.1    # via edx-drf-extensions, edx-enterprise
edx-rbac==0.2.1           # via edx-enterprise
edx-rest-api-client==1.9.2  # via edx-enterprise
enum34==1.1.6             # via edx-enterprise
future==0.17.1            # via edx-enterprise, pyjwkest
html5lib==1.0.1           # via bleach, edx-enterprise
idna==2.8                 # via edx-enterprise, requests
ipaddress==1.0.22         # via edx-enterprise
jinja2==2.10.1            # via code-annotations, edx-enterprise
jsondiff==1.1.1           # via edx-enterprise
jsonfield==2.0.2          # via edx-enterprise
kombu==3.0.37             # via celery, edx-enterprise
markupsafe==1.1.1         # via edx-enterprise, jinja2
newrelic==4.20.1.121      # via edx-django-utils, edx-enterprise
path.py==8.2.1            # via edx-enterprise
pbr==5.4.0                # via edx-enterprise, stevedore
pillow==6.1.0             # via edx-enterprise
psutil==1.2.1             # via edx-django-utils, edx-drf-extensions, edx-enterprise
pycparser==2.19           # via cffi, edx-enterprise
pycryptodomex==3.4.7      # via edx-enterprise, pyjwkest
pyjwkest==1.3.2           # via edx-drf-extensions, edx-enterprise
pyjwt==1.5.2              # via djangorestframework-jwt, edx-enterprise, edx-rest-api-client
pymongo==2.9.1            # via edx-enterprise, edx-opaque-keys
python-dateutil==2.4.0    # via edx-drf-extensions, edx-enterprise
python-slugify==1.2.6     # via code-annotations, edx-enterprise
pytz==2019.1              # via celery, django, edx-enterprise, tincan
pyyaml==5.1.1             # via code-annotations, edx-enterprise
requests==2.22.0          # via edx-drf-extensions, edx-enterprise, edx-rest-api-client, pyjwkest, slumber
rest-condition==1.0.3     # via edx-drf-extensions, edx-enterprise
rules==2.0.1              # via edx-enterprise
semantic-version==2.6.0   # via edx-drf-extensions, edx-enterprise
shortuuid==0.5.0          # via edx-django-oauth2-provider, edx-enterprise
six==1.11.0               # via bleach, cryptography, edx-drf-extensions, edx-enterprise, edx-opaque-keys, edx-rbac, html5lib, pyjwkest, python-dateutil, stevedore
slumber==0.7.1            # via edx-enterprise, edx-rest-api-client
stevedore==1.30.1         # via code-annotations, edx-enterprise, edx-opaque-keys
testfixtures==6.10.0      # via edx-enterprise
tincan==0.0.5             # via edx-enterprise
unicodecsv==0.14.1        # via edx-enterprise
unidecode==1.1.1          # via edx-enterprise, python-slugify
urllib3==1.23             # via edx-enterprise, requests
webencodings==0.5.1       # via edx-enterprise, html5lib
+ pip-compile --no-emit-trusted-host --no-index --rebuild --upgrade -o bad39.txt bad.in
Could not find a version that satisfies the requirement djangorestframework-oauth==1.1.1 (from -r bad.in (line 1)) (from versions: 0.1.0, 0.2.0, 1.0.0, 1.0.1, 1.1.0)
Traceback (most recent call last):
File "/usr/local/virtualenvs/tmp-54acc534662972d2/bin/pip-compile", line 10, in <module>
sys.exit(cli())
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/piptools/scripts/compile.py", line 350, in cli
results = resolver.resolve(max_rounds=max_rounds)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/piptools/resolver.py", line 164, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/piptools/resolver.py", line 259, in _resolve_one_round
their_constraints.extend(self._iter_dependencies(best_match))
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/piptools/resolver.py", line 354, in _iter_dependencies
dependencies = self.repository.get_dependencies(ireq)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/piptools/repositories/pypi.py", line 270, in get_dependencies
download_dir, ireq, wheel_cache
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/piptools/repositories/pypi.py", line 229, in resolve_reqs
results = resolver._resolve_one(reqset, ireq)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/pip/_internal/resolve.py", line 294, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
self.require_hashes
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 282, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 198, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/pip/_internal/index.py", line 792, in find_requirement
'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for djangorestframework-oauth==1.1.1 (from -r bad.in (line 1))
+ diff good38.txt good39.txt
5c5
< #    pip-compile --no-emit-trusted-host --no-index --output-file=good38.txt good.in
---
#    pip-compile --no-emit-trusted-host --no-index --output-file=good39.txt good.in
41c41
< edx-opaque-keys[django]==1.0.1  # via edx-drf-extensions, edx-enterprise
---
edx-opaque-keys==1.0.1    # via edx-drf-extensions, edx-enterprise

$ pip --version
pip 19.1.1 from /usr/local/virtualenvs/tmp-54acc534662972d2/lib/python3.7/site-packages/pip (python 3.7)

# Fixed code
def _resolve_one_round(self):
    """
    Resolves one level of the current constraints, by finding the best
    match for each package in the repository and adding all requirements
    for those best package versions.  Some of these constraints may be new
    or updated.

    Returns whether new constraints appeared in this round.  If no
    constraints were added or changed, this indicates a stable
    configuration.
    """
    # Sort this list for readability of terminal output
    constraints = sorted(self.constraints, key=key_from_ireq)

    log.debug("Current constraints:")
    for constraint in constraints:
        log.debug("  {}".format(constraint))

    log.debug("")
    log.debug("Finding the best candidates:")
    best_matches = {self.get_best_match(ireq) for ireq in constraints}

    # Find the new set of secondary dependencies
    log.debug("")
    log.debug("Finding secondary dependencies:")

    their_constraints = []
    for best_match in best_matches:
        their_constraints.extend(self._iter_dependencies(best_match))
    # Grouping constraints to make clean diff between rounds
    theirs = set(self._group_constraints(sorted(their_constraints, key=str)))

    # NOTE: We need to compare RequirementSummary objects, since
    # InstallRequirement does not define equality
    diff = {RequirementSummary(t) for t in theirs} - {
        RequirementSummary(t) for t in self.their_constraints
    }
    removed = {RequirementSummary(t) for t in self.their_constraints} - {
        RequirementSummary(t) for t in theirs
    }

    has_changed = len(diff) > 0 or len(removed) > 0
    if has_changed:
        log.debug("")
        log.debug("New dependencies found in this round:")
        for new_dependency in sorted(diff, key=lambda req: key_from_req(req.req)):
            log.debug("  adding {}".format(new_dependency))
        log.debug("Removed dependencies in this round:")
        for removed_dependency in sorted(
            removed, key=lambda req: key_from_req(req.req)
        ):
            log.debug("  removing {}".format(removed_dependency))

    # Store the last round's results in the their_constraints
    self.their_constraints = theirs
    return has_changed, best_matches