tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
update-python-libraries: make hermetic
Peder Bergebakken Sundt
9 months ago
d1b4d379
e10e68af
+16
-11
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
up
update-python-libraries
package.nix
update-python-libraries.py
+6
-4
pkgs/by-name/up/update-python-libraries/package.nix
···
1
{
0
2
python3,
3
runCommand,
4
git,
···
9
runCommand "update-python-libraries"
10
{
11
buildInputs = [
12
-
nix
13
-
nix-prefetch-git
14
(python3.withPackages (
15
ps: with ps; [
16
packaging
···
18
toolz
19
]
20
))
21
-
git
22
];
23
}
24
''
25
cp ${./update-python-libraries.py} $out
26
patchShebangs $out
27
-
substituteInPlace $out --replace 'GIT = "git"' 'GIT = "${git}/bin/git"'
0
0
0
0
28
''
···
1
{
2
+
lib,
3
python3,
4
runCommand,
5
git,
···
10
runCommand "update-python-libraries"
11
{
12
buildInputs = [
0
0
13
(python3.withPackages (
14
ps: with ps; [
15
packaging
···
17
toolz
18
]
19
))
0
20
];
21
}
22
''
23
cp ${./update-python-libraries.py} $out
24
patchShebangs $out
25
+
substituteInPlace $out \
26
+
--replace-fail 'NIX = "nix"' 'NIX = "${lib.getExe nix}"' \
27
+
--replace-fail 'NIX_PREFETCH_URL = "nix-prefetch-url"' 'NIX_PREFETCH_URL = "${lib.getExe' nix "nix-prefetch-url"}"' \
28
+
--replace-fail 'NIX_PREFETCH_GIT = "nix-prefetch-git"' 'NIX_PREFETCH_GIT = "${lib.getExe nix-prefetch-git}"' \
29
+
--replace-fail 'GIT = "git"' 'GIT = "${lib.getExe git}"'
30
''
+10
-7
pkgs/by-name/up/update-python-libraries/update-python-libraries.py
···
36
37
BULK_UPDATE = False
38
0
0
0
39
GIT = "git"
40
41
NIXPKGS_ROOT = (
42
-
subprocess.check_output(["git", "rev-parse", "--show-toplevel"])
43
.decode("utf-8")
44
.strip()
45
)
···
79
try:
80
response = subprocess.check_output(
81
[
82
-
"nix",
83
"--extra-experimental-features",
84
"nix-command",
85
"eval",
···
164
return (
165
subprocess.check_output(
166
[
167
-
"nix",
168
"--extra-experimental-features",
169
"nix-command",
170
"hash",
···
260
try:
261
homepage = subprocess.check_output(
262
[
263
-
"nix",
264
"--extra-experimental-features",
265
"nix-command",
266
"eval",
···
301
302
algorithm = "sha256"
303
cmd = [
304
-
"nix-prefetch-git",
305
f"https://github.com/{owner}/{repo}.git",
306
"--hash",
307
algorithm,
···
317
hash = (
318
subprocess.check_output(
319
[
320
-
"nix-prefetch-url",
321
"--type",
322
"sha256",
323
"--unpack",
···
336
try:
337
hash = (
338
subprocess.check_output(
339
-
["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url],
340
stderr=subprocess.DEVNULL,
341
)
342
.decode("utf-8")
···
36
37
BULK_UPDATE = False
38
39
+
NIX = "nix"
40
+
NIX_PREFETCH_URL = "nix-prefetch-url"
41
+
NIX_PREFETCH_GIT = "nix-prefetch-git"
42
GIT = "git"
43
44
NIXPKGS_ROOT = (
45
+
subprocess.check_output([GIT, "rev-parse", "--show-toplevel"])
46
.decode("utf-8")
47
.strip()
48
)
···
82
try:
83
response = subprocess.check_output(
84
[
85
+
NIX,
86
"--extra-experimental-features",
87
"nix-command",
88
"eval",
···
167
return (
168
subprocess.check_output(
169
[
170
+
NIX,
171
"--extra-experimental-features",
172
"nix-command",
173
"hash",
···
263
try:
264
homepage = subprocess.check_output(
265
[
266
+
NIX,
267
"--extra-experimental-features",
268
"nix-command",
269
"eval",
···
304
305
algorithm = "sha256"
306
cmd = [
307
+
NIX_PREFETCH_GIT,
308
f"https://github.com/{owner}/{repo}.git",
309
"--hash",
310
algorithm,
···
320
hash = (
321
subprocess.check_output(
322
[
323
+
NIX_PREFETCH_URL,
324
"--type",
325
"sha256",
326
"--unpack",
···
339
try:
340
hash = (
341
subprocess.check_output(
342
+
[NIX_PREFETCH_URL, "--type", "sha256", "--unpack", tag_url],
343
stderr=subprocess.DEVNULL,
344
)
345
.decode("utf-8")