Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Stop calling pip internal APIs to make laniakea work with pip 10. #30

Merged

Conversation

nth10sd
Copy link
Contributor

@nth10sd nth10sd commented May 5, 2018

Currently, using Laniakea with pip 10 throws, but works with pip 9.

From pip 10 release notes:

Move all of pip's APIs into the pip._internal package, properly reflecting the fact that pip does not currently have any public APIs. (#4696, #4700)

This means that from pip 10 onwards, we can no longer call pip.main anymore, nor should we rely on it. Instead, we should put the azure package requirement into requirements.txt.

@nth10sd nth10sd added the bug label May 5, 2018
@nth10sd nth10sd self-assigned this May 5, 2018
@nth10sd nth10sd requested review from rforbes and posidron May 5, 2018 00:14
@posidron
Copy link
Contributor

posidron commented May 7, 2018

Meh. Is there any other way? I purposed that cause azure is quite heavy and user shouldn't have to fetch it if he doesn't intend to use the azure module.

@posidron
Copy link
Contributor

posidron commented May 7, 2018

The only thought which comes to my mind would be to create separate requirement.txt (i.e amazon.txt, azure.txt) files but that probably could get messy in the root folder.

@jschwartzentruber
Copy link
Contributor

Not sure exactly how to set it up, but in celery you can do eg. pip install celery[sqs] and you get celery plus optional dependencies to support the SQS backend. They use a subdirectory of requirements.txt files and a complicated setup.py script.

@jschwartzentruber
Copy link
Contributor

You could also just forget trying to install it, and print a message to the user that azure is required to use the azure backend.

@posidron
Copy link
Contributor

posidron commented May 7, 2018

So that link from above https://github.com/celery/celery/tree/master/requirements looks like what I was thinking of. @nth10sd could you take that over and adapt your fix to that? I would rather have it like that, rather than a print statement followed by a sys.exit. It's frustrating as a user to see such kind of aborts caused by missing dependencies.
I am not sure exactly but IIRC there was an option to include a requirements.txt into another one. In that case there should exist also a all.txt file in the newly created requirements folder.

@nth10sd
Copy link
Contributor Author

nth10sd commented May 7, 2018

@posidron I'd propose for now to unbreak pip 10 with this first, that requirements format in celery seems like another PR.

@posidron posidron merged commit 0a39e7c into MozillaSecurity:master May 7, 2018
@nth10sd nth10sd deleted the stop-calling-internal-pip-apis branch May 7, 2018 22:08
rforbes pushed a commit that referenced this pull request May 30, 2018
Stop calling pip internal APIs to make laniakea work with pip 10.
posidron added a commit that referenced this pull request Jun 6, 2018
Stop calling pip internal APIs to make laniakea work with pip 10.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants