mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-05 09:11:39 -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
|
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
|
# Returns an attrset { python, poetryPackages } for the given lockfile
|
||||||
#
|
#
|
||||||
|
@ -196,8 +201,8 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = meta // {
|
meta = meta // {
|
||||||
inherit (pyProject.tool.poetry) description;
|
inherit (pyProject.tool.poetry) description homepage;
|
||||||
license = pyProject.tool.poetry.license;
|
license = getLicenseBySpdxId (getAttrDefault "license" pyProject.tool.poetry "unknown");
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,9 +59,6 @@ poetry2nix.mkPoetryApplication {
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://python-poetry.org/";
|
|
||||||
description = "Python dependency management and packaging made easy";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
maintainers = with maintainers; [ adisbladis ];
|
maintainers = with maintainers; [ adisbladis ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue