2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2024-09-19 14:19:46 +00:00
|
|
|
ddt,
|
2024-06-05 15:53:02 +00:00
|
|
|
fetchPypi,
|
|
|
|
flake8,
|
2024-09-19 14:19:46 +00:00
|
|
|
pbr,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2024-06-05 15:53:02 +00:00
|
|
|
stestr,
|
|
|
|
testscenarios,
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hacking";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "7.0.0";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-ubbC5SgPfVT6gsWP4JmD9oxbb2NKw/ozn4uhalcVyrc=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-01-20 10:41:00 +00:00
|
|
|
sed -i 's/flake8.*/flake8/' requirements.txt
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [
|
|
|
|
pbr
|
|
|
|
setuptools
|
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [ flake8 ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
ddt
|
|
|
|
stestr
|
|
|
|
testscenarios
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
runHook preCheck
|
2022-03-30 09:31:56 +00:00
|
|
|
stestr run
|
2024-09-19 14:19:46 +00:00
|
|
|
runHook postCheck
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "hacking" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "OpenStack Hacking Guideline Enforcement";
|
|
|
|
homepage = "https://github.com/openstack/hacking";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = teams.openstack.members;
|
|
|
|
};
|
|
|
|
}
|