Skip to content

Commit

Permalink
nix: add comment about pyproject parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
lucc authored and pazz committed Aug 7, 2024
1 parent dbc1277 commit d51b047
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d51b047

Please sign in to comment.