-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
kaggle: init at 1.5.6 #92147
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
kaggle: init at 1.5.6 #92147
Conversation
@GrahamcOfBorg build kaggle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passes nixpkgs-review
build and --help
test. But certainly that ugly error message you mentioned is brought up unless an api key is located at ~/.kaggle/kaggle.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM
Co-authored-by: Jon <jonringer@users.noreply.github.com>
checkPhase = '' | ||
export HOME="$TMP" | ||
mkdir -p "$HOME/.kaggle/" | ||
echo '{"username":"foobar","key":"00000000000000000000000000000000"}' > "$HOME/.kaggle/kaggle.json" | ||
$out/bin/kaggle --help > /dev/null | ||
''; | ||
pythonImportsCheck = [ "kaggle" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonringer Thanks for the tip!
Unfortunately, kaggle
requires the file ~/.kaggle/kaggle.json
to exist, otherwise the CLI throws an exception and ends the process with an error code.
In order to make kaggle --help
not end with an error code, I had to create fake api credentials. This is somewhat hacky, but still appears to work for simple things that don't involve actually hitting the API (like just calling --help
).
I've confirmed this builds, so if this looks alright, I'd be happy to go ahead and merge this in.
@GrahamcOfBorg build kaggle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the warning if fine, the $out/bin/kaggle --help
still returns 0, even with the warnings.
My main concern is just that a dependency bump map break it, and we won't know about it until runtime (after someone does an update and the package then fails)
Hmm, maybe ofborg didn't see my last command @GrahamcOfBorg build kaggle |
not sure if ofborg see's reviews, it may only apply to comments |
Motivation for this change
This adds the
kaggle
package, which can be used to interact with the API for https://www.kaggle.com/.Note that if you try to build and run this, you will be presented with an error message like the following:
You have to actually create the
~/.kaggle/kaggle.json
file as described in the README.md.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)