diff options
author | edef <edef@edef.eu> | 2024-04-03 11:55:29 +0000 |
---|---|---|
committer | edef <edef@edef.eu> | 2024-04-03 11:55:29 +0000 |
commit | 51912b15f834ad07536783f4eea62fb50341d0f8 (patch) | |
tree | 517f4a45fe5d91976af4e5f8d24ef1ee3fead844 | |
parent | d8fe5e6c92d0d190646fb9f1056741a229980089 (diff) |
parquet-tools: support Moto 5.x
This makes the test fixtures compatible with the new Moto API. Close #301032 Link: https://github.com/ktrueda/parquet-tools/issues/54 Link: https://github.com/ktrueda/parquet-tools/pull/55
-rw-r--r-- | pkgs/tools/misc/parquet-tools/default.nix | 6 | ||||
-rw-r--r-- | pkgs/tools/misc/parquet-tools/moto5.patch | 28 |
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/tools/misc/parquet-tools/default.nix b/pkgs/tools/misc/parquet-tools/default.nix index bd35304f3cf1d..cc5d25b1538af 100644 --- a/pkgs/tools/misc/parquet-tools/default.nix +++ b/pkgs/tools/misc/parquet-tools/default.nix @@ -18,6 +18,12 @@ buildPythonApplication rec { hash = "sha256-2jIwDsxB+g37zV9hLc2VNC5YuZXTpTmr2aQ72AeHYJo="; }; + patches = [ + # support Moto 5.x + # https://github.com/ktrueda/parquet-tools/pull/55 + ./moto5.patch + ]; + postPatch = '' substituteInPlace tests/test_inspect.py \ --replace "parquet-cpp-arrow version 5.0.0" "parquet-cpp-arrow version ${pyarrow.version}" \ diff --git a/pkgs/tools/misc/parquet-tools/moto5.patch b/pkgs/tools/misc/parquet-tools/moto5.patch new file mode 100644 index 0000000000000..5e79c1a204fcc --- /dev/null +++ b/pkgs/tools/misc/parquet-tools/moto5.patch @@ -0,0 +1,28 @@ +diff --git a/tests/fixtures/aws.py b/tests/fixtures/aws.py +index 7eea4bd..9fb3345 100644 +--- a/tests/fixtures/aws.py ++++ b/tests/fixtures/aws.py +@@ -1,15 +1,17 @@ + import boto3 +-from moto import mock_s3 + import pytest + ++try: ++ # Moto 4.x ++ from moto import mock_s3 ++except ImportError: ++ # Moto 5.x ++ from moto import mock_aws as mock_s3 + + @pytest.fixture + def aws_session(): +- mock_s3_server = mock_s3() +- mock_s3_server.start() +- yield boto3.Session() +- mock_s3_server.stop() +- ++ with mock_s3(): ++ yield boto3.Session() + + @pytest.fixture + def aws_s3_bucket(aws_session): |