Skip to content

Commit

Permalink
fix: don't rely on file sort for fallback deps
Browse files Browse the repository at this point in the history
production dependencies are injected as fallback into the environment
but can be overridden by a simple pip install

this fix is designed to ensure that the last position in sys.path
does not depend on the file system ordering of any particular
implementation but instead injects itself last explicitly, cause
evaluation of python code inside .pth files happens lazily
  • Loading branch information
blaggacao committed Mar 25, 2024
1 parent e754029 commit afb35fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ in {
${lib.getExe python} -m venv "$PRJ_DATA_HOME/pyenv";
"$PRJ_DATA_HOME/pyenv/bin/python" -m pip install --quiet --upgrade pip
}
echo "${penv}/${sitePackagesPath}" > "$PRJ_DATA_HOME/pyenv/${sitePackagesPath}/zzz-shell-python-env.pth"
echo 'import sys; sys.path.append("${penv}/${sitePackagesPath}")' > "$PRJ_DATA_HOME/pyenv/${sitePackagesPath}/frappix-prod-deps-fallback.pth"
'';
deps = ["emplace-folders" "ensure-env-vars"];
};
Expand Down

0 comments on commit afb35fd

Please sign in to comment.