Unverified Commit eb2be110 authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

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 <module>
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 <module>
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>
parent 4f78d856
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -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";