chore: python: pip: rename pythonAttr -> pythonVersion

This commit is contained in:
DavHau 2022-11-23 12:15:03 +01:00
parent bfa08c70d2
commit b9225c85b4
5 changed files with 13 additions and 10 deletions

View File

@ -31,9 +31,10 @@
subsystem = "python";
translator = "pip-freeze";
subsystemInfo.system = system;
subsystemInfo.pythonVersion = "3.10";
};
};
checks.package = config.dream2nix.outputs.rosbags.packages.default;
# checks.package = config.dream2nix.outputs.rosbags.packages.default;
};
};
}

View File

@ -17,8 +17,8 @@
settings = [
{
# optionally define python version
subsystemInfo.pythonAttr = "python38";
# # optionally define extra setup requirements;
subsystemInfo.pythonVersion = "3.8";
# optionally define extra setup requirements;
subsystemInfo.extraSetupDeps = ["cython > 0.29"];
}
];

View File

@ -178,7 +178,7 @@ in {
default = "3.10";
examples = [
"3.8"
"3.9.1"
"3.9"
"3.10"
];
type = "argument";

View File

@ -1,11 +1,11 @@
{
pythonAttr = {
pythonVersion = {
description = "python version to translate for";
default = "python3";
default = "3.10";
examples = [
"python27"
"python39"
"python310"
"3.8"
"3.9"
"3.10"
];
type = "argument";
};

View File

@ -13,6 +13,7 @@
(with pkgs; [
bash
coreutils
gnused
jq
nix
remarshal
@ -26,9 +27,10 @@
outputFile=$(realpath -m $(jq '.outputFile' -c -r $jsonInput))
source="$(jq '.source' -c -r $jsonInput)/$(jq '.project.relPath' -c -r $jsonInput)"
name="$(jq '.project.name' -c -r $jsonInput)"
pythonAttr=$(jq '.pythonAttr' -c -r $jsonInput)
pythonVersion=$(jq '.pythonVersion' -c -r $jsonInput)
extraSetupDeps=$(jq '[.extraSetupDeps[]] | join(" ")' -c -r $jsonInput)
pythonAttr="python$(echo "$pythonVersion" | sed 's/\.//')"
sitePackages=$(nix eval --impure --raw --expr "(import <nixpkgs> {}).$pythonAttr.sitePackages")
pushd $TMPDIR