1{
2 sparqlwrapper,
3 boto3,
4 buildPythonPackage,
5 fetchFromGitHub,
6 gremlinpython,
7 jsonpath-ng,
8 lib,
9 moto,
10 openpyxl,
11 opensearch-py,
12 pandas,
13 pg8000,
14 poetry-core,
15 progressbar2,
16 pyarrow,
17 pymysql,
18 pyodbc,
19 pyparsing,
20 pytestCheckHook,
21 pythonOlder,
22 redshift-connector,
23 requests-aws4auth,
24}:
25
26buildPythonPackage rec {
27 pname = "awswrangler";
28 version = "3.9.1";
29 pyproject = true;
30
31 disabled = pythonOlder "3.8";
32
33 src = fetchFromGitHub {
34 owner = "aws";
35 repo = "aws-sdk-pandas";
36 rev = "refs/tags/${version}";
37 hash = "sha256-k+jQj/EajjjvvXZJd8c/3vtaGrQJedbYSDIzel0Sp44=";
38 };
39
40 pythonRelaxDeps = [ "packaging" ];
41
42 build-system = [ poetry-core ];
43
44
45 dependencies = [
46 boto3
47 gremlinpython
48 jsonpath-ng
49 openpyxl
50 opensearch-py
51 pandas
52 pg8000
53 progressbar2
54 pyarrow
55 pymysql
56 redshift-connector
57 requests-aws4auth
58 ];
59
60 optional-dependencies = {
61 sqlserver = [ pyodbc ];
62 sparql = [ sparqlwrapper ];
63 };
64
65 nativeCheckInputs = [
66 moto
67 pyparsing
68 pytestCheckHook
69 ];
70
71 pythonImportsCheck = [ "awswrangler" ];
72
73 pytestFlagsArray = [
74 # Subset of tests that run in upstream CI (many others require credentials)
75 # https://github.com/aws/aws-sdk-pandas/blob/20fec775515e9e256e8cee5aee12966516608840/.github/workflows/minimal-tests.yml#L36-L43
76 "tests/unit/test_metadata.py"
77 "tests/unit/test_session.py"
78 "tests/unit/test_utils.py"
79 "tests/unit/test_moto.py"
80 ];
81
82 meta = with lib; {
83 description = "Pandas on AWS";
84 homepage = "https://github.com/aws/aws-sdk-pandas";
85 changelog = "https://github.com/aws/aws-sdk-pandas/releases/tag/${version}";
86 license = licenses.asl20;
87 maintainers = with maintainers; [ mcwitt ];
88 };
89}