Repository navigation
Nix in sbi #2046
Replies: 3 comments 2 replies
|
This looks like a useful addition to the project, especially from a reproducibility and development-environment perspective. |
|
@Filippo-Galli thanks for asking before writing any code, and for the detailed proposal. For now, we would prefer not to add further packaging setups to the sbi repository, to keep the maintenance work manageable. The nixpkgs route you mention at the end fits us much better. The package would live, build and get cached in nixpkgs, the same way our conda-forge recipe serves conda users. sbi is not in nixpkgs yet, and neither are zuko and nflows, so those two would need packages too. torch, pyro-ppl and skorch are already there. If you package sbi in nixpkgs and maintain it there, we are happy to link it from our installation guide next to conda and pixi. A small PR that adds a "Using Nix" section is welcome once the package is available. Thanks again for offering this, Jan |
|
Hi everyone, a quick update: I spoke with a Nixpkgs reviewer, who explained that some of For anyone interested in using Feedback are welcome! |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Proposal to add optional Nix (a functional package manager for reproducible environments) support to
sbifor reproducible development environments and Nix-based packaging, without changing existing infrastructure.Motivation / Benefits
From my perspective, the main advantages would be:
Reproducible development environment via
shell.nix/flake.nixuvorvenv, but with stronger guarantees about system-level dependencies and compiler toolchains.Nix-based build system that can be used to create other packages or artifacts starting from
sbiuvorpyproject.toml, but expressed in Nix.sbiPython package itself as a Nix derivation.flake.nix, you could build a Nix derivation or other artifact formats (such as container images) that are useful for HPC or cluster deployment.This would not change the current development or build infrastructure; it would simply provide an additional, optional way to develop and build
sbi.Proposed minimal setup
I'm not a Nix expert, but based on current best practices, the initial contribution could consist of three files:
flake.nix– main entry pointpackages.default: thesbipackage as a Nix derivation.devShells.default: a development shell with all required tools.checksto run tests in a reproducible way.default.nix– build recipe for thesbipackage as a Nix derivationsbifrompyproject.toml(potentially using tools likepyproject.nixor similar).nixpkgs.shell.nix– convenience wrappernix-shellornix developto quickly get a development environment.devShellfromflake.nixfor non-flake users if desired.These files would:
pyproject.toml/uv.lockvia tools likepyproject.nixorpoetry2nix-style workflows).nix developshell with all required tools for contributing tosbi.checksattribute to run tests in a fully reproducible way.Questions / points to discuss
Interest from maintainers / community
uv, CI systems)?Scope of initial contribution
Would you prefer:
flake.nix+shell.nixto get a workingnix developenvironment), ordefault.nix/packagesinflake.nix),checksinflake.nix)Next steps
If this is welcome, I'm happy to:
flake.nix+shell.nixproviding:nix developenvironment with Python and core dependencies.CONTRIBUTING.mdor a newNIX.mdfile.default.nix/ proper packaging.checksfor running tests via Nix.sbitonixpkgs. This would:sbiavailable as an official Nix package (nix-shell -p sbi).Please let me know:
Thanks for considering this, and apologies if this is not the ideal place or format for such a suggestion.
All reactions