2022-07-08 05:51:22 +00:00
|
|
|
{ lib
|
|
|
|
, vscode-utils
|
|
|
|
, icu
|
|
|
|
, python3
|
|
|
|
# When `true`, the python default setting will be fixed to specified.
|
|
|
|
# Use version from `PATH` for default setting otherwise.
|
|
|
|
# Defaults to `false` as we expect it to be project specific most of the time.
|
|
|
|
, pythonUseFixed ? false
|
2017-10-19 01:32:15 +00:00
|
|
|
}:
|
|
|
|
|
2022-07-08 05:51:22 +00:00
|
|
|
vscode-utils.buildVscodeMarketplaceExtension {
|
2017-10-19 01:32:15 +00:00
|
|
|
mktplcRef = {
|
|
|
|
name = "python";
|
|
|
|
publisher = "ms-python";
|
2022-07-08 05:51:22 +00:00
|
|
|
version = "2022.11.11881005";
|
|
|
|
sha256 = "sha256-8NH/aWIAwSpVRi3cvBCpvO8MVzIoRaXxADmWp6DuUb8=";
|
2017-10-19 01:32:15 +00:00
|
|
|
};
|
|
|
|
|
2022-07-08 05:51:22 +00:00
|
|
|
buildInputs = [ icu ];
|
2019-02-04 01:02:18 +00:00
|
|
|
|
2022-07-08 05:51:22 +00:00
|
|
|
nativeBuildInputs = [ python3.pkgs.wrapPython ];
|
2020-03-23 01:53:39 +00:00
|
|
|
|
2022-07-08 05:51:22 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
debugpy
|
|
|
|
isort
|
|
|
|
jedi-language-server
|
2019-02-04 01:02:18 +00:00
|
|
|
];
|
|
|
|
|
2017-10-19 01:32:15 +00:00
|
|
|
postPatch = ''
|
2022-07-08 05:51:22 +00:00
|
|
|
# remove bundled python deps and use libs from nixpkgs
|
|
|
|
rm -r pythonFiles/lib
|
|
|
|
mkdir -p pythonFiles/lib/python/
|
|
|
|
ln -s ${python3.pkgs.debugpy}/lib/*/site-packages/debugpy pythonFiles/lib/python/
|
|
|
|
buildPythonPath "$propagatedBuildInputs"
|
|
|
|
for i in pythonFiles/*.py; do
|
|
|
|
patchPythonScript "$i"
|
|
|
|
done
|
|
|
|
'' + lib.optionalString pythonUseFixed ''
|
2017-10-19 01:32:15 +00:00
|
|
|
# Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`.
|
|
|
|
substituteInPlace "./package.json" \
|
2022-07-08 05:51:22 +00:00
|
|
|
--replace "\"default\": \"python\"" "\"default\": \"${python3.interpreter}\""
|
2019-02-04 01:02:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
license = licenses.mit;
|
2022-01-12 18:33:06 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
2022-01-20 01:02:12 +00:00
|
|
|
maintainers = with maintainers; [ jraygauthier jfchevrette ];
|
2019-02-04 01:02:18 +00:00
|
|
|
};
|
2018-04-19 15:41:12 +00:00
|
|
|
}
|