depot/third_party/nixpkgs/pkgs/development/python-modules/hatchling/default.nix
Default email 13da32182d Project import generated by Copybara.
GitOrigin-RevId: a7855f2235a1876f97473a76151fec2afa02b287
2022-08-21 15:32:41 +02:00

78 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
# runtime
, editables
, importlib-metadata # < 3.8
, packaging
, pathspec
, pluggy
, tomli
# tests
, build
, python
, requests
, virtualenv
}:
let
pname = "hatchling";
version = "1.6.0";
in
buildPythonPackage {
inherit pname version;
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-vW6FBd5RGsQhf/UJJ/bRhFSUYI5AHmOmK4MMMfthNUQ=";
};
# listed in backend/src/hatchling/ouroboros.py
propagatedBuildInputs = [
editables
packaging
pathspec
pluggy
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
] ++ lib.optionals (pythonOlder "3.11") [
tomli
];
pythonImportsCheck = [
"hatchling"
"hatchling.build"
];
# tries to fetch packages from the internet
doCheck = false;
# listed in /backend/tests/downstream/requirements.txt
checkInputs = [
build
packaging
requests
virtualenv
];
preCheck = ''
export HOME=$TMPDIR
'';
checkPhase = ''
runHook preCheck
${python.interpreter} tests/downstream/integrate.py
runHook postCheck
'';
meta = with lib; {
description = "Modern, extensible Python build backend";
homepage = "https://hatch.pypa.io/latest/";
license = licenses.mit;
maintainers = with maintainers; [ hexa ofek ];
};
}