From d51b04750b2eba665ec5636980b7c2f68d57de45 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 6 Aug 2024 21:23:16 +0200 Subject: [PATCH] nix: add comment about pyproject parsing --- flake.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 6a0d7482f..d487783da 100644 --- a/flake.nix +++ b/flake.nix @@ -8,8 +8,12 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; + # we want to extract some metadata and especially the dependencies + # from the pyproject file, like this we do not have to maintain the + # list a second time pyproject = pkgs.lib.trivial.importTOML ./pyproject.toml; - # get a list of python packages by name + # get a list of python packages by name, used to get the nix packages + # for the dependency names from the pyproject file getPkgs = names: builtins.attrValues (pkgs.lib.attrsets.getAttrs names pkgs.python3Packages); # extract the python dependencies from the pyprojec file, cut the version constraint dependencies' = pkgs.lib.lists.concatMap (builtins.match "([^>=<]*).*") pyproject.project.dependencies;