Python: maintaining requirements.nix and requirements.txt?


#1

I’ve been experimenting with using nix to manage the development environment for a python-based web app. I initially generated a requirements.nix with pypi2nix but needed fairly significant manual updates to get everything sorted.

I’m pretty happy with how this works, but I’m leery of the potential for mistakes/divergence introduced by having separate authoritative definitions for packages installed in my personal dev environment and the production environment.

Does anyone have or know of good tooling/patterns for maintaining a single authoritative source?


#2

I hope that pypi2nix will be able to cache results of single packages at some point. At the moment when a failure, one has to start from the beginning, which takes too much time on complex projects.


#3

For what it’s worth, I have had good results to date using https://github.com/datakurre/setup.nix (which adds some useful helper functions on top of pip2nix (this one https://github.com/johbo/pip2nix )

I’ve not worked with https://github.com/garbas/pypi2nix so cannot speak to it


#4

Thanks for pointing out setup.nix. I’m not sure it will quite solve my immediate concern, but I can think of some other ways to put it to use.