1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 attrs,
11 boto3,
12 cloudpickle,
13 docker,
14 google-pasta,
15 importlib-metadata,
16 jsonschema,
17 numpy,
18 packaging,
19 pandas,
20 pathos,
21 platformdirs,
22 protobuf,
23 psutil,
24 pyyaml,
25 requests,
26 sagemaker-core,
27 sagemaker-mlflow,
28 schema,
29 smdebug-rulesconfig,
30 tblib,
31 tqdm,
32 urllib3,
33
34 # optional-dependencies
35 scipy,
36 accelerate,
37}:
38
39buildPythonPackage rec {
40 pname = "sagemaker";
41 version = "2.232.3";
42 pyproject = true;
43
44 src = fetchFromGitHub {
45 owner = "aws";
46 repo = "sagemaker-python-sdk";
47 rev = "refs/tags/v${version}";
48 hash = "sha256-6kGxmgkR/1ih2V49C9aEUBBCJS6s1Jbev80FDnJtHFg=";
49 };
50
51 build-system = [
52 hatchling
53 ];
54
55 pythonRelaxDeps = [
56 "attrs"
57 "boto3"
58 "cloudpickle"
59 "importlib-metadata"
60 "protobuf"
61 ];
62
63 dependencies = [
64 attrs
65 boto3
66 cloudpickle
67 docker
68 google-pasta
69 importlib-metadata
70 jsonschema
71 numpy
72 packaging
73 pandas
74 pathos
75 platformdirs
76 protobuf
77 psutil
78 pyyaml
79 requests
80 sagemaker-core
81 sagemaker-mlflow
82 schema
83 smdebug-rulesconfig
84 tblib
85 tqdm
86 urllib3
87 ];
88
89 doCheck = false; # many test dependencies are not available in nixpkgs
90
91 pythonImportsCheck = [
92 "sagemaker"
93 "sagemaker.lineage.visualizer"
94 ];
95
96 optional-dependencies = {
97 local = [
98 urllib3
99 docker
100 pyyaml
101 ];
102 scipy = [ scipy ];
103 huggingface = [ accelerate ];
104 # feature-processor = [ pyspark sagemaker-feature-store-pyspark ]; # not available in nixpkgs
105 };
106
107 meta = {
108 description = "Library for training and deploying machine learning models on Amazon SageMaker";
109 homepage = "https://github.com/aws/sagemaker-python-sdk/";
110 changelog = "https://github.com/aws/sagemaker-python-sdk/blob/v${version}/CHANGELOG.md";
111 license = lib.licenses.asl20;
112 maintainers = with lib.maintainers; [ nequissimus ];
113 };
114}