1
- { stdenv , fetchurl , python , zip , makeWrapper , nix , nix-prefetch-scripts
1
+ { stdenv , fetchurl , pythonPackages , zip , makeWrapper , nix , nix-prefetch-git
2
+ , nix-prefetch-hg
2
3
} :
3
4
4
5
let
5
6
6
- version = "1.6 .0" ;
7
+ version = "1.8 .0" ;
7
8
8
9
src = fetchurl {
9
10
url = "https://github.com/garbas/pypi2nix/archive/v${ version } .tar.gz" ;
10
- sha256 = "08iad1ad2gnvsnd66ddw3lff19ms2yly4iq63c8800j603d0pdhn " ;
11
+ sha256 = "133sjx8r1jdb5gi3caawa9m7v496jv4id2c3zqnx8hria22425za " ;
11
12
} ;
12
13
13
14
click = fetchurl {
14
- url = "https://pypi.python.org/packages/7a/00/c14926d8232b36b08218067bcd5853caefb4737cda3f0a47437151344792 /click-6.6 .tar.gz" ;
15
- sha256 = "1sggipyz52crrybwbr9xvwxd4aqigvplf53k9w3ygxmzivd1jsnc " ;
15
+ url = "https://pypi.python.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897 /click-6.7 .tar.gz" ;
16
+ sha256 = "02qkfpykbq35id8glfgwc38yc430427yd05z1wc5cnld8zgicmgi " ;
16
17
} ;
17
18
18
19
requests = fetchurl {
19
- url = "https://pypi.python.org/packages/5b/0b/34be574b1ec997247796e5d516f3a6b6509c4e064f2885a96ed885ce7579 /requests-2.12.4 .tar.gz" ;
20
- sha256 = "0d5fwxmw4ibynk3imph3n4n84m0n3ib1vj339fxhkqri0qd4767d " ;
20
+ url = "https://pypi.python.org/packages/16/09/37b69de7c924d318e51ece1c4ceb679bf93be9d05973bb30c35babd596e2 /requests-2.13.0 .tar.gz" ;
21
+ sha256 = "1s0wg4any4dsv5l3hqjxqk2zgb7pdbqhy9rhc8kh3aigfq4ws8jp " ;
21
22
} ;
22
23
23
24
in stdenv . mkDerivation rec {
@@ -27,7 +28,11 @@ in stdenv.mkDerivation rec {
27
28
click
28
29
requests
29
30
] ;
30
- buildInputs = [ python zip makeWrapper nix . out nix-prefetch-scripts ] ;
31
+ buildInputs = [
32
+ pythonPackages . python pythonPackages . flake8
33
+ zip makeWrapper nix . out nix-prefetch-git nix-prefetch-hg
34
+ ] ;
35
+
31
36
sourceRoot = "." ;
32
37
33
38
postUnpack = ''
@@ -47,13 +52,14 @@ in stdenv.mkDerivation rec {
47
52
48
53
patchPhase = ''
49
54
sed -i -e "s|default='nix-shell',|default='${ nix . out } /bin/nix-shell',|" $out/pkgs/pypi2nix/cli.py
50
- sed -i -e "s|nix-prefetch-git|${ nix-prefetch-scripts } /bin/nix-prefetch-git|" $out/pkgs/pypi2nix/stage2.py
55
+ sed -i -e "s|nix-prefetch-git|${ nix-prefetch-git } /bin/nix-prefetch-git|" $out/pkgs/pypi2nix/stage2.py
56
+ sed -i -e "s|nix-prefetch-hg|${ nix-prefetch-hg } /bin/nix-prefetch-hg|" $out/pkgs/pypi2nix/stage2.py
51
57
'' ;
52
58
53
59
commonPhase = ''
54
60
mkdir -p $out/bin
55
61
56
- echo "#!${ python . interpreter } " > $out/bin/pypi2nix
62
+ echo "#!${ pythonPackages . python . interpreter } " > $out/bin/pypi2nix
57
63
echo "import pypi2nix.cli" >> $out/bin/pypi2nix
58
64
echo "pypi2nix.cli.main()" >> $out/bin/pypi2nix
59
65
@@ -62,8 +68,16 @@ in stdenv.mkDerivation rec {
62
68
export PYTHONPATH=$out/pkgs:$PYTHONPATH
63
69
'' ;
64
70
71
+ # flake8 doesn't run on python3
72
+ doCheck = false ;
73
+ checkPhase = ''
74
+ flake8 ${ src } /src
75
+ '' ;
76
+
65
77
installPhase = commonPhase + ''
66
- wrapProgram $out/bin/pypi2nix --prefix PYTHONPATH : "$PYTHONPATH"
78
+ wrapProgram $out/bin/pypi2nix \
79
+ --prefix PYTHONPATH : "$PYTHONPATH" \
80
+ --prefix PATH : "${ nix-prefetch-git } /bin:${ nix-prefetch-hg } /bin"
67
81
'' ;
68
82
69
83
shellHook = ''
0 commit comments