nixpkgs/pkgs/development/python-modules/internetarchive/default.nix
Matthew Harm Bekkema 2cbb2590aa 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 16:51:12 +01:00

44 lines
1012 B
Nix

{ buildPythonPackage, fetchFromGitHub, pytest, six, clint, pyyaml, docopt
, requests, jsonpatch, args, schema, responses, backports_csv, isPy3k
, lib, glibcLocales, setuptools }:
buildPythonPackage rec {
pname = "internetarchive";
version = "1.8.1";
# Can't use pypi, data files for tests missing
src = fetchFromGitHub {
owner = "jjjake";
repo = "internetarchive";
rev = "v${version}";
sha256 = "1fdb0kr9hzgyh0l8d02khcjpsgyd63nbablhc49ncdsav3dhhr3f";
};
propagatedBuildInputs = [
six
clint
pyyaml
docopt
requests
jsonpatch
args
schema
setuptools
] ++ lib.optional (!isPy3k) backports_csv;
checkInputs = [ pytest responses glibcLocales ];
# tests depend on network
doCheck = false;
checkPhase = ''
LC_ALL=en_US.utf-8 pytest tests
'';
meta = with lib; {
description = "A python wrapper for the various Internet Archive APIs";
homepage = https://github.com/jjjake/internetarchive;
license = licenses.agpl3;
};
}