diff options
-rw-r--r-- | exts/importer_pip_common.py | 2 | ||||
-rwxr-xr-x | exts/pip.find_deps | 10 | ||||
-rwxr-xr-x | exts/pip.to_lorry | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/exts/importer_pip_common.py b/exts/importer_pip_common.py index ac003b5..be8346d 100644 --- a/exts/importer_pip_common.py +++ b/exts/importer_pip_common.py @@ -60,7 +60,7 @@ def name_or_closest(client, package_name): logging.debug('Filtered results: %s' % results) - return results[0]['name'] + return results[0]['name'] if len(results) > 0 else None def find_releases(client, package_name): diff --git a/exts/pip.find_deps b/exts/pip.find_deps index 5bccbef..5e52d19 100755 --- a/exts/pip.find_deps +++ b/exts/pip.find_deps @@ -182,6 +182,9 @@ def resolve_versions(specsets): # Bit of a hack to deal with pypi case insensitivity new_proj_name = name_or_closest(client, proj_name) + if new_proj_name == None: + error("Couldn't find any project with name '%s'" % proj_name) + logging.debug("Treating %s as %s" % (proj_name, new_proj_name)) proj_name = new_proj_name @@ -330,8 +333,11 @@ def main(): client = xmlrpclib.ServerProxy(PYPI_URL) new_name = name_or_closest(client, name) - if name != new_name: - logging.debug('Treating %s as %s' % (name, new_name)) + + if new_name == None: + error("Couldn't find any project with name '%s'" % name) + + logging.debug('Treating %s as %s' % (name, new_name)) name = new_name deps = {} diff --git a/exts/pip.to_lorry b/exts/pip.to_lorry index 557b53e..451c9a7 100755 --- a/exts/pip.to_lorry +++ b/exts/pip.to_lorry @@ -204,6 +204,10 @@ def main(): # TODO: do not overwrite the original name, create a new attribute # hurray for this dynamic language! >.> new_proj_name = name_or_closest(client, req.project_name) + + if new_proj_name == None: + error("Couldn't find any project with name '%s'" % req.project_name) + logging.debug('Treating %s as %s' % (req.project_name, new_proj_name)) req.project_name = new_proj_name |