From eb2be1102c5fda9670f72f1a99bceba26ad6aabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 13 Feb 2024 00:21:33 +0100 Subject: [PATCH] python312Packages.aws-sam-translator: don't fail when pytest/pluggy, skip slow tests eg: python3.12-aws-sam-translator> File "/nix/store/jzba2jjz0l3222pry5mf6nyflbwgpd32-python3.12-python-dateutil-2.8.2/lib/python3.12/site-packages/dateutil/tz/__init__.py", line 2, in python3.12-aws-sam-translator> from .tz import * python3.12-aws-sam-translator> File "/nix/store/jzba2jjz0l3222pry5mf6nyflbwgpd32-python3.12-python-dateutil-2.8.2/lib/python3.12/site-packages/dateutil/tz/tz.py", line 37, in python3.12-aws-sam-translator> EPOCH = datetime.datetime.utcfromtimestamp(0) python3.12-aws-sam-translator> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ python3.12-aws-sam-translator> DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). python3.12-aws-sam-translator> --- .../aws-sam-translator/default.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/aws-sam-translator/default.nix b/pkgs/development/python-modules/aws-sam-translator/default.nix index 12e0a8803552..9fad12faaac4 100644 --- a/pkgs/development/python-modules/aws-sam-translator/default.nix +++ b/pkgs/development/python-modules/aws-sam-translator/default.nix @@ -29,8 +29,8 @@ buildPythonPackage rec { }; postPatch = '' - substituteInPlace pytest.ini \ - --replace " --cov samtranslator --cov-report term-missing --cov-fail-under 95" "" + # don't try to use --cov or fail on new warnings + rm pytest.ini ''; propagatedBuildInputs = [ @@ -49,14 +49,15 @@ buildPythonPackage rec { pyyaml ]; - pythonImportsCheck = [ - "samtranslator" - ]; - preCheck = '' - sed -i '2ienv =\n\tAWS_DEFAULT_REGION=us-east-1' pytest.ini + export AWS_DEFAULT_REGION=us-east-1 ''; + pytestFlagsArray = [ + "tests" + ''-m "not slow"'' + ]; + disabledTests = [ # urllib3 2.0 compat "test_plugin_accepts_different_sar_client" @@ -79,6 +80,10 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; + pythonImportsCheck = [ + "samtranslator" + ]; + meta = with lib; { description = "Python library to transform SAM templates into AWS CloudFormation templates"; homepage = "https://github.com/aws/serverless-application-model";