2022-03-05 20:26:48 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-03-07 17:39:07 +00:00
|
|
|
, fetchPypi
|
2022-03-05 20:26:48 +00:00
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# runtime
|
|
|
|
, editables
|
|
|
|
, importlib-metadata # < 3.8
|
|
|
|
, packaging
|
|
|
|
, pathspec
|
|
|
|
, pluggy
|
|
|
|
, tomli
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, build
|
|
|
|
, python
|
|
|
|
, requests
|
|
|
|
, virtualenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "hatchling";
|
2023-02-26 12:33:53 +00:00
|
|
|
version = "1.13.0";
|
2022-03-05 20:26:48 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version;
|
|
|
|
format = "pyproject";
|
|
|
|
|
2022-03-07 17:39:07 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-02-26 12:33:53 +00:00
|
|
|
hash = "sha256-+NJ1osxyBzUoa3wuK8NdoFdh5tNpXC+kFlUDlfEMU8c=";
|
2022-03-05 20:26:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# listed in backend/src/hatchling/ouroboros.py
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
editables
|
|
|
|
packaging
|
|
|
|
pathspec
|
|
|
|
pluggy
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2022-06-10 12:10:32 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
tomli
|
2022-03-05 20:26:48 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"hatchling"
|
2022-03-07 17:39:07 +00:00
|
|
|
"hatchling.build"
|
2022-03-05 20:26:48 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# tries to fetch packages from the internet
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
# listed in /backend/tests/downstream/requirements.txt
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-03-05 20:26:48 +00:00
|
|
|
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";
|
2022-06-10 12:10:32 +00:00
|
|
|
homepage = "https://hatch.pypa.io/latest/";
|
2023-02-26 12:33:53 +00:00
|
|
|
changelog = "https://github.com/pypa/hatch/releases/tag/hatchling-v${version}";
|
2022-03-05 20:26:48 +00:00
|
|
|
license = licenses.mit;
|
2022-03-07 17:39:07 +00:00
|
|
|
maintainers = with maintainers; [ hexa ofek ];
|
2022-03-05 20:26:48 +00:00
|
|
|
};
|
|
|
|
}
|