1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 boto3,
11 mlflow,
12
13 # tests
14 pytestCheckHook,
15 scikit-learn,
16}:
17
18buildPythonPackage rec {
19 pname = "sagemaker-mlflow";
20 version = "0.1.1";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "aws";
25 repo = "sagemaker-mlflow";
26 tag = "v${version}";
27 hash = "sha256-mHwlP1bVkUiT6RbVf8YLHG+tzkw5+UVrPzcExgcEoJM=";
28 };
29
30 postPatch = ''
31 substituteInPlace VERSION \
32 --replace-fail "${version}.dev0" "${version}"
33 '';
34
35 build-system = [
36 setuptools
37 ];
38
39 dependencies = [
40 boto3
41 mlflow
42 ];
43
44 pythonImportsCheck = [
45 "sagemaker_mlflow"
46 ];
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 scikit-learn
51 ];
52
53 disabledTests = [
54 # AssertionError: assert 's3' in '/build/source/not implemented/0/d3c16d2bad4245bf9fc68f86d2e7599d/artifacts'
55 "test_log_metric"
56
57 # AssertionError: assert 'not implemented' == 'mw'
58 "test_request_header"
59
60 # Require internet access
61 "test_auth_provider_returns_correct_sigv4"
62 "test_log_artifact"
63 "test_presigned_url"
64 "test_presigned_url_with_fields"
65 ];
66
67 meta = {
68 description = "MLFlow plugin for SageMaker";
69 homepage = "https://github.com/aws/sagemaker-mlflow";
70 changelog = "https://github.com/aws/sagemaker-mlflow/releases/tag/v${version}";
71 license = lib.licenses.asl20;
72 maintainers = with lib.maintainers; [ GaetanLepage ];
73 };
74}