nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ buildPythonPackage
2, fetchPypi
3, pytest
4, six
5, tqdm
6, pyyaml
7, docopt
8, requests
9, jsonpatch
10, args
11, schema
12, responses
13, backports_csv
14, isPy3k
15, lib
16, glibcLocales
17, setuptools
18}:
19
20buildPythonPackage rec {
21 pname = "internetarchive";
22 version = "2.0.3";
23
24 src = fetchPypi {
25 inherit pname version;
26 sha256 = "2ce0ab89fea37e5b2311bc7d163955e84f73f6beeac3942e17e9d51ad7cc9ffa";
27 };
28
29 propagatedBuildInputs = [
30 six
31 tqdm
32 pyyaml
33 docopt
34 requests
35 jsonpatch
36 args
37 schema
38 setuptools
39 ] ++ lib.optionals (!isPy3k) [ backports_csv ];
40
41 checkInputs = [ pytest responses glibcLocales ];
42
43 # tests depend on network
44 doCheck = false;
45
46 checkPhase = ''
47 LC_ALL=en_US.utf-8 pytest tests
48 '';
49
50 pythonImportsCheck = [ "internetarchive" ];
51
52 meta = with lib; {
53 description = "A Python and Command-Line Interface to Archive.org";
54 homepage = "https://github.com/jjjake/internetarchive";
55 changelog = "https://github.com/jjjake/internetarchive/raw/v${version}/HISTORY.rst";
56 license = licenses.agpl3Plus;
57 maintainers = [ maintainers.marsam ];
58 };
59}