Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-webui: Use makeWrapperArgs; Use env to disable hatch custom hook #319498

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions pkgs/by-name/op/open-webui/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ python3.pkgs.buildPythonApplication rec {
inherit pname version src;
pyproject = true;

# The custom hook tries to run `npm install` in `buildPhase`.
# We don't have to worry, as node dependencies are managed by `frontend` drv.
# Not force-including the frontend build directory as frontend is managed by the `frontend` derivation above.
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail '[tool.hatch.build.hooks.custom]' "" \
--replace-fail ', build = "open_webui/frontend"' ""
'';

env.HATCH_BUILD_NO_HOOKS = true;

pythonRelaxDeps = true;

pythonRemoveDeps = [
Expand Down Expand Up @@ -115,17 +115,13 @@ python3.pkgs.buildPythonApplication rec {
youtube-transcript-api
];

build-system = with python3.pkgs; [
hatchling
pythonRelaxDepsHook
];
build-system = with python3.pkgs; [ hatchling ];

nativeBuildInputs = [ python3.pkgs.pythonRelaxDepsHook ];

pythonImportsCheck = [ "open_webui" ];

postInstall = ''
wrapProgram $out/bin/open-webui \
--set FRONTEND_BUILD_DIR "${frontend}/share/open-webui"
'';
makeWrapperArgs = [ "--set FRONTEND_BUILD_DIR ${frontend}/share/open-webui" ];

passthru.tests = {
inherit (nixosTests) open-webui;
Expand Down