Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / strenum / default.nix
blobb3ae130af270549ee8fba9babdbc857ccb0646fe
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , fetchpatch
5 , pytestCheckHook
6 , pythonOlder
7 , setuptools
8 }:
10 buildPythonPackage rec {
11   pname = "strenum";
12   version = "0.4.15";
13   pyproject = true;
15   disabled = pythonOlder "3.7";
17   src = fetchFromGitHub {
18     owner = "irgeek";
19     repo = "StrEnum";
20     rev = "refs/tags/v${version}";
21     hash = "sha256-LrDLIWiV/zIbl7CwKh7DAy4LoLyY7+hfUu8nqduclnA=";
22   };
24   patches = [
25     # Replace SafeConfigParser and readfp, https://github.com/milanmeu/aioaseko/pull/6
26     (fetchpatch {
27       name = "replace-safeconfigparser.patch";
28       url = "https://github.com/irgeek/StrEnum/commit/896bef1b7e4a50c8b53d90c8d2fb5c0164f08ecd.patch";
29       hash = "sha256-dmmEzhy17huclo1wOubpBUDc2L7vqEU5b/6a5loM47A=";
30     })
31   ];
33   postPatch = ''
34     substituteInPlace setup.py \
35       --replace '"pytest-runner"' ""
36     substituteInPlace pytest.ini \
37       --replace " --cov=strenum --cov-report term-missing --black --pylint" ""
38   '';
40   nativeBuildInputs = [
41     setuptools
42   ];
44   nativeCheckInputs = [
45     pytestCheckHook
46   ];
48   pythonImportsCheck = [
49     "strenum"
50   ];
52   meta = with lib; {
53     description = "Module for enum that inherits from str";
54     homepage = "https://github.com/irgeek/StrEnum";
55     changelog = "https://github.com/irgeek/StrEnum/releases/tag/v${version}";
56     license = with licenses; [ mit ];
57     maintainers = with maintainers; [ fab ];
58   };