Skip to content

Commit

Permalink
Enable Python optimizations when in production
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaczero committed Feb 19, 2024
1 parent 8f818a1 commit 1460fd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

- name: Install dependencies
run: |
nix-shell --pure --run true
nix-shell --pure --arg isDevelopment false --run true
- name: Export Nix store cache
if: steps.nix-cache.outputs.cache-hit != 'true'
Expand Down
5 changes: 4 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ let
# Wrap Python to override LD_LIBRARY_PATH
wrappedPython = with pkgs; (symlinkJoin {
name = "python";
paths = [ python312 ];
paths = [
# Enable Python optimizations when in production
(if isDevelopment then python312 else python312.override { enableOptimizations = true; })
];
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram "$out/bin/python3.12" --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libraries'}"
Expand Down

0 comments on commit 1460fd5

Please sign in to comment.