treewide: use addBinToPathHook, minor cleanups (#379187)

This commit is contained in:
Pol Dellaiera
2025-02-04 09:57:05 +01:00
committed by GitHub
14 changed files with 138 additions and 132 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
lib,
python3Packages,
fetchFromGitHub,
addBinToPathHook,
installShellFiles,
nix-update-script,
}:
@@ -24,6 +25,7 @@ python3Packages.buildPythonApplication rec {
setuptools
]
++ [
addBinToPathHook
installShellFiles
];
@@ -46,7 +48,6 @@ python3Packages.buildPythonApplication rec {
];
postInstall = ''
export PATH=$out/bin:$PATH
installShellCompletion --cmd audible \
--bash <(source utils/code_completion/audible-complete-bash.sh) \
--fish <(source utils/code_completion/audible-complete-zsh-fish.sh) \
+2 -5
View File
@@ -2,6 +2,7 @@
lib,
python3Packages,
fetchPypi,
addBinToPathHook,
}:
python3Packages.buildPythonApplication rec {
@@ -32,15 +33,11 @@ python3Packages.buildPythonApplication rec {
];
nativeCheckInputs = with python3Packages; [
addBinToPathHook
pytestCheckHook
testtools
];
# Tests run eliot-tree in out/bin.
preCheck = ''
export PATH=$out/bin:$PATH
'';
pythonImportsCheck = [ "eliottree" ];
meta = {
+5 -5
View File
@@ -8,6 +8,7 @@
libdeflate,
bash,
coreutils,
addBinToPathHook,
}:
python3Packages.buildPythonApplication rec {
@@ -54,11 +55,10 @@ python3Packages.buildPythonApplication rec {
pythonImportsCheck = [ "flye" ];
nativeCheckInputs = [ python3Packages.pytestCheckHook ];
preCheck = ''
export PATH=$out/bin:$PATH
'';
nativeCheckInputs = [
addBinToPathHook
python3Packages.pytestCheckHook
];
meta = with lib; {
description = "De novo assembler for single molecule sequencing reads using repeat graphs";
+10 -8
View File
@@ -3,6 +3,7 @@
fetchFromGitHub,
python3,
cacert,
addBinToPathHook,
}:
python3.pkgs.buildPythonApplication rec {
@@ -43,17 +44,18 @@ python3.pkgs.buildPythonApplication rec {
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
pytest-asyncio
];
nativeCheckInputs =
with python3.pkgs;
[
pytestCheckHook
pytest-asyncio
]
++ [
addBinToPathHook
];
pythonImportsCheck = [ "gallia" ];
preCheck = ''
export PATH=$out/bin:$PATH
'';
meta = with lib; {
description = "Extendable Pentesting Framework for the Automotive Domain";
homepage = "https://github.com/Fraunhofer-AISEC/gallia";
+13 -13
View File
@@ -2,6 +2,8 @@
lib,
python3,
fetchFromGitHub,
addBinToPathHook,
writableTmpDirAsHomeHook,
}:
let
@@ -31,7 +33,7 @@ python.pkgs.buildPythonApplication rec {
src = fetchFromGitHub {
owner = "Scony";
repo = "godot-gdscript-toolkit";
rev = version;
tag = version;
hash = "sha256-cMGD5Xdf9ElS1NT7Q0NPB//EvUO0MI0VTtps5JRisZ4=";
};
@@ -46,18 +48,16 @@ python.pkgs.buildPythonApplication rec {
doCheck = true;
nativeCheckInputs = with python.pkgs; [
pytestCheckHook
hypothesis
];
preCheck = ''
# The tests want to run the installed executables
export PATH=$out/bin:$PATH
# gdtoolkit tries to write cache variables to $HOME/.cache
export HOME=$TMP
'';
nativeCheckInputs =
with python.pkgs;
[
pytestCheckHook
hypothesis
]
++ [
addBinToPathHook
writableTmpDirAsHomeHook
];
# The tests are not working on NixOS
disabledTests = [
+13 -13
View File
@@ -2,6 +2,8 @@
lib,
python3,
fetchFromGitHub,
addBinToPathHook,
writableTmpDirAsHomeHook,
}:
let
@@ -30,7 +32,7 @@ python.pkgs.buildPythonApplication rec {
src = fetchFromGitHub {
owner = "Scony";
repo = "godot-gdscript-toolkit";
rev = version;
tag = version;
hash = "sha256-XK6s/WnbTzjCAtV8dbRPLe5olpKUglPLQdttRRMvX70=";
};
@@ -45,18 +47,16 @@ python.pkgs.buildPythonApplication rec {
doCheck = true;
nativeCheckInputs = with python.pkgs; [
pytestCheckHook
hypothesis
];
preCheck = ''
# The tests want to run the installed executables
export PATH=$out/bin:$PATH
# gdtoolkit tries to write cache variables to $HOME/.cache
export HOME=$TMP
'';
nativeCheckInputs =
with python.pkgs;
[
pytestCheckHook
hypothesis
]
++ [
addBinToPathHook
writableTmpDirAsHomeHook
];
# The tests are not working on NixOS
disabledTestPaths = [
+11 -9
View File
@@ -5,6 +5,7 @@
cmake,
zlib,
enablePython ? true,
addBinToPathHook,
python3Packages,
testers,
}:
@@ -44,15 +45,16 @@ stdenv.mkDerivation (finalAttrs: {
doInstallCheck = enablePython;
nativeInstallCheckInputs = with python3Packages; [
# biopython
numpy
pytestCheckHook
];
preInstallCheck = ''
export PATH=$out/bin:$PATH
'';
nativeInstallCheckInputs =
with python3Packages;
[
# biopython
numpy
pytestCheckHook
]
++ [
addBinToPathHook
];
pytestFlagsArray = [ "../tests" ];
+15 -10
View File
@@ -5,6 +5,7 @@
procps,
stdenv,
versionCheckHook,
addBinToPathHook,
}:
python3Packages.buildPythonApplication rec {
@@ -77,19 +78,23 @@ python3Packages.buildPythonApplication rec {
preCheck = ''
chmod -R u+w ../test-data
ln -s ../test-data .
export PATH=$out/bin:$PATH
'';
# Some tests run subprocess.run() with "ps"
nativeCheckInputs = with python3Packages; [
procps
pytest-cov
pytest-xdist
pytestCheckHook
syrupy
pygithub
versionCheckHook
];
nativeCheckInputs =
with python3Packages;
[
procps
pytest-cov
pytest-xdist
pytestCheckHook
syrupy
pygithub
versionCheckHook
]
++ [
addBinToPathHook
];
versionCheckProgramArg = [ "--version" ];
+15 -16
View File
@@ -2,11 +2,10 @@
lib,
fetchFromGitHub,
python3Packages,
addBinToPathHook,
}:
with python3Packages;
buildPythonApplication rec {
python3Packages.buildPythonApplication rec {
pname = "parquet-tools";
version = "0.2.16";
@@ -27,7 +26,7 @@ buildPythonApplication rec {
postPatch = ''
substituteInPlace tests/test_inspect.py \
--replace "parquet-cpp-arrow version 5.0.0" "parquet-cpp-arrow version ${pyarrow.version}" \
--replace "parquet-cpp-arrow version 5.0.0" "parquet-cpp-arrow version ${python3Packages.pyarrow.version}" \
--replace "serialized_size: 2222" "serialized_size: 2221" \
--replace "format_version: 1.0" "format_version: 2.6"
'';
@@ -38,11 +37,11 @@ buildPythonApplication rec {
"thrift"
];
nativeBuildInputs = [
nativeBuildInputs = with python3Packages; [
poetry-core
];
propagatedBuildInputs = [
propagatedBuildInputs = with python3Packages; [
boto3
colorama
halo
@@ -52,16 +51,16 @@ buildPythonApplication rec {
thrift
];
# TestGetMetaData.test_inspect shells out to `parquet-tools` CLI entrypoint
preCheck = ''
export PATH=$out/bin:$PATH
'';
nativeCheckInputs = [
moto
pytest-mock
pytestCheckHook
];
nativeCheckInputs =
with python3Packages;
[
moto
pytest-mock
pytestCheckHook
]
++ [
addBinToPathHook
];
disabledTests = [
# test file is 2 bytes bigger than expected
+13 -11
View File
@@ -1,10 +1,11 @@
{
lib,
python3,
python3Packages,
fetchPypi,
addBinToPathHook,
}:
python3.pkgs.buildPythonApplication rec {
python3Packages.buildPythonApplication rec {
pname = "pifpaf";
version = "3.2.3";
format = "setuptools";
@@ -14,7 +15,7 @@ python3.pkgs.buildPythonApplication rec {
hash = "sha256-L039ZAFnYLCU52h1SczJU0T7+1gufxQlVzQr1EPCqc8=";
};
propagatedBuildInputs = with python3.pkgs; [
propagatedBuildInputs = with python3Packages; [
click
daiquiri
fixtures
@@ -24,14 +25,15 @@ python3.pkgs.buildPythonApplication rec {
xattr
];
preCheck = ''
export PATH=$out/bin:$PATH
'';
nativeCheckInputs = with python3.pkgs; [
requests
testtools
];
nativeCheckInputs =
with python3Packages;
[
requests
testtools
]
++ [
addBinToPathHook
];
pythonImportsCheck = [ "pifpaf" ];
+12 -8
View File
@@ -4,6 +4,8 @@
fetchFromGitHub,
espeak-ng,
tts,
addBinToPathHook,
writableTmpDirAsHomeHook,
}:
let
@@ -111,18 +113,20 @@ python.pkgs.buildPythonApplication rec {
doCheck = true;
});
nativeCheckInputs = with python.pkgs; [
espeak-ng
pytestCheckHook
];
nativeCheckInputs =
with python.pkgs;
[
espeak-ng
pytestCheckHook
]
++ [
addBinToPathHook
writableTmpDirAsHomeHook
];
preCheck = ''
# use the installed TTS in $PYTHONPATH instead of the one from source to also have cython modules.
mv TTS{,.old}
export PATH=$out/bin:$PATH
# numba tries to write to HOME directory
export HOME=$TMPDIR
for file in $(grep -rl 'python TTS/bin' tests); do
substituteInPlace "$file" \
+10 -8
View File
@@ -2,10 +2,12 @@
lib,
coreutils,
fetchFromGitHub,
git,
gitMinimal,
glibcLocales,
nix-update-script,
pythonPackages,
addBinToPathHook,
writableTmpDirAsHomeHook,
}:
let
@@ -19,7 +21,7 @@ let
src = fetchFromGitHub {
owner = "xonsh";
repo = "xonsh";
rev = "refs/tags/${argset.version}";
tag = argset.version;
hash = "sha256-20egNKlJjJO1wdy1anApz0ADBnaHPUSqhfrsPe3QQIs=";
};
@@ -39,8 +41,10 @@ let
nativeCheckInputs =
[
git
addBinToPathHook
gitMinimal
glibcLocales
writableTmpDirAsHomeHook
]
++ (with pythonPackages; [
pip
@@ -77,6 +81,9 @@ let
# https://github.com/xonsh/xonsh/issues/5569
"test_spec_decorator_alias_output_format"
# Broken test
"test_repath_backslash"
];
disabledTestPaths = [
@@ -103,11 +110,6 @@ let
patchShebangs .
'';
preCheck = ''
export HOME=$TMPDIR
export PATH=$out/bin:$PATH
'';
passthru = {
shellPath = "/bin/xonsh";
python = pythonPackages.python; # To the wrapper
+15 -12
View File
@@ -1,10 +1,12 @@
{
lib,
python3,
python3Packages,
fetchFromGitHub,
deterministic-uname,
addBinToPathHook,
}:
python3.pkgs.buildPythonApplication rec {
python3Packages.buildPythonApplication rec {
pname = "zxpy";
version = "1.6.4";
pyproject = true;
@@ -16,18 +18,19 @@ python3.pkgs.buildPythonApplication rec {
hash = "sha256-/VITHN517lPUmhLYgJHBYYvvlJdGg2Hhnwk47Mp9uc0=";
};
build-system = [
python3.pkgs.setuptools
build-system = with python3Packages; [
setuptools
];
nativeCheckInputs = [
deterministic-uname
python3.pkgs.pytestCheckHook
];
preCheck = ''
export PATH=$out/bin:$PATH
'';
nativeCheckInputs =
with python3Packages;
[
deterministic-uname
pytestCheckHook
]
++ [
addBinToPathHook
];
pythonImportsCheck = [ "zx" ];
@@ -15,6 +15,7 @@
zope-interface,
daemontools,
addBinToPathHook,
dask,
distributed,
hypothesis,
@@ -38,14 +39,6 @@ buildPythonPackage rec {
hash = "sha256-KqAXOMrRawzjpt5do2KdqpMMgpBtxeZ+X+th0WwBl+U=";
};
patches = [
(fetchpatch2 {
name = "numpy2-compat.patch";
url = "https://github.com/itamarst/eliot/commit/39eccdad44f91971ecf1211fb01366b4d9801817.patch";
hash = "sha256-al6olmvFZ8pDblljWmWqs5QrtcuHKcea255XgG+1+1o=";
})
];
build-system = [ setuptools ];
dependencies = [
@@ -56,6 +49,7 @@ buildPythonPackage rec {
];
nativeCheckInputs = [
addBinToPathHook
dask
distributed
hypothesis
@@ -69,11 +63,6 @@ buildPythonPackage rec {
pythonImportsCheck = [ "eliot" ];
# Tests run eliot-prettyprint in out/bin.
preCheck = ''
export PATH=$out/bin:$PATH
'';
disabledTests = [
# Fails since dask's bump to 2024.12.2
# Reported upstream: https://github.com/itamarst/eliot/issues/507