From 243050110dd2e0c2ee6f8082fe6f1959b5185adb Mon Sep 17 00:00:00 2001 From: Julian Gomez Date: Wed, 27 Sep 2023 17:46:22 -0500 Subject: [PATCH] refac(back): #1172 ignore win-arm64 wheels - add exclusion for win_arm64 wheels inside makePythonLock - exclude packages without links from the sources.yaml - add mail to mailmap - fix format errors Signed-off-by: Julian Gomez --- .mailmap | 2 ++ makes/utils/makePythonLock/entrypoint.sh | 10 ++++++++++ src/args/make-python-vscode-settings/default.nix | 3 +-- src/args/python-override-utils/default.nix | 3 ++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.mailmap b/.mailmap index 79a84eb9..a5aa570b 100644 --- a/.mailmap +++ b/.mailmap @@ -20,6 +20,8 @@ Github Octocat GitHub GuangTao Zhang GTrunSec John Perez John Perez <34050007+jpverde@users.noreply.github.com> John Perez John Perez +Julian Gomez Julian Gomez +Julian Gomez Benitez <60365681+jgomezb11@users.noreply.github.com> Julian Gomez Benitez <60365681+jgomezb11@users.noreply.github.com> Kevin Amado Kevin Amado Luis Saavedra Luis David Saavedra <40694133+ludsrill@users.noreply.github.com> Luis Saavedra Luis Saavedra diff --git a/makes/utils/makePythonLock/entrypoint.sh b/makes/utils/makePythonLock/entrypoint.sh index ea6de819..f6aa2fe5 100644 --- a/makes/utils/makePythonLock/entrypoint.sh +++ b/makes/utils/makePythonLock/entrypoint.sh @@ -1,6 +1,7 @@ # shellcheck shell=bash function main { + declare -A depWithLinks local python_version="${1}" local deps_yaml="${2}" local sources_yaml="${3:-sources.yaml}" @@ -71,6 +72,7 @@ function main { *.exe) continue ;; *-win32.whl) continue ;; *-win_amd64.whl) continue ;; + *-win_arm64.whl) continue ;; *) ;; esac \ && if ! in_array "${python_versions[${index}]}" "${implementations[@]}"; then @@ -93,9 +95,17 @@ function main { sources.json \ > sources2.json \ && mv sources2.json sources.json \ + && IFS='/' read -ra ADDR <<< "$endpoint" \ + && depWithLinks["${ADDR[-3]}"]="" \ || critical Unable to download "${file}" done done \ + && jq -erS \ + --argjson depsWithLinks "$(echo "${!depWithLinks[@]}" | jq -Rc \ + 'split(" ") | map({(.): .}) | add')" \ + '.closure |= with_entries(select(.key as $k | $depsWithLinks | has($k)))' \ + sources.json > sources_filtered.json \ + && mv sources_filtered.json sources.json \ && yj -jy < sources.json > "${sources_yaml}" \ && info Generated a sources file at "${sources_yaml}" } diff --git a/src/args/make-python-vscode-settings/default.nix b/src/args/make-python-vscode-settings/default.nix index 7832e7db..f8c39df1 100644 --- a/src/args/make-python-vscode-settings/default.nix +++ b/src/args/make-python-vscode-settings/default.nix @@ -2,8 +2,7 @@ __nixpkgs__, makeTemplate, ... -}: -{ +}: { name, env, bins, diff --git a/src/args/python-override-utils/default.nix b/src/args/python-override-utils/default.nix index 64cd4098..79944310 100644 --- a/src/args/python-override-utils/default.nix +++ b/src/args/python-override-utils/default.nix @@ -48,7 +48,8 @@ let compose = let # definition from nixpkgs.lib.reverseList reverseList = xs: let l = builtins.length xs; in builtins.genList (n: builtins.elemAt xs (l - n - 1)) l; - in functions: val: builtins.foldl' (x: f: f x) val (reverseList functions); + in + functions: val: builtins.foldl' (x: f: f x) val (reverseList functions); in { inherit compose recursive_python_pkg_override no_check_override replace_pkg; }