{python3Packages.,}catboost: 1.2.7 -> 1.2.10 (#505428)

This commit is contained in:
Marcin Serwin
2026-05-08 20:48:52 +00:00
committed by GitHub
3 changed files with 28 additions and 56 deletions
+14 -13
View File
@@ -4,7 +4,6 @@
fetchFromGitHub,
cmake,
cctools,
libiconv,
llvmPackages,
ninja,
openssl,
@@ -19,23 +18,25 @@
}:
let
stdenv = if cudaSupport then cudaPackages.backendStdenv else llvmPackages.stdenv;
buildPythonBindingsEnv = python3Packages.python.withPackages (
ps: with ps; [
cython
numpy
]
);
in
stdenv.mkDerivation (finalAttrs: {
pname = "catboost";
version = "1.2.7";
version = "1.2.10";
src = fetchFromGitHub {
owner = "catboost";
repo = "catboost";
tag = "v${finalAttrs.version}";
hash = "sha256-I3geFdVQ1Pm61eRXi+ueaxel3QRb8EJV9f4zV2Q7kk4=";
hash = "sha256-z68vflYgO3cWeOkb417Gyco1Fqb98ulyRgI+OS+B4is=";
};
patches = [
./remove-conan.patch
];
postPatch = ''
substituteInPlace cmake/common.cmake \
--replace-fail "\''${RAGEL_BIN}" "${ragel}/bin/ragel" \
@@ -43,7 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
shopt -s globstar
for cmakelists in **/CMakeLists.*; do
sed -i "s/OpenSSL::OpenSSL/OpenSSL::SSL/g" $cmakelists
sed -i "s/openssl::openssl/OpenSSL::SSL/g" $cmakelists
done
'';
@@ -53,10 +54,10 @@ stdenv.mkDerivation (finalAttrs: {
];
nativeBuildInputs = [
buildPythonBindingsEnv
cmake
llvmPackages.bintools
ninja
(python3Packages.python.withPackages (ps: with ps; [ six ]))
ragel
yasm
]
@@ -71,9 +72,6 @@ stdenv.mkDerivation (finalAttrs: {
openssl
zlib
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
]
++ lib.optionals cudaSupport [
cudaPackages.cuda_cudart
cudaPackages.cuda_cccl
@@ -101,7 +99,10 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "CMAKE_POSITION_INDEPENDENT_CODE" true)
(lib.cmakeFeature "CATBOOST_COMPONENTS" "app;libs${lib.optionalString pythonSupport ";python-package"}")
(lib.cmakeBool "HAVE_CUDA" cudaSupport)
];
]
++ lib.optional pythonSupport (
lib.cmakeFeature "Python_EXECUTABLE" "${buildPythonBindingsEnv.interpreter}"
);
installPhase = ''
runHook preInstall
@@ -1,39 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 24ffd1225a..700adcc246 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,6 @@ include(cmake/global_flags.cmake)
include(cmake/global_vars.cmake)
include(cmake/archive.cmake)
include(cmake/common.cmake)
-include(cmake/conan1_deprecated.cmake)
include(cmake/cuda.cmake)
include(cmake/cython.cmake)
include(cmake/fbs.cmake)
@@ -48,21 +47,6 @@ include(cmake/recursive_library.cmake)
include(cmake/shared_libs.cmake)
include(cmake/swig.cmake)
-if (CMAKE_CROSSCOMPILING)
- include(${PROJECT_BINARY_DIR}/conan_paths.cmake)
-else()
- conan_cmake_autodetect(settings)
- conan_cmake_install(
- PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}
- INSTALL_FOLDER ${PROJECT_BINARY_DIR}
- BUILD missing
- REMOTE conancenter
- SETTINGS ${settings}
- ENV "CONAN_CMAKE_GENERATOR=${CMAKE_GENERATOR}"
- CONF "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}"
- )
-endif()
-
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA)
include(CMakeLists.linux-x86_64.txt)
@@ -93,4 +77,3 @@ elseif (ANDROID AND CMAKE_ANDROID_ARCH STREQUAL "x86")
elseif (ANDROID AND CMAKE_ANDROID_ARCH STREQUAL "x86_64")
include(CMakeLists.android-x86_64.txt)
endif()
-
@@ -5,6 +5,8 @@
python,
# build-system
cmake,
cython,
setuptools,
# dependencies
@@ -28,6 +30,8 @@ buildPythonPackage rec {
sourceRoot = "${src.name}/catboost/python-package";
build-system = [
cmake
cython
setuptools
];
@@ -41,6 +45,15 @@ buildPythonPackage rec {
six
];
postPatch = ''
substituteInPlace setup.py \
--replace-fail "cmake (>=3.24, <4.0)" "cmake" \
--replace-fail "'conan (>=2.4.1, <3.0)', " "" \
--replace-fail "cython ~= 3.0.10" "cython"
'';
dontConfigure = true;
buildPhase = ''
runHook preBuild
@@ -55,8 +68,5 @@ buildPythonPackage rec {
pythonImportsCheck = [ "catboost" ];
meta = catboost.meta // {
# https://github.com/catboost/catboost/issues/2671
broken = lib.versionAtLeast numpy.version "2";
};
meta = catboost.meta;
}