-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What should we do with unparseable requirements? #1077
Comments
(Comment copied over, originally written by @AntonyMilneQB) Just chatted with @idanov; here's his opinion.
|
(Comment copied over, originally written by @idanov)
|
(Comment copied over, originally written by @lorenabalan) Probably related to Ivan's point - #844 |
(NB Copied over the issue & comments with minor edits from the private-kedro repository that will soon be archived. Original ticket was written by @AntonyMilneQB)
We're running into some problems with "unparseable" requirements in requirements.txt. By this I mean requirements which are valid in a requirements file (i.e. when you do
pip install -r requirements.txt
) but are not valid ininstall_requires
in setup.py. These are requirements like:The common cause of bug reports (KED-2897, KED-2346) is the local whl file case, but the other things above will cause exactly the same sort of error. In the case of a local wheel file there is a workaround (use
package @ file:///path/to/package.whl
) but in the other cases there isn't. Packaging a local wheel or the other options doesn't make sense anyway, so the error message is fair enough.Now there's currently three places where this is relevant:
kedro pipeline package
. Following Cloud native credentials storage #1280, this gives an error when a user tries packaging a pipeline with unparseable requirements in requirements.txt.kedro package
. Currently this gives an error for some and silently ignores other unparseable requirements.kedro build-docs
. This crashes horribly when there's unparseable requirements in requirements.txt (KED-2346), which shouldn't be the case - a user should be able to build docs regardless of what's in their requirements file.Problems
Inconsistent behaviour between
kedro pipeline package
andkedro package
(and arguably even withinkedro package
).kedro build-docs
failing. The reason is this doespip install src[docs]
to install theextra_requires
(sphinx etc.), which will try to installinstall_requires
also and then give an error because there's unparseable stuff in requirements.txt.Solutions
Either make both commands silently ignore unparseable requirements or make both commands fail as soon as there's any unparseable requirement. I can see arguments both ways here but prefer the hard fail option - as @lorenabalan said, otherwise "it gives the wrong impression to the user that the resulting package can actually be run somewhere else, when in reality it can't".
The only options I see here are: silently ignore unparseable requirements in project setup.py (which conflicts with my preferred option for 1) or somehow get the
kedro build-docs
command to install the document requirements in a way that bypasses setup.py (but how?). I don't think there's any way of gettingpip install src[docs]
to ignoreinstall_requires
or parse requirements.txt differently from when you dokedro package
(which also runs setup.py). So the behaviour ofkedro package
is currently tightly coupled to that ofkedro build-docs
thanks topip install src[docs]
- is there any way to change that?The text was updated successfully, but these errors were encountered: