biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / strenum / default.nix
blob68e6a93e76c24bc7bd0e9a2c7b6661c4d1ee42a9
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   fetchpatch,
6   pytestCheckHook,
7   pythonOlder,
8   setuptools,
9 }:
11 buildPythonPackage rec {
12   pname = "strenum";
13   version = "0.4.15";
14   pyproject = true;
16   disabled = pythonOlder "3.7";
18   src = fetchFromGitHub {
19     owner = "irgeek";
20     repo = "StrEnum";
21     rev = "refs/tags/v${version}";
22     hash = "sha256-LrDLIWiV/zIbl7CwKh7DAy4LoLyY7+hfUu8nqduclnA=";
23   };
25   patches = [
26     # Replace SafeConfigParser and readfp, https://github.com/milanmeu/aioaseko/pull/6
27     (fetchpatch {
28       name = "replace-safeconfigparser.patch";
29       url = "https://github.com/irgeek/StrEnum/commit/896bef1b7e4a50c8b53d90c8d2fb5c0164f08ecd.patch";
30       hash = "sha256-dmmEzhy17huclo1wOubpBUDc2L7vqEU5b/6a5loM47A=";
31     })
32   ];
34   postPatch = ''
35     substituteInPlace setup.py \
36       --replace '"pytest-runner"' ""
37     substituteInPlace pytest.ini \
38       --replace " --cov=strenum --cov-report term-missing --black --pylint" ""
39   '';
41   nativeBuildInputs = [ setuptools ];
43   nativeCheckInputs = [ pytestCheckHook ];
45   pythonImportsCheck = [ "strenum" ];
47   meta = with lib; {
48     description = "Module for enum that inherits from str";
49     homepage = "https://github.com/irgeek/StrEnum";
50     changelog = "https://github.com/irgeek/StrEnum/releases/tag/v${version}";
51     license = with licenses; [ mit ];
52     maintainers = with maintainers; [ fab ];
53   };