Merge pull request #312993 from TomaSajt/vmprof

python311Packages.vmprof: remove patches, enable checks, clean up

authored by Weijia Wang and committed by GitHub af0eb02b dfad343a

+38 -40
+38 -40
pkgs/development/python-modules/vmprof/default.nix
··· 1 - { stdenv 2 - , lib 3 - , buildPythonPackage 4 - , fetchpatch 5 - , fetchPypi 6 - , colorama 7 - , libunwind 8 - , pytz 9 - , requests 10 - , six 1 + { 2 + lib, 3 + buildPythonPackage, 4 + pythonOlder, 5 + pythonAtLeast, 6 + fetchFromGitHub, 7 + setuptools, 8 + colorama, 9 + pytz, 10 + requests, 11 + six, 12 + libunwind, 13 + pytestCheckHook, 11 14 }: 12 15 13 16 buildPythonPackage rec { 14 - version = "0.4.17"; 15 - format = "setuptools"; 16 17 pname = "vmprof"; 18 + version = "0.4.17"; 19 + pyproject = true; 17 20 18 - src = fetchPypi { 19 - inherit pname version; 20 - sha256 = "sha256-ACYj7Lb/QT6deG0uuiPCj850QXhaw4XuQX6aZu8OM2U="; 21 + disabled = pythonOlder "3.6" || pythonAtLeast "3.12"; 22 + 23 + src = fetchFromGitHub { 24 + owner = "vmprof"; 25 + repo = "vmprof-python"; 26 + rev = "refs/tags/${version}"; 27 + hash = "sha256-7k6mtEdPmp1eNzB4l/k/ExSYtRJVmRxcx50ql8zR36k="; 21 28 }; 22 29 30 + build-system = [ setuptools ]; 31 + 32 + dependencies = [ 33 + colorama 34 + requests 35 + six 36 + pytz 37 + ]; 38 + 23 39 buildInputs = [ libunwind ]; 24 - propagatedBuildInputs = [ colorama requests six pytz ]; 25 40 26 - patches = [ 27 - (fetchpatch { 28 - name = "${pname}-python-3.10-compat.patch"; 29 - # https://github.com/vmprof/vmprof-python/pull/198 30 - url = "https://github.com/vmprof/vmprof-python/commit/e4e99e5aa677f96d1970d88c8a439f995f429f85.patch"; 31 - hash = "sha256-W/c6WtVuKi7xO2sCOr71mrZTWqI86bWg5a0FeDNolh0="; 32 - }) 33 - (fetchpatch { 34 - name = "${pname}-python-3.11-compat.patch"; 35 - # https://github.com/vmprof/vmprof-python/pull/251 (not yet merged) 36 - url = "https://github.com/matthiasdiener/vmprof-python/compare/a1a1b5264ec0b197444c0053e44f8ae4ffed9353...13c39166363b960017393b614270befe01230be8.patch"; 37 - excludes = [ "test_requirements.txt" ]; 38 - hash = "sha256-3+0PVdAf83McNd93Q9dD4HLXt39UinVU5BA8jWfT6F4="; 39 - }) 41 + nativeCheckInputs = [ pytestCheckHook ]; 42 + 43 + disabledTests = [ 44 + "test_gzip_call" 45 + "test_is_enabled" 46 + "test_get_profile_path" 47 + "test_get_runtime" 40 48 ]; 41 49 42 - # No tests included 43 - doCheck = false; 44 50 pythonImportsCheck = [ "vmprof" ]; 45 51 46 - # Workaround build failure on -fno-common toolchains: 47 - # ld: src/vmprof_unix.o:src/vmprof_common.h:92: multiple definition of 48 - # `_PyThreadState_Current'; src/_vmprof.o:src/vmprof_common.h:92: first defined here 49 - # TODO: can be removed once next release contains: 50 - # https://github.com/vmprof/vmprof-python/pull/203 51 - env.NIX_CFLAGS_COMPILE = "-fcommon"; 52 - 53 52 meta = with lib; { 54 - broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin; 55 53 description = "A vmprof client"; 56 54 mainProgram = "vmprofshow"; 57 55 license = licenses.mit;