python310Packages.catboost: 1.0.5 -> 1.2.2

Diff: https://github.com/catboost/catboost/compare/v1.0.5...v1.2.2

Changelog: https://github.com/catboost/catboost/releases/tag/v1.2.2

+44 -226
+38 -52
pkgs/development/python-modules/catboost/default.nix
··· 1 - { buildPythonPackage, fetchFromGitHub, lib, pythonOlder 2 - , clang_12, python 3 - , graphviz, matplotlib, numpy, pandas, plotly, scipy, six 4 - , withCuda ? false, cudatoolkit }: 1 + { lib 2 + , buildPythonPackage 3 + , catboost 4 + , python 5 + , graphviz 6 + , matplotlib 7 + , numpy 8 + , pandas 9 + , plotly 10 + , scipy 11 + , setuptools 12 + , six 13 + , wheel 14 + }: 5 15 6 - buildPythonPackage rec { 7 - pname = "catboost"; 8 - # nixpkgs-update: no auto update 9 - version = "1.0.5"; 16 + buildPythonPackage { 17 + inherit (catboost) pname version src meta; 18 + format = "pyproject"; 10 19 11 - disabled = pythonOlder "3.4"; 20 + sourceRoot = "source/catboost/python-package"; 12 21 13 - src = fetchFromGitHub { 14 - owner = "catboost"; 15 - repo = "catboost"; 16 - rev = "refs/tags/v${version}"; 17 - hash = "sha256-ILemeZUBI9jPb9G6F7QX/T1HaVhQ+g6y7YmsT6DFCJk"; 18 - }; 22 + nativeBuildInputs = [ 23 + setuptools 24 + wheel 25 + ]; 19 26 20 - nativeBuildInputs = [ clang_12 ]; 27 + propagatedBuildInputs = [ 28 + graphviz 29 + matplotlib 30 + numpy 31 + pandas 32 + plotly 33 + scipy 34 + six 35 + ]; 21 36 22 - propagatedBuildInputs = [ graphviz matplotlib numpy pandas scipy plotly six ] 23 - ++ lib.optionals withCuda [ cudatoolkit ]; 37 + buildPhase = '' 38 + runHook preBuild 24 39 25 - patches = [ 26 - ./nix-support.patch 27 - ]; 40 + # these arguments must set after bdist_wheel 41 + ${python.pythonForBuild.interpreter} setup.py bdist_wheel --no-widget --prebuilt-extensions-build-root-dir=${lib.getDev catboost} 28 42 29 - postPatch = '' 30 - # substituteInPlace is too slow for these large files, and the target has lots of numbers in it that change often. 31 - sed -e 's|\$(YMAKE_PYTHON3-.*)/python3|${python.interpreter}|' -i make/*.makefile 43 + runHook postBuild 32 44 ''; 33 45 34 - preBuild = '' 35 - cd catboost/python-package 36 - ''; 37 - setupPyBuildFlags = [ "--with-ymake=no" ]; 38 - CUDA_ROOT = lib.optional withCuda cudatoolkit; 39 - enableParallelBuilding = true; 46 + # setup a test is difficult 47 + doCheck = false; 40 48 41 - # Tests use custom "ya" tool, not yet supported. 42 - dontUseSetuptoolsCheck = true; 43 49 pythonImportsCheck = [ "catboost" ]; 44 - 45 - passthru = { 46 - # Do not update to catboost 1.1.x because the patch doesn't apply cleanly 47 - skipBulkUpdate = true; 48 - }; 49 - 50 - meta = with lib; { 51 - description = "High-performance library for gradient boosting on decision trees."; 52 - longDescription = '' 53 - A fast, scalable, high performance Gradient Boosting on Decision Trees 54 - library, used for ranking, classification, regression and other machine 55 - learning tasks for Python, R, Java, C++. Supports computation on CPU and GPU. 56 - ''; 57 - license = licenses.asl20; 58 - platforms = [ "x86_64-linux" ]; 59 - homepage = "https://catboost.ai"; 60 - maintainers = with maintainers; [ PlushBeaver ]; 61 - # _catboost.pyx.cpp:226822:19: error: use of undeclared identifier '_PyGen_Send' 62 - broken = withCuda; 63 - }; 64 50 }
-173
pkgs/development/python-modules/catboost/nix-support.patch
··· 1 - diff --git a/catboost/python-package/setup.py b/catboost/python-package/setup.py 2 - index fe9251a21f..86b880c5d0 100644 3 - --- a/catboost/python-package/setup.py 4 - +++ b/catboost/python-package/setup.py 5 - @@ -80,7 +80,7 @@ class Helper(object): 6 - self.with_cuda = os.environ.get('CUDA_PATH') or os.environ.get('CUDA_ROOT') or None 7 - self.os_sdk = 'local' 8 - self.with_ymake = True 9 - - self.parallel = None 10 - + self.parallel = os.environ.get('NIX_BUILD_CORES') or None 11 - 12 - def finalize_options(self): 13 - if os.path.exists(str(self.with_cuda)): 14 - @@ -222,11 +222,12 @@ class build_ext(_build_ext): 15 - 16 - def build_with_make(self, topsrc_dir, build_dir, catboost_ext, put_dir, verbose, dry_run): 17 - logging.info('Buildling {} with gnu make'.format(catboost_ext)) 18 - - makefile = 'python{}.{}CLANG11-LINUX-X86_64.makefile'.format(python_version()[0], 'CUDA.' if self.with_cuda else '') 19 - + makefile = 'python{}.{}CLANG12-LINUX-X86_64.makefile'.format(python_version()[0], 'CUDA.' if self.with_cuda else '') 20 - make_cmd = [ 21 - 'make', '-f', '../../make/' + makefile, 22 - - 'CC=clang-11', 23 - - 'CXX=clang++-11', 24 - + 'CC=clang', 25 - + 'CXX=clang++', 26 - + 'PYTHON=python{}'.format(python_version()[0]), 27 - 'BUILD_ROOT=' + build_dir, 28 - 'SOURCE_ROOT=' + topsrc_dir, 29 - ] 30 - diff --git a/make/python2.CLANG12-LINUX-X86_64.makefile b/make/python2.CLANG12-LINUX-X86_64.makefile 31 - index b49a36fb3f..33996af995 100644 32 - --- a/make/python2.CLANG12-LINUX-X86_64.makefile 33 - +++ b/make/python2.CLANG12-LINUX-X86_64.makefile 34 - @@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd) 35 - SOURCE_ROOT = $(shell pwd) 36 - PYTHON = $(shell which python) 37 - 38 - -ifneq ($(MAKECMDGOALS),help) 39 - -define _CC_TEST 40 - -__clang_major__ __clang_minor__ 41 - -endef 42 - - 43 - -_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -) 44 - -$(info _CC_VERSION = '$(_CC_VERSION)') 45 - - 46 - -ifneq '$(_CC_VERSION)' '12 0' 47 - - $(error clang 12.0 is required) 48 - -endif 49 - -endif 50 - - 51 - -ifneq ($(MAKECMDGOALS),help) 52 - -define _CXX_TEST 53 - -__clang_major__ __clang_minor__ 54 - -endef 55 - - 56 - -_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -) 57 - -$(info _CXX_VERSION = '$(_CXX_VERSION)') 58 - - 59 - -ifneq '$(_CXX_VERSION)' '12 0' 60 - - $(error clang 12.0 is required) 61 - -endif 62 - -endif 63 - 64 - 65 - all\ 66 - diff --git a/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile b/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile 67 - index 82935b297e..093cc86532 100644 68 - --- a/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile 69 - +++ b/make/python2.CUDA.CLANG12-LINUX-X86_64.makefile 70 - @@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd) 71 - SOURCE_ROOT = $(shell pwd) 72 - PYTHON = $(shell which python) 73 - 74 - -ifneq ($(MAKECMDGOALS),help) 75 - -define _CC_TEST 76 - -__clang_major__ __clang_minor__ 77 - -endef 78 - - 79 - -_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -) 80 - -$(info _CC_VERSION = '$(_CC_VERSION)') 81 - - 82 - -ifneq '$(_CC_VERSION)' '12 0' 83 - - $(error clang 12.0 is required) 84 - -endif 85 - -endif 86 - - 87 - -ifneq ($(MAKECMDGOALS),help) 88 - -define _CXX_TEST 89 - -__clang_major__ __clang_minor__ 90 - -endef 91 - - 92 - -_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -) 93 - -$(info _CXX_VERSION = '$(_CXX_VERSION)') 94 - - 95 - -ifneq '$(_CXX_VERSION)' '12 0' 96 - - $(error clang 12.0 is required) 97 - -endif 98 - -endif 99 - 100 - 101 - all\ 102 - diff --git a/make/python3.CLANG12-LINUX-X86_64.makefile b/make/python3.CLANG12-LINUX-X86_64.makefile 103 - index 1c5d646ae4..6c091fbe17 100644 104 - --- a/make/python3.CLANG12-LINUX-X86_64.makefile 105 - +++ b/make/python3.CLANG12-LINUX-X86_64.makefile 106 - @@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd) 107 - SOURCE_ROOT = $(shell pwd) 108 - PYTHON = $(shell which python) 109 - 110 - -ifneq ($(MAKECMDGOALS),help) 111 - -define _CC_TEST 112 - -__clang_major__ __clang_minor__ 113 - -endef 114 - - 115 - -_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -) 116 - -$(info _CC_VERSION = '$(_CC_VERSION)') 117 - - 118 - -ifneq '$(_CC_VERSION)' '12 0' 119 - - $(error clang 12.0 is required) 120 - -endif 121 - -endif 122 - - 123 - -ifneq ($(MAKECMDGOALS),help) 124 - -define _CXX_TEST 125 - -__clang_major__ __clang_minor__ 126 - -endef 127 - - 128 - -_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -) 129 - -$(info _CXX_VERSION = '$(_CXX_VERSION)') 130 - - 131 - -ifneq '$(_CXX_VERSION)' '12 0' 132 - - $(error clang 12.0 is required) 133 - -endif 134 - -endif 135 - 136 - 137 - all\ 138 - diff --git a/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile b/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile 139 - index fcdb75a719..4e1dbc3cd7 100644 140 - --- a/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile 141 - +++ b/make/python3.CUDA.CLANG12-LINUX-X86_64.makefile 142 - @@ -4,31 +4,6 @@ BUILD_ROOT = $(shell pwd) 143 - SOURCE_ROOT = $(shell pwd) 144 - PYTHON = $(shell which python) 145 - 146 - -ifneq ($(MAKECMDGOALS),help) 147 - -define _CC_TEST 148 - -__clang_major__ __clang_minor__ 149 - -endef 150 - - 151 - -_CC_VERSION = $(shell echo '$(_CC_TEST)' | $(CC) -E -P -) 152 - -$(info _CC_VERSION = '$(_CC_VERSION)') 153 - - 154 - -ifneq '$(_CC_VERSION)' '12 0' 155 - - $(error clang 12.0 is required) 156 - -endif 157 - -endif 158 - - 159 - -ifneq ($(MAKECMDGOALS),help) 160 - -define _CXX_TEST 161 - -__clang_major__ __clang_minor__ 162 - -endef 163 - - 164 - -_CXX_VERSION = $(shell echo '$(_CXX_TEST)' | $(CXX) -E -P -) 165 - -$(info _CXX_VERSION = '$(_CXX_VERSION)') 166 - - 167 - -ifneq '$(_CXX_VERSION)' '12 0' 168 - - $(error clang 12.0 is required) 169 - -endif 170 - -endif 171 - 172 - 173 - all\
+6 -1
pkgs/top-level/python-packages.nix
··· 1769 1769 1770 1770 catalogue = callPackage ../development/python-modules/catalogue { }; 1771 1771 1772 - catboost = callPackage ../development/python-modules/catboost { }; 1772 + catboost = callPackage ../development/python-modules/catboost { 1773 + catboost = pkgs.catboost.override { 1774 + pythonSupport = true; 1775 + python3Packages = self; 1776 + }; 1777 + }; 1773 1778 1774 1779 catppuccin = callPackage ../development/python-modules/catppuccin { }; 1775 1780