mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Get license information from nixpkgs lib
This commit is contained in:
parent
c499f3b342
commit
927ae249ef
2 changed files with 7 additions and 5 deletions
|
@ -20,6 +20,11 @@ let
|
|||
else default
|
||||
);
|
||||
|
||||
# Map SPDX identifiers to license names
|
||||
spdxLicenses = lib.listToAttrs (lib.filter (pair: pair.name != null) (builtins.map (v: { name = if lib.hasAttr "spdxId" v then v.spdxId else null; value = v;}) (lib.attrValues lib.licenses)));
|
||||
# Get license by id falling back to input string
|
||||
getLicenseBySpdxId = spdxId: getAttrDefault spdxId spdxLicenses spdxId;
|
||||
|
||||
#
|
||||
# Returns an attrset { python, poetryPackages } for the given lockfile
|
||||
#
|
||||
|
@ -196,8 +201,8 @@ let
|
|||
'';
|
||||
|
||||
meta = meta // {
|
||||
inherit (pyProject.tool.poetry) description;
|
||||
license = pyProject.tool.poetry.license;
|
||||
inherit (pyProject.tool.poetry) description homepage;
|
||||
license = getLicenseBySpdxId (getAttrDefault "license" pyProject.tool.poetry "unknown");
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -59,9 +59,6 @@ poetry2nix.mkPoetryApplication {
|
|||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://python-poetry.org/";
|
||||
description = "Python dependency management and packaging made easy";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ adisbladis ];
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue