From 1f8bb94bcab905561b7e7e28fa9ff833ef77652c Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 28 Oct 2024 21:19:51 +0800 Subject: [PATCH 01/14] pythonOutputDistHook: append *Phases with appendToVar --- .../interpreters/python/hooks/python-output-dist-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh b/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh index 83b79d01fa404..8e4a15dc277fb 100644 --- a/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh @@ -21,4 +21,4 @@ EOF echo "Finished executing pythonOutputDistPhase" } -preFixupPhases+=" pythonOutputDistPhase" +appendToVar preFixupPhases pythonOutputDistPhase From c4bc1a8bb6038a26ac3d18a84841428bdedbd711 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 11 Sep 2024 04:23:36 +0800 Subject: [PATCH 02/14] pipBuildHook: handle pipBuildFlags `__structuredAttrs`-agnostically --- .../python/hooks/pip-build-hook.sh | 25 +++++++++++-------- .../meson-python/add-build-flags.sh | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/pip-build-hook.sh b/pkgs/development/interpreters/python/hooks/pip-build-hook.sh index 3d70de729f2df..430951bac7c95 100644 --- a/pkgs/development/interpreters/python/hooks/pip-build-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pip-build-hook.sh @@ -1,22 +1,27 @@ # Setup hook to use for pip projects -echo "Sourcing pip-build-hook" +# shellcheck shell=bash -declare -a pipBuildFlags +echo "Sourcing pip-build-hook" pipBuildPhase() { echo "Executing pipBuildPhase" runHook preBuild mkdir -p dist + + local -a flagsArray=( + --verbose + --no-index + --no-deps + --no-clean + --no-build-isolation + --wheel-dir dist + ) + concatTo flagsArray pipBuildFlags + echo "Creating a wheel..." - @pythonInterpreter@ -m pip wheel \ - --verbose \ - --no-index \ - --no-deps \ - --no-clean \ - --no-build-isolation \ - --wheel-dir dist \ - $pipBuildFlags . + echoCmd 'pip build flags' "${flagsArray[@]}" + @pythonInterpreter@ -m pip wheel "${flagsArray[@]}" . echo "Finished creating a wheel..." runHook postBuild diff --git a/pkgs/development/python-modules/meson-python/add-build-flags.sh b/pkgs/development/python-modules/meson-python/add-build-flags.sh index d9327960eb1df..d781b1f966f6a 100644 --- a/pkgs/development/python-modules/meson-python/add-build-flags.sh +++ b/pkgs/development/python-modules/meson-python/add-build-flags.sh @@ -3,7 +3,7 @@ mesonPythonBuildFlagsHook() { for f in $mesonFlags; do pypaBuildFlags+=" -Csetup-args=$f" # This requires pip>23.0.1, see: https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html - pipBuildFlags+=" --config-settings=setup-args=$f" + appendToVar pipBuildFlags "--config-settings=setup-args=$f" done } From 3a0f6fabff15e2e59847bfc6c9563cc37b21de0c Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 11 Sep 2024 04:46:25 +0800 Subject: [PATCH 03/14] pipInstallHook: handle pipInstallFlags `__structuredAttrs`-agnostically --- .../python/hooks/pip-install-hook.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/pip-install-hook.sh b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh index a4f08b8b14cbd..0f718a6c4bb89 100644 --- a/pkgs/development/interpreters/python/hooks/pip-install-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh @@ -1,17 +1,27 @@ # Setup hook for pip. -echo "Sourcing pip-install-hook" +# shellcheck shell=bash -declare -a pipInstallFlags +echo "Sourcing pip-install-hook" pipInstallPhase() { echo "Executing pipInstallPhase" runHook preInstall + # shellcheck disable=SC2154 mkdir -p "$out/@pythonSitePackages@" export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" + local -a flagsArray=( + --no-index + --no-warn-script-location + --prefix="$out" + --no-cache + ) + concatTo flagsArray pipInstallFlags + pushd dist || return 1 - @pythonInterpreter@ -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache $pipInstallFlags + echoCmd 'pip install flags' "${flagsArray[@]}" + @pythonInterpreter@ -m pip install ./*.whl "${flagsArray[@]}" popd || return 1 runHook postInstall From 1f39bb6586ec2e89076f8f8f562bfd388e749903 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 11 Sep 2024 05:01:37 +0800 Subject: [PATCH 04/14] pypaBuildHook: handle pypaBuildFlags `__structuredAttrs`-agnostically --- .../interpreters/python/hooks/pypa-build-hook.sh | 10 +++++++++- .../python-modules/meson-python/add-build-flags.sh | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh b/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh index dd49d935bcee7..d1a1b10bf5206 100644 --- a/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh @@ -5,8 +5,16 @@ pypaBuildPhase() { echo "Executing pypaBuildPhase" runHook preBuild + local -a flagsArray=( + --no-isolation + --outdir dist/ + --wheel + ) + concatTo flagsArray pypaBuildFlags + echo "Creating a wheel..." - @build@/bin/pyproject-build --no-isolation --outdir dist/ --wheel $pypaBuildFlags + echoCmd 'pypa build flags' "${flagsArray[@]}" + @build@/bin/pyproject-build "${flagsArray[@]}" echo "Finished creating a wheel..." runHook postBuild diff --git a/pkgs/development/python-modules/meson-python/add-build-flags.sh b/pkgs/development/python-modules/meson-python/add-build-flags.sh index d781b1f966f6a..e1b2588f07fc4 100644 --- a/pkgs/development/python-modules/meson-python/add-build-flags.sh +++ b/pkgs/development/python-modules/meson-python/add-build-flags.sh @@ -1,7 +1,7 @@ mesonPythonBuildFlagsHook() { # Add all of mesonFlags to -Csetup-args for pypa builds for f in $mesonFlags; do - pypaBuildFlags+=" -Csetup-args=$f" + appendToVar pypaBuildFlags "-Csetup-args=$f" # This requires pip>23.0.1, see: https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html appendToVar pipBuildFlags "--config-settings=setup-args=$f" done From 69f4871514c06e92dc4ead9491e4581efa9898f9 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 11 Sep 2024 04:54:28 +0800 Subject: [PATCH 05/14] pypaBuildHook: lint with ShellCheck --- pkgs/development/interpreters/python/hooks/pypa-build-hook.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh b/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh index d1a1b10bf5206..88472b4686881 100644 --- a/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh @@ -1,4 +1,6 @@ # Setup hook to use for pypa/build projects +# shellcheck shell=bash + echo "Sourcing pypa-build-hook" pypaBuildPhase() { From 967e5b43ed61d2a2bf7b2d194aa2e51c2cfc1904 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Tue, 10 Sep 2024 23:08:01 +0800 Subject: [PATCH 06/14] pythonImportsCheckHook: support __structuredAttrs = true --- .../python/hooks/python-imports-check-hook.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh index 591060aca6d06..2788a947fe953 100644 --- a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh @@ -4,15 +4,16 @@ echo "Sourcing python-imports-check-hook.sh" pythonImportsCheckPhase() { echo "Executing pythonImportsCheckPhase" - if [ -n "$pythonImportsCheck" ]; then - echo "Check whether the following modules can be imported: $pythonImportsCheck" - pythonImportsCheckOutput=$out - if [ -n "$python" ]; then + if [ -n "${pythonImportsCheck[*]-}" ]; then + echo "Check whether the following modules can be imported: ${pythonImportsCheck[*]}" + # shellcheck disable=SC2154 + pythonImportsCheckOutput="$out" + if [ -n "${python-}" ]; then echo "Using python specific output \$python for imports check" pythonImportsCheckOutput=$python fi export PYTHONPATH="$pythonImportsCheckOutput/@pythonSitePackages@:$PYTHONPATH" - (cd $pythonImportsCheckOutput && @pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ["pythonImportsCheck"].split()))') + (cd "$pythonImportsCheckOutput" && @pythonCheckInterpreter@ -c 'import sys; import importlib; list(map(lambda mod: importlib.import_module(mod), sys.argv[1:]))' ${pythonImportsCheck[*]}) fi } From bab7ef307cb11e2d2dc9b9ddf2d1de68f220ed45 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Tue, 10 Sep 2024 17:22:09 +0800 Subject: [PATCH 07/14] pythonImportsCheckHook: lint with ShellCheck --- .../python/hooks/python-imports-check-hook.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh index 2788a947fe953..c3c758d6a9027 100644 --- a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh @@ -1,23 +1,28 @@ +# shellcheck shell=bash + # Setup hook for checking whether Python imports succeed echo "Sourcing python-imports-check-hook.sh" pythonImportsCheckPhase() { echo "Executing pythonImportsCheckPhase" - if [ -n "${pythonImportsCheck[*]-}" ]; then + if [[ -n "${pythonImportsCheck[*]-}" ]]; then echo "Check whether the following modules can be imported: ${pythonImportsCheck[*]}" # shellcheck disable=SC2154 pythonImportsCheckOutput="$out" - if [ -n "${python-}" ]; then + if [[ -n "${python-}" ]]; then echo "Using python specific output \$python for imports check" pythonImportsCheckOutput=$python fi export PYTHONPATH="$pythonImportsCheckOutput/@pythonSitePackages@:$PYTHONPATH" + # Python modules and namespaces names are Python identifiers, which must not contain spaces. + # See https://docs.python.org/3/reference/lexical_analysis.html + # shellcheck disable=SC2048,SC2086 (cd "$pythonImportsCheckOutput" && @pythonCheckInterpreter@ -c 'import sys; import importlib; list(map(lambda mod: importlib.import_module(mod), sys.argv[1:]))' ${pythonImportsCheck[*]}) fi } -if [ -z "${dontUsePythonImportsCheck-}" ]; then +if [[ -z "${dontUsePythonImportsCheck-}" ]]; then echo "Using pythonImportsCheckPhase" appendToVar preDistPhases pythonImportsCheckPhase fi From ccb418b69938ebdac9337baa9cdceeb43b3497cd Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 7 Oct 2024 07:42:31 +0800 Subject: [PATCH 08/14] pythonNamespacesHook: lint with ShellCheck --- .../python/hooks/python-namespaces-hook.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh b/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh index 5c5b840e05c37..add56f5b64136 100644 --- a/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh @@ -1,20 +1,26 @@ # Clean up __init__.py's found in namespace directories +# shellcheck shell=bash + echo "Sourcing python-namespaces-hook" pythonNamespacesHook() { echo "Executing pythonNamespacesHook" - for namespace in ${pythonNamespaces[@]}; do + # Python namespaces names are Python identifiers, which must not contain spaces. + # See https://docs.python.org/3/reference/lexical_analysis.html + # shellcheck disable=SC2048 + for namespace in ${pythonNamespaces[*]-}; do echo "Enforcing PEP420 namespace: ${namespace}" # split namespace into segments. "azure.mgmt" -> "azure mgmt" - IFS='.' read -ra pathSegments <<<$namespace + IFS='.' read -ra pathSegments <<<"$namespace" + # shellcheck disable=SC2154 constructedPath=$out/@pythonSitePackages@ # Need to remove the __init__.py at each namespace level # E.g `azure/__init__.py` and `azure/mgmt/__init__.py` # The __pycache__ entry also needs to be removed - for pathSegment in ${pathSegments[@]}; do + for pathSegment in "${pathSegments[@]}"; do constructedPath=${constructedPath}/${pathSegment} pathToRemove=${constructedPath}/__init__.py pycachePath=${constructedPath}/__pycache__/ @@ -30,9 +36,9 @@ pythonNamespacesHook() { # event of a "meta-package" package, which will just install # other packages, but not produce anything in site-packages # besides meta information - if [ -d "${constructedPath}/../" -a -z ${dontRemovePth-} ]; then + if [[ -d "${constructedPath}/../" ]] && [[ -z "${dontRemovePth-}" ]]; then # .pth files are located in the parent directory of a module - @findutils@/bin/find ${constructedPath}/../ -name '*-nspkg.pth' -exec rm -v "{}" + + @findutils@/bin/find "${constructedPath}/../" -name '*-nspkg.pth' -exec rm -v "{}" + fi # remove __pycache__/ entry, can be interpreter specific. E.g. __init__.cpython-38.pyc @@ -46,6 +52,6 @@ pythonNamespacesHook() { echo "Finished executing pythonNamespacesHook" } -if [ -z "${dontUsePythonNamespacesHook-}" -a -n "${pythonNamespaces-}" ]; then +if [[ -z "${dontUsePythonNamespacesHook-}" ]] && [[ -n "${pythonNamespaces-}" ]]; then postFixupHooks+=(pythonNamespacesHook) fi From e4f2f9dd22db433d54c9c3e25fc6cee6c3471d09 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 7 Oct 2024 07:46:08 +0800 Subject: [PATCH 09/14] pythonOutputDistHook: lint with ShellCheck --- .../interpreters/python/hooks/python-output-dist-hook.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh b/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh index 8e4a15dc277fb..be54b546cadb8 100644 --- a/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh @@ -1,9 +1,12 @@ # Setup hook for storing dist folder (wheels/sdists) in a separate output +# shellcheck shell=bash + echo "Sourcing python-catch-conflicts-hook.sh" pythonOutputDistPhase() { echo "Executing pythonOutputDistPhase" if [[ -d dist ]]; then + # shellcheck disable=SC2154 mv "dist" "$dist" else cat >&2 < Date: Mon, 7 Oct 2024 07:58:17 +0800 Subject: [PATCH 10/14] pythonRelaxDepsHook: handle attributes `__structuredAttrs`-agnostically Make the interation across pythonRelaxDeps and pythonRemoveDeps work regardless of __structuredAttrs. --- .../interpreters/python/hooks/python-relax-deps-hook.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh index 7da5c0b0ac272..cccb493134691 100644 --- a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh @@ -42,13 +42,13 @@ _pythonRelaxDeps() { local -r metadata_file="$1" - if [[ -z "${pythonRelaxDeps:-}" ]] || [[ "$pythonRelaxDeps" == 0 ]]; then + if [[ -z "${pythonRelaxDeps[*]-}" ]] || [[ "$pythonRelaxDeps" == 0 ]]; then return elif [[ "$pythonRelaxDeps" == 1 ]]; then sed -i "$metadata_file" -r \ -e 's/(Requires-Dist: [a-zA-Z0-9_.-]+\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/' else - for dep in $pythonRelaxDeps; do + for dep in ${pythonRelaxDeps[*]}; do sed -i "$metadata_file" -r \ -e "s/(Requires-Dist: $dep\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/i" done @@ -58,13 +58,13 @@ _pythonRelaxDeps() { _pythonRemoveDeps() { local -r metadata_file="$1" - if [[ -z "${pythonRemoveDeps:-}" ]] || [[ "$pythonRemoveDeps" == 0 ]]; then + if [[ -z "${pythonRemoveDeps[*]-}" ]] || [[ "$pythonRemoveDeps" == 0 ]]; then return elif [[ "$pythonRemoveDeps" == 1 ]]; then sed -i "$metadata_file" \ -e '/Requires-Dist:.*/d' else - for dep in $pythonRemoveDeps; do + for dep in ${pythonRemoveDeps[*]-}; do sed -i "$metadata_file" \ -e "/Requires-Dist: $dep/d" done From 29c08adae171f1c273a0a15c00068205a9965bf2 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 7 Oct 2024 08:07:09 +0800 Subject: [PATCH 11/14] pythonRelaxDepsHook: lint with ShellCheck Ignore SC2164 at this moment, as it will be gone when adding `set -e`. --- .../interpreters/python/hooks/python-relax-deps-hook.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh index cccb493134691..9b5bd6f37ca98 100644 --- a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh @@ -48,6 +48,7 @@ _pythonRelaxDeps() { sed -i "$metadata_file" -r \ -e 's/(Requires-Dist: [a-zA-Z0-9_.-]+\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/' else + # shellcheck disable=SC2048 for dep in ${pythonRelaxDeps[*]}; do sed -i "$metadata_file" -r \ -e "s/(Requires-Dist: $dep\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/i" @@ -64,6 +65,7 @@ _pythonRemoveDeps() { sed -i "$metadata_file" \ -e '/Requires-Dist:.*/d' else + # shellcheck disable=SC2048 for dep in ${pythonRemoveDeps[*]-}; do sed -i "$metadata_file" \ -e "/Requires-Dist: $dep/d" @@ -86,11 +88,14 @@ pythonRelaxDepsHook() { rm -rf "$wheel" # Using no quotes on purpose since we need to expand the glob from `$metadata_file` + # shellcheck disable=SC2086 _pythonRelaxDeps $metadata_file + # shellcheck disable=SC2086 _pythonRemoveDeps $metadata_file if (("${NIX_DEBUG:-0}" >= 1)); then echo "pythonRelaxDepsHook: resulting METADATA for '$wheel':" + # shellcheck disable=SC2086 cat $metadata_file fi From 65293f424779e4df5d892e955dd03cf8d0ed84b0 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 7 Oct 2024 08:15:32 +0800 Subject: [PATCH 12/14] pythonRemoveTestDirHook: lint with ShellCheck --- .../python/hooks/python-remove-tests-dir-hook.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/python-remove-tests-dir-hook.sh b/pkgs/development/interpreters/python/hooks/python-remove-tests-dir-hook.sh index ad9e3c07cf244..43c991b74469f 100644 --- a/pkgs/development/interpreters/python/hooks/python-remove-tests-dir-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-remove-tests-dir-hook.sh @@ -1,11 +1,14 @@ # Clean up top-level tests directory in site-package installation. +# shellcheck shell=bash + echo "Sourcing python-remove-tests-dir-hook" pythonRemoveTestsDir() { echo "Executing pythonRemoveTestsDir" - rm -rf $out/@pythonSitePackages@/tests - rm -rf $out/@pythonSitePackages@/test + # shellcheck disable=SC2154 + rm -rf "$out/@pythonSitePackages@/tests" + rm -rf "$out/@pythonSitePackages@/test" echo "Finished executing pythonRemoveTestsDir" } From e32457af0c9de65a4d3f57afd8b4c238da65d07a Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 28 Oct 2024 03:54:02 +0800 Subject: [PATCH 13/14] setuptoolsRustHook: lint with ShellCheck --- .../interpreters/python/hooks/setuptools-rust-hook.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh b/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh index 917c19ef9b31b..5a0916f8acc41 100644 --- a/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh +++ b/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + echo "Sourcing setuptools-rust-hook" setuptoolsRustSetup() { From 6597b74fea10a79f09ef3fbcf02620e238992845 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Tue, 29 Oct 2024 15:02:27 +0800 Subject: [PATCH 14/14] pypaBuildHook.tests: modernize --- .../interpreters/python/hooks/pypa-build-hook-test.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix b/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix index 4153c21ca4f97..f862429d3987b 100644 --- a/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix +++ b/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix @@ -10,9 +10,9 @@ ''; # the source of the example project projectSource = runCommand "my-project-source" {} '' - mkdir -p $out/src + mkdir -p $out/src/my_project cp ${pyprojectToml} $out/pyproject.toml - touch $out/src/__init__.py + touch $out/src/my_project/__init__.py ''; in # this build must never triger conflicts @@ -20,11 +20,13 @@ pname = "dont-propagate-conflicting-deps"; version = "0.0.0"; src = projectSource; - format = "pyproject"; - propagatedBuildInputs = [ + pyproject = true; + dependencies = [ # At least one dependency of `build` should be included here to # keep the test meaningful (mkConflict pythonOnBuildForHost.pkgs.tomli) + ]; + build-system = [ # setuptools is also needed to build the example project pythonOnBuildForHost.pkgs.setuptools ];