nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python313Packages.anybadge: fix build, modernize

+19 -8
+19 -8
pkgs/development/python-modules/anybadge/default.nix
··· 2 2 lib, 3 3 buildPythonPackage, 4 4 fetchFromGitHub, 5 + setuptools, 5 6 packaging, 6 7 pytestCheckHook, 7 8 pythonOlder, 8 9 requests, 10 + sh, 9 11 }: 10 12 11 13 buildPythonPackage rec { 12 14 pname = "anybadge"; 13 15 version = "1.16.0"; 14 - format = "setuptools"; 16 + pyproject = true; 15 17 16 18 disabled = pythonOlder "3.7"; 17 19 18 20 src = fetchFromGitHub { 19 21 owner = "jongracecox"; 20 - repo = pname; 22 + repo = "anybadge"; 21 23 tag = "v${version}"; 22 24 hash = "sha256-9qGmiIGzVdWHMyurMqTqEz+NKYlc/5zt6HPsssCH4Pk="; 23 25 }; 24 26 25 - # setup.py reads its version from the TRAVIS_TAG environment variable 26 - TRAVIS_TAG = "v${version}"; 27 + postPatch = '' 28 + substituteInPlace setup.py \ 29 + --replace-fail '=get_version(),' "='$version'," 30 + ''; 27 31 28 - propagatedBuildInputs = [ packaging ]; 32 + build-system = [ 33 + setuptools 34 + ]; 35 + 36 + dependencies = [ 37 + packaging 38 + ]; 29 39 30 40 nativeCheckInputs = [ 31 41 pytestCheckHook 32 42 requests 43 + sh 33 44 ]; 34 45 35 46 disabledTests = [ ··· 55 44 56 45 pythonImportsCheck = [ "anybadge" ]; 57 46 58 - meta = with lib; { 47 + meta = { 59 48 description = "Python tool for generating badges for your projects"; 60 49 homepage = "https://github.com/jongracecox/anybadge"; 61 50 changelog = "https://github.com/jongracecox/anybadge/releases/tag/${src.tag}"; 62 - license = licenses.mit; 63 - maintainers = with maintainers; [ fabiangd ]; 51 + license = lib.licenses.mit; 52 + maintainers = with lib.maintainers; [ fabiangd ]; 64 53 }; 65 54 }