2022-03-05 20:26:48 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# runtime
|
|
|
|
, editables
|
|
|
|
, importlib-metadata # < 3.8
|
|
|
|
, packaging
|
|
|
|
, pathspec
|
|
|
|
, pluggy
|
|
|
|
, tomli
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, build
|
|
|
|
, python
|
|
|
|
, requests
|
|
|
|
, toml
|
|
|
|
, virtualenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "hatchling";
|
2022-03-07 11:16:21 +00:00
|
|
|
version = "0.20.0";
|
2022-03-05 20:26:48 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version;
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ofek";
|
|
|
|
repo = "hatch";
|
|
|
|
rev = "${pname}-v${version}";
|
2022-03-07 11:16:21 +00:00
|
|
|
hash = "sha256-Sm3utqkuofVDn815HPj501KEuypnaYKm06ehsu+m3i4=";
|
2022-03-05 20:26:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
cd backend
|
|
|
|
'';
|
|
|
|
|
|
|
|
# listed in backend/src/hatchling/ouroboros.py
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
editables
|
|
|
|
packaging
|
|
|
|
pathspec
|
|
|
|
pluggy
|
|
|
|
tomli
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"hatchling"
|
|
|
|
];
|
|
|
|
|
|
|
|
# tries to fetch packages from the internet
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
# listed in /backend/tests/downstream/requirements.txt
|
|
|
|
checkInputs = [
|
|
|
|
build
|
|
|
|
packaging
|
|
|
|
requests
|
|
|
|
toml
|
|
|
|
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://ofek.dev/hatch/latest/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|