2020-05-07 10:20:00 +01:00
|
|
|
{ buildPythonPackage
|
2020-10-10 15:08:58 +01:00
|
|
|
, fetchPypi
|
2020-05-07 10:20:00 +01:00
|
|
|
, pytest
|
|
|
|
, six
|
|
|
|
, tqdm
|
|
|
|
, pyyaml
|
|
|
|
, docopt
|
|
|
|
, requests
|
|
|
|
, jsonpatch
|
|
|
|
, args
|
|
|
|
, schema
|
|
|
|
, responses
|
|
|
|
, backports_csv
|
|
|
|
, isPy3k
|
|
|
|
, lib
|
|
|
|
, glibcLocales
|
|
|
|
, setuptools
|
|
|
|
}:
|
2017-09-16 23:41:09 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "internetarchive";
|
2021-01-28 04:20:00 +00:00
|
|
|
version = "1.9.9";
|
2020-10-10 15:08:58 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-01-28 04:20:00 +00:00
|
|
|
sha256 = "a1614cbf35499d833e07699ddfd344764f86959fd5535aa9ce1203f57a77f970";
|
2017-09-16 23:41:09 +01:00
|
|
|
};
|
|
|
|
|
2018-11-18 01:22:38 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
2020-05-07 10:20:00 +01:00
|
|
|
tqdm
|
2018-11-18 01:22:38 +00:00
|
|
|
pyyaml
|
|
|
|
docopt
|
|
|
|
requests
|
|
|
|
jsonpatch
|
|
|
|
args
|
|
|
|
schema
|
internetarchive: Provide setuptools at runtime
Since commit f7e28bf5d8181926e600a222cb70180519d09726 ("Split
buildPythonPackage into setup hooks"), the `ia` command provided by this
package has crashed with the error:
Traceback (most recent call last):
File "/nix/store/7n1jf081h0qnj82m2s69mxzj02zf746f-python3.7-internetarchive-1.8.1/bin/.ia-wrapped", line 7, in <module>
from internetarchive.cli.ia import main
File "/nix/store/7n1jf081h0qnj82m2s69mxzj02zf746f-python3.7-internetarchive-1.8.1/lib/python3.7/site-packages/internetarchive/cli/__init__.py", line 27, in <module>
from internetarchive.cli import ia, ia_configure, ia_delete, ia_download, ia_list, \
File "/nix/store/7n1jf081h0qnj82m2s69mxzj02zf746f-python3.7-internetarchive-1.8.1/lib/python3.7/site-packages/internetarchive/cli/ia.py", line 60, in <module>
from pkg_resources import iter_entry_points, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'
This commit fixes that by adding `setuptools` (which contains the
'pkg_resources' module) to `propagatedBuildInputs`.
2019-12-11 09:21:41 +00:00
|
|
|
setuptools
|
2020-05-07 10:20:00 +01:00
|
|
|
] ++ lib.optionals (!isPy3k) [ backports_csv ];
|
2017-09-16 23:41:09 +01:00
|
|
|
|
2018-11-18 01:22:38 +00:00
|
|
|
checkInputs = [ pytest responses glibcLocales ];
|
2017-09-16 23:41:09 +01:00
|
|
|
|
2018-11-18 01:22:38 +00:00
|
|
|
# tests depend on network
|
|
|
|
doCheck = false;
|
2017-09-16 23:41:09 +01:00
|
|
|
|
2018-11-18 01:22:38 +00:00
|
|
|
checkPhase = ''
|
|
|
|
LC_ALL=en_US.utf-8 pytest tests
|
|
|
|
'';
|
2017-09-16 23:41:09 +01:00
|
|
|
|
2020-10-10 15:08:58 +01:00
|
|
|
pythonImportsCheck = [ "internetarchive" ];
|
|
|
|
|
2018-11-18 01:22:38 +00:00
|
|
|
meta = with lib; {
|
2020-05-07 10:20:00 +01:00
|
|
|
description = "A Python and Command-Line Interface to Archive.org";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/jjjake/internetarchive";
|
2017-09-16 23:41:09 +01:00
|
|
|
license = licenses.agpl3;
|
2020-05-07 10:21:00 +01:00
|
|
|
maintainers = [ maintainers.marsam ];
|
2017-09-16 23:41:09 +01:00
|
|
|
};
|
|
|
|
}
|