This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
requirements.nix
221 lines (205 loc) · 7.82 KB
/
requirements.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# generated using pypi2nix tool (version: 2.0.4)
# See more at: https://github.com/nix-community/pypi2nix
#
# COMMAND:
# pypi2nix -e docopt -e PyYAML -e requests
#
{ pkgs ? import <nixpkgs> {},
overrides ? ({ pkgs, python }: self: super: {})
}:
let
inherit (pkgs) makeWrapper;
inherit (pkgs.stdenv.lib) fix' extends inNixShell;
pythonPackages =
import "${toString pkgs.path}/pkgs/top-level/python-packages.nix" {
inherit pkgs;
inherit (pkgs) stdenv;
python = pkgs.python3;
};
commonBuildInputs = [];
commonDoCheck = false;
withPackages = pkgs':
let
pkgs = builtins.removeAttrs pkgs' ["__unfix__"];
interpreterWithPackages = selectPkgsFn: pythonPackages.buildPythonPackage {
name = "python3-interpreter";
buildInputs = [ makeWrapper ] ++ (selectPkgsFn pkgs);
buildCommand = ''
mkdir -p $out/bin
ln -s ${pythonPackages.python.interpreter} \
$out/bin/${pythonPackages.python.executable}
for dep in ${builtins.concatStringsSep " "
(selectPkgsFn pkgs)}; do
if [ -d "$dep/bin" ]; then
for prog in "$dep/bin/"*; do
if [ -x "$prog" ] && [ -f "$prog" ]; then
ln -s $prog $out/bin/`basename $prog`
fi
done
fi
done
for prog in "$out/bin/"*; do
wrapProgram "$prog" --prefix PYTHONPATH : "$PYTHONPATH"
done
pushd $out/bin
ln -s ${pythonPackages.python.executable} python
ln -s ${pythonPackages.python.executable} \
python3
popd
'';
passthru.interpreter = pythonPackages.python;
};
interpreter = interpreterWithPackages builtins.attrValues;
in {
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = args: pythonPackages.buildPythonPackage (args // {
nativeBuildInputs = (args.nativeBuildInputs or []) ++ args.buildInputs;
});
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
drv.drvAttrs // f drv.drvAttrs // { meta = drv.meta; }
);
withPackages = pkgs'':
withPackages (pkgs // pkgs'');
};
python = withPackages {};
generated = self: {
"certifi" = python.mkDerivation {
name = "certifi-2020.6.20";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/40/a7/ded59fa294b85ca206082306bba75469a38ea1c7d44ea7e1d64f5443d67a/certifi-2020.6.20.tar.gz";
sha256 = "5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://certifiio.readthedocs.io/en/latest/";
license = licenses.mpl20;
description = "Python package for providing Mozilla's CA Bundle.";
};
};
"chardet" = python.mkDerivation {
name = "chardet-3.0.4";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz";
sha256 = "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://github.com/chardet/chardet";
license = licenses.lgpl2;
description = "Universal encoding detector for Python 2 and 3";
};
};
"docopt" = python.mkDerivation {
name = "docopt-0.6.2";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz";
sha256 = "49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "http://docopt.org";
license = licenses.mit;
description = "Pythonic argument parser, that will make you smile";
};
};
"idna" = python.mkDerivation {
name = "idna-2.10";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz";
sha256 = "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://github.com/kjd/idna";
license = licenses.bsdOriginal;
description = "Internationalized Domain Names in Applications (IDNA)";
};
};
"pyyaml" = python.mkDerivation {
name = "pyyaml-5.3.1";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz";
sha256 = "b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://github.com/yaml/pyyaml";
license = licenses.mit;
description = "YAML parser and emitter for Python";
};
};
"requests" = python.mkDerivation {
name = "requests-2.24.0";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/da/67/672b422d9daf07365259958912ba533a0ecab839d4084c487a5fe9a5405f/requests-2.24.0.tar.gz";
sha256 = "b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [
self."certifi"
self."chardet"
self."idna"
self."urllib3"
];
meta = with pkgs.stdenv.lib; {
homepage = "https://requests.readthedocs.io";
license = licenses.asl20;
description = "Python HTTP for Humans.";
};
};
"urllib3" = python.mkDerivation {
name = "urllib3-1.25.9";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/05/8c/40cd6949373e23081b3ea20d5594ae523e681b6f472e600fbc95ed046a36/urllib3-1.25.9.tar.gz";
sha256 = "3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527";
};
doCheck = commonDoCheck;
format = "setuptools";
buildInputs = commonBuildInputs ++ [ ];
propagatedBuildInputs = [ ];
meta = with pkgs.stdenv.lib; {
homepage = "https://urllib3.readthedocs.io/";
license = licenses.mit;
description = "HTTP library with thread-safe connection pooling, file post, and more.";
};
};
};
localOverridesFile = ./requirements_override.nix;
localOverrides = import localOverridesFile { inherit pkgs python; };
commonOverrides = [
(let src = pkgs.fetchFromGitHub { owner = "nix-community"; repo = "pypi2nix-overrides"; rev = "90e891e83ffd9e55917c48d24624454620d112f0"; sha256 = "0cl1r3sxibgn1ks9xyf5n3rdawq4hlcw4n6xfhg3s1kknz54jp9y"; } ; in import "${src}/overrides.nix" { inherit pkgs python; })
];
paramOverrides = [
(overrides { inherit pkgs python; })
];
allOverrides =
(if (builtins.pathExists localOverridesFile)
then [localOverrides] else [] ) ++ commonOverrides ++ paramOverrides;
in python.withPackages
(fix' (pkgs.lib.fold
extends
generated
allOverrides
)
)