-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Merged
Merged
kaggle: init at 1.5.6 #92147
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ buildPythonPackage | ||
, certifi | ||
, fetchPypi | ||
, lib | ||
, python-dateutil | ||
, python-slugify | ||
, six | ||
, requests | ||
, tqdm | ||
, urllib3 | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "kaggle"; | ||
version = "1.5.6"; | ||
|
||
src = fetchPypi { | ||
inherit pname version; | ||
sha256 = "0f5qrkgklcpgbwncrif7aw4f86dychqplh7k3f4rljwnr9yhjb1w"; | ||
}; | ||
|
||
# The version bounds in the setup.py file are unnecessarily restrictive. | ||
patchPhase = '' | ||
substituteInPlace setup.py \ | ||
--replace 'urllib3 >= 1.21.1, < 1.25' 'urllib3' | ||
''; | ||
|
||
propagatedBuildInputs = [ | ||
certifi | ||
python-dateutil | ||
python-slugify | ||
requests | ||
six | ||
tqdm | ||
urllib3 | ||
]; | ||
|
||
# Tests try to access the network. | ||
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" ]; | ||
|
||
meta = with lib; { | ||
description = "Official API for https://www.kaggle.com, accessible using a command line tool implemented in Python 3"; | ||
homepage = "https://github.com/Kaggle/kaggle-api"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ cdepillabout ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)