Skip to content

Commit c5be96d

Browse files
authored
Remove compiled files in clean-setup and don't collect static files in init (#2397)
1 parent d1c0cb5 commit c5be96d

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

flake.nix

+11
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
inherit (self.packages.${system}) python3;
4343
inherit (inputs) pyproject-nix uv2nix pyproject-build-systems;
4444
inherit dependency-groups;
45+
our-packages = self.packages.${system};
4546
workspaceRoot = ./.;
4647
};
4748
evap-dev = evap.override (prev: { dependency-groups = (prev.dependency-groups or [ ]) ++ [ "dev" ]; });
@@ -109,6 +110,16 @@
109110
${python-build}/bin/python -m build
110111
'';
111112
};
113+
114+
clean-setup = pkgs.writeShellApplication {
115+
name = "clean-setup";
116+
runtimeInputs = with pkgs; [ git ];
117+
text = ''
118+
read -r -p "Delete node_modules/, data/, generated CSS and JS files in evap/static/, and evap/localsettings.py? [y/N] "
119+
[[ "$REPLY" =~ ^[Yy]$ ]] || exit 1
120+
git clean -f -X evap/static/ node_modules/ data/ evap/localsettings.py
121+
'';
122+
};
112123
});
113124
};
114125
}

nix/services.nix

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
cp deployment/localsettings.template.py evap/localsettings.py
6969
sed -i -e "s/\$SECRET_KEY/$(head /dev/urandom | LC_ALL=C tr -dc A-Za-z0-9 | head -c 32)/" evap/localsettings.py
7070
git submodule update --init
71-
./manage.py collectstatic --noinput
7271
./manage.py compilemessages --locale de
7372
./manage.py reload_testdata --noinput
7473
'';

nix/shell.nix

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, lib ? pkgs.lib, python3, pyproject-nix, uv2nix, pyproject-build-systems, workspaceRoot, extraPackages ? [ ], dependency-groups ? [ ], ... }:
1+
{ pkgs, lib ? pkgs.lib, python3, pyproject-nix, uv2nix, pyproject-build-systems, workspaceRoot, extraPackages ? [ ], dependency-groups ? [ ], our-packages, ... }:
22

33
let
44
# When running a nix shell, XDG_DATA_DIRS will be populated so that bash_completion can (lazily) find this completion script
@@ -7,13 +7,6 @@ let
77
install ${../deployment/manage_autocompletion.sh} "$out/share/bash-completion/completions/manage.py.bash"
88
'';
99

10-
clean-setup = pkgs.writeShellScriptBin "clean-setup" ''
11-
read -p "Delete node_modules/, data/ and evap/localsettings.py? [y/N] "
12-
[[ "$REPLY" =~ ^[Yy]$ ]] || exit 1
13-
set -ex
14-
rm -rf node_modules/ data/ evap/localsettings.py
15-
'';
16-
1710
workspace = uv2nix.lib.workspace.loadWorkspace { inherit workspaceRoot; };
1811
overlay = workspace.mkPyprojectOverlay { sourcePreference = "wheel"; };
1912
package-overrides = final: prev: {
@@ -35,7 +28,7 @@ pkgs.mkShell {
3528
git
3629

3730
venv
38-
clean-setup
31+
our-packages.clean-setup
3932
evap-managepy-completion
4033
] ++ extraPackages;
4134

0 commit comments

Comments
 (0)