Build the backend with uv2nix from the upstream uv.lock #12
Labels
No labels
automerge
bug
dependencies
duplicate
help wanted
invalid
lang
rust
migrations
opencode
question
security
type
documentation
type
enhancement
type
maintenance
type
refactor
vulnerability
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Personal/kitchenowl-flake#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace the hand-maintained Python dependency pins in
pkgs/backend/default.nixwith a virtualenvironment generated by uv2nix from upstream's committed
backend/uv.lock. This should remove mostof the packaging code and keep the packaged application's behaviour unchanged.
Context
pkgs/backend/default.nixis 232 lines; roughly lines 12–161 hand-build nine packages with sourcehashes:
extruct0.17.0,flask-basicauth0.2.0,flask-apscheduler1.13.1,sqlite-icu1.0,mlextend0.23.1,dbscan1d0.2.4,uwsgi(git commit6cbb2177),uwsgi-tools1.1.1 andsqlalchemy2.1.8, plus patches forsqlalchemy(test exclusions, Cython sed) andingredient-parser-nlp(disable NLTK download on import).backend/pyproject.toml(PEP 621,requires-python = ">=3.14") andbackend/uv.lock(673 KB), and builds its Docker image withuv sync --no-devfrom that lock. TheNix package is the only consumer not reading the authoritative resolution.
poetry.lockthat does notexist; pip2nix, pynixify and pypi2nix are abandoned and have no lockfile; python2nix is discontinued.
uv2nix with
pyproject.nixandpyproject-build-systemsmatches the existing lock input and ismaintained.
pythonPath,python3Packages.python,python3Packages.gunicornandnltkDatafrom the backend derivation, so this changesservices/default.nixas well as the package.Proposed approach
pyproject-nix,uv2nixandpyproject-build-systems(all followingnixpkgs).${src}/backend, build withsourcePreference = "wheel"pluspyproject-build-systems.overlays.wheel, and select the interpreter from the lock'srequires-python(pkgs.python314).mkVirtualEnvand keep the existing application source copy at$out/opt/kitchenowland thenltkDatapassthru.uv.lockcannot express:sqlite-icu(pkg-config, icu, sqlite),uwsgi(libxcrypt plus a
setuptools-scmbuild system) and theingredient-parser-nlppatch.virtualenv, or align the module with upstream's uwsgi entrypoint.
Risks to validate
PYTHONPATHwiring for migrations, the default-itemupgrade and gunicorn;
tests.nixcovers postgres, sqlite, open registration and NLTK nodes.[build-system]; confirm uv2nix can build it or exclude it from thedependency spec.
than today's mostly-substituted set.
sqlalchemy2.1.8,uwsgigit commit); verifyapplication behaviour and tests with the locked versions.
litellm's dependency tree are patched automatically, but may still need extrasystem libraries.
Scope
pkgs/backend/default.nix,services/default.nixexecution wiring,flake.nixinputs, and thebuild documentation in
AGENTS.mdwhere commands or caveats change.Acceptance criteria
pkgs/backend/default.nixno longer pins package versions or hashes; runtime dependencies comefrom upstream's
backend/uv.lock.nix build .#kitchenowl-backendsucceeds and the environment contains the lock's defaultdependency set without the
devgroup.environment without relying on
PYTHONPATH.nix flake checkpasses, including all four VM test nodes and the formatting check.just update-versionneeds no backend-specific edits, andAGENTS.mddocuments the newworkflow and any remaining overrides.
sqlalchemy,extruct,dbscan1d,mlxtend, ...) aregone, and any that remain are explained.
Dependencies
Personal; this issue transfers with it andcan be labelled there (
type/refactorproposed) once the organization labels are inherited.