nixpkgs/pkgs/development/python-modules/tomli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.2 KiB
Nix
Raw Normal View History

2021-07-19 14:39:43 +00:00
{ lib
, buildPythonPackage
, callPackage
2021-07-19 14:39:43 +00:00
, fetchFromGitHub
, flit-core
# important downstream dependencies
, flit
, black
, mypy
, setuptools-scm
2021-07-19 14:39:43 +00:00
}:
buildPythonPackage rec {
pname = "tomli";
version = "1.2.2";
2021-07-19 14:39:43 +00:00
format = "pyproject";
outputs = [
"out"
"testsout"
];
2021-07-19 14:39:43 +00:00
src = fetchFromGitHub {
owner = "hukkin";
repo = pname;
rev = version;
sha256 = "sha256-oDjpNzWxTaCC1+WyBKrkR6kp90ZomcZQfyW+xKddDoM=";
2021-07-19 14:39:43 +00:00
};
patches = [
# required for mypy
./fix-backwards-compatibility-load.patch
];
2021-07-19 14:39:43 +00:00
nativeBuildInputs = [ flit-core ];
postInstall = ''
mkdir $testsout
cp -R benchmark/ pyproject.toml tests/ $testsout/
'';
2021-07-19 14:39:43 +00:00
pythonImportsCheck = [ "tomli" ];
# check in passthru.tests.pytest to escape infinite recursion with setuptools-scm
doCheck = false;
passthru.tests = {
pytest = callPackage ./tests.nix { };
inherit flit black mypy setuptools-scm;
};
2021-07-19 14:39:43 +00:00
meta = with lib; {
description = "A Python library for parsing TOML, fully compatible with TOML v1.0.0";
homepage = "https://github.com/hukkin/tomli";
license = licenses.mit;
maintainers = with maintainers; [ veehaitch SuperSandro2000 ];
2021-07-19 14:39:43 +00:00
};
}