Merge pull request #302379 from NickCao/sagemaker

python312Packages.sagemaker: fix build and modernize
This commit is contained in:
Nick Cao 2024-04-10 20:29:08 -04:00 committed by GitHub
commit da3e37a154
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,9 @@
, buildPythonPackage , buildPythonPackage
, pythonOlder , pythonOlder
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, pythonRelaxDepsHook , pythonRelaxDepsHook
, setuptools
, attrs , attrs
, boto3 , boto3
, cloudpickle , cloudpickle
@ -20,14 +22,18 @@
, platformdirs , platformdirs
, tblib , tblib
, urllib3 , urllib3
, requests
, docker , docker
, tqdm
, psutil
, scipy , scipy
, accelerate
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "sagemaker"; pname = "sagemaker";
version = "2.214.3"; version = "2.214.3";
format = "setuptools"; pyproject = true;
disabled = pythonOlder "3.8"; disabled = pythonOlder "3.8";
@ -38,16 +44,30 @@ buildPythonPackage rec {
hash = "sha256-RE4uyIpFiZNDyS5R6+gMLlj0vcAIiHPattFPTSMGnCI="; hash = "sha256-RE4uyIpFiZNDyS5R6+gMLlj0vcAIiHPattFPTSMGnCI=";
}; };
nativeBuildInputs = [ patches = [
# Distutils removal, fix build with python 3.12
# https://github.com/aws/sagemaker-python-sdk/pull/4544
(fetchpatch {
url = "https://github.com/aws/sagemaker-python-sdk/commit/84447ba59e544c810aeb842fd058e20d89e3fc74.patch";
hash = "sha256-B8Q18ViB7xYy1F5LoL1NvXj2lnFPgt+C9wssSODyAXM=";
})
(fetchpatch {
url = "https://github.com/aws/sagemaker-python-sdk/commit/e9e08a30cb42d4b2d7299c1c4b42d680a8c78110.patch";
hash = "sha256-uGPtXSXfeaIvt9kkZZKQDuiZfoRgw3teffuxai1kKlY=";
})
];
build-system = [
setuptools
pythonRelaxDepsHook pythonRelaxDepsHook
]; ];
pythonRelaxDeps = [ pythonRelaxDeps = [
"attrs" "cloudpickle"
"boto3" "importlib-metadata"
]; ];
propagatedBuildInputs = [ dependencies = [
attrs attrs
boto3 boto3
cloudpickle cloudpickle
@ -64,6 +84,11 @@ buildPythonPackage rec {
jsonschema jsonschema
platformdirs platformdirs
tblib tblib
urllib3
requests
docker
tqdm
psutil
]; ];
doCheck = false; # many test dependencies are not available in nixpkgs doCheck = false; # many test dependencies are not available in nixpkgs
@ -76,6 +101,7 @@ buildPythonPackage rec {
passthru.optional-dependencies = { passthru.optional-dependencies = {
local = [ urllib3 docker pyyaml ]; local = [ urllib3 docker pyyaml ];
scipy = [ scipy ]; scipy = [ scipy ];
huggingface = [ accelerate ];
# feature-processor = [ pyspark sagemaker-feature-store-pyspark ]; # not available in nixpkgs # feature-processor = [ pyspark sagemaker-feature-store-pyspark ]; # not available in nixpkgs
}; };