Unverified Commit 986588b4 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

Merge pull request #262785 from mweinelt/moto

python311Packages.py-partiql-parser: 0.3.8 -> 0.4.0; python311Packages.moto: 4.2.2 -> 4.2.6; python311Packages.python-jose: refactor, expose extras
parents 5f037625 f374142e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ buildPythonPackage rec {
    python-jose
    trio
    sqlalchemy
  ] ++ passthru.optional-dependencies.all;
  ] ++ passthru.optional-dependencies.all
  ++ python-jose.optional-dependencies.cryptography;

  pytestFlagsArray = [
    # ignoring deprecation warnings to avoid test failure from
+73 −95
Original line number Diff line number Diff line
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder

# build
# build-system
, setuptools

# runtime
, aws-xray-sdk
# dependencies
, boto3
, botocore
, cfn-lint
, cryptography
, jinja2
, python-dateutil
, requests
, responses
, werkzeug
, xmltodict

# optional-dependencies
, aws-xray-sdk
, cfn-lint
, docker
, ecdsa
, flask
, flask-cors
, graphql-core
, idna
, jinja2
, jsondiff
, multipart
, openapi-spec-validator
, py-partiql-parser
, pyparsing
, python-dateutil
, python-jose
, pyyaml
, requests
, responses
, sshpubkeys
, werkzeug
, xmltodict

# tests
, freezegun
, py-partiql-parser
, pytestCheckHook
, pytest-xdist
, sure
}:

buildPythonPackage rec {
  pname = "moto";
  version = "4.2.2";
  format = "pyproject";
  version = "4.2.6";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-7jTEw/U5ANlTGAlGkgyduhJ6SD4u1A5tv5PUri52Dnw=";
    hash = "sha256-zgpV1+dWxZpaQ5LHCXqlylPgCqLdP3AACTNWvhXnrvk=";
  };

  nativeBuildInputs = [
@@ -56,114 +57,91 @@ buildPythonPackage rec {
  ];

  propagatedBuildInputs = [
    aws-xray-sdk
    boto3
    botocore
    cfn-lint
    cryptography
    requests
    xmltodict
    werkzeug
    python-dateutil
    responses
    jinja2
  ];

  passthru.optional-dependencies = {
    # non-exhaustive list of extras, that was cobbled together for testing
    all = [
      aws-xray-sdk
      cfn-lint
      docker
      ecdsa
      flask
      flask-cors
      graphql-core
    idna
    jinja2
      jsondiff
      multipart
      openapi-spec-validator
      py-partiql-parser
      pyparsing
    python-dateutil
      python-jose
      pyyaml
    requests
    responses
      setuptools
      sshpubkeys
    werkzeug
    xmltodict
  ];
    ] ++ python-jose.optional-dependencies.cryptography;
  };

  __darwinAllowLocalNetworking = true;

  nativeCheckInputs = [
    freezegun
    py-partiql-parser
    pytestCheckHook
    sure
  ];
    pytest-xdist
  ] ++ passthru.optional-dependencies.all;

  pytestFlagsArray = [
    # Disable tests that try to access the network
    "--deselect=tests/test_cloudformation/test_cloudformation_custom_resources.py::test_create_custom_lambda_resource__verify_cfnresponse_failed"
    "--deselect=tests/test_cloudformation/test_server.py::test_cloudformation_server_get"
    "--deselect=tests/test_core/test_decorator_calls.py::test_context_manager"
    "--deselect=tests/test_core/test_decorator_calls.py::test_decorator_start_and_stop"
    "--deselect=tests/test_core/test_request_mocking.py::test_passthrough_requests"
    "--deselect=tests/test_firehose/test_firehose_put.py::test_put_record_batch_http_destination"
    "--deselect=tests/test_firehose/test_firehose_put.py::test_put_record_http_destination"
    "--deselect=tests/test_logs/test_integration.py::test_put_subscription_filter_with_lambda"
    "--deselect=tests/test_sqs/test_integration.py::test_invoke_function_from_sqs_exception"
    "--deselect=tests/test_sqs/test_sqs_integration.py::test_invoke_function_from_sqs_exception"
    "--deselect=tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_creation_fails_with_invalid_names"
    "--deselect=tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_list_executions_with_pagination"
    "--deselect=tests/test_iotdata/test_iotdata.py::test_update"
    "--deselect=tests/test_iotdata/test_iotdata.py::test_basic"
    "--deselect=tests/test_iotdata/test_iotdata.py::test_delete_field_from_device_shadow"
    "--deselect=tests/test_iotdata/test_iotdata.py::test_publish"
    "--deselect=tests/test_moto_api/recorder/test_recorder.py::TestRecorder::test_s3_upload_data"
    "--deselect=tests/test_moto_api/recorder/test_recorder.py::TestRecorder::test_s3_upload_file_using_requests"
    "-m" "'not network and not requires_docker'"

    # Fails at local name resolution
    "--deselect=tests/test_s3/test_multiple_accounts_server.py::TestAccountIdResolution::test_with_custom_request_header"
    "--deselect=tests/test_s3/test_s3.py::test_presigned_put_url_with_approved_headers"
    "--deselect=tests/test_s3/test_s3.py::test_presigned_put_url_with_custom_headers"
    "--deselect=tests/test_s3/test_s3.py::test_put_chunked_with_v4_signature_in_body"
    "--deselect=tests/test_s3/test_s3.py::test_upload_from_file_to_presigned_url"
    "--deselect=tests/test_s3/test_server.py::test_s3_server_bucket_versioning"
    "--deselect=tests/test_s3/test_server.py::test_s3_server_post_cors_multiple_origins"

    # Disable tests that require docker daemon
    "--deselect=tests/test_core/test_docker.py::test_docker_is_running_and_available"
    "--deselect=tests/test_events/test_events_lambdatriggers_integration.py::test_creating_bucket__invokes_lambda"
    "--deselect=tests/test_s3/test_s3_lambda_integration.py::test_objectcreated_put__invokes_lambda"
    "--deselect=tests/test_sqs/test_sqs_integration.py"

    # json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    "--deselect=tests/test_cloudformation/test_cloudformation_stack_integration.py::test_lambda_function"
    # Fails at resolving google.com
    "--deselect=tests/test_firehose/test_firehose_put.py::test_put_record_http_destination"
    "--deselect=tests/test_firehose/test_firehose_put.py::test_put_record_batch_http_destination"

    # AssertionError: CloudWatch log event was not found.
    "--deselect=tests/test_logs/test_integration.py::test_subscription_filter_applies_to_new_streams"
    # Download recordings returns faulty JSON
    "--deselect=tests/test_moto_api/recorder/test_recorder.py::TestRecorder::test_ec2_instance_creation_recording_on"
    "--deselect=tests/test_moto_api/recorder/test_recorder.py::TestRecorder::test_ec2_instance_creation__recording_off"

    # KeyError: 'global'
    "--deselect=tests/test_iotdata/test_server.py::test_iotdata_list"
    "--deselect=tests/test_iotdata/test_server.py::test_publish"
    # Connection Reset by Peer, when connecting to localhost:5678
    "--deselect=tests/test_moto_api/recorder/test_recorder.py::TestRecorder::test_replay"

    # Blocks test execution
    "--deselect=tests/test_utilities/test_threaded_server.py::TestThreadedMotoServer::test_load_data_from_inmemory_client"
  ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
    "--deselect=tests/test_utilities/test_threaded_server.py::test_threaded_moto_server__different_port"
    "--deselect=tests/test_utilities/test_threaded_server.py::TestThreadedMotoServer::test_server_can_handle_multiple_services"
    "--deselect=tests/test_utilities/test_threaded_server.py::TestThreadedMotoServer::test_server_is_reachable"
    # Requires docker, but isn't marked
    # https://github.com/getmoto/moto/pull/6938
    "--deselect=tests/test_awslambda/test_lambda_layers_invoked.py::test_invoke_local_lambda_layers"

    # AssertionError: expected `{0}` to be greater than `{1}`
    # Racy, expects two timestamp two differ
    # https://github.com/getmoto/moto/issues/6946
    "--deselect=tests/test_databrew/test_databrew_recipes.py::test_publish_recipe"
  ];

  disabledTestPaths = [
    # xml.parsers.expat.ExpatError: out of memory: line 1, column 0
    "tests/test_sts/test_sts.py"
    # Requires pytest-ordering, which is unmaintained
    # https://github.com/getmoto/moto/issues/6937
    # botocore.exceptions.NoCredentialsError: Unable to locate credentials
    "tests/test_dynamodb/test_dynamodb_statements.py"
    "tests/test_lakeformation/test_resource_tags_integration.py"
    "tests/test_redshiftdata/test_redshiftdata.py"
    "tests/test_s3/test_s3_file_handles.py"
    "tests/test_s3/test_s3.py"
    "tests/test_s3/test_s3_select.py"

    # Tries to access the network
    "tests/test_appsync/test_appsync_schema.py"
    "tests/test_awslambda/test_lambda_eventsourcemapping.py"
    "tests/test_awslambda/test_lambda_invoke.py"
    "tests/test_batch/test_batch_jobs.py"
    "tests/test_kinesis/test_kinesis.py"
    "tests/test_kinesis/test_kinesis_stream_consumers.py"
  ];

  disabledTests = [
    # only appears in aarch64 currently, but best to be safe
    "test_state_machine_list_executions_with_filter"
    # tests fail with 404 after Werkzeug 2.2 upgrade, see https://github.com/spulec/moto/issues/5341#issuecomment-1206995825
    "test_appsync_list_tags_for_resource"
    "test_s3_server_post_to_bucket_redirect"
    # Threading tests regularly blocks test execution
    "tests/test_utilities/test_threaded_server.py"
    "tests/test_s3/test_s3_bucket_policy.py"
  ];

  meta = with lib; {
+2 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@

buildPythonPackage rec {
  pname = "py-partiql-parser";
  version = "0.3.8";
  version = "0.4.0";
  pyproject = true;

  disabled = pythonOlder "3.7";
@@ -18,7 +18,7 @@ buildPythonPackage rec {
    owner = "getmoto";
    repo = "py-partiql-parser";
    rev = "refs/tags/${version}";
    hash = "sha256-uIO06RRuUuE9qCEg/tTcn68i7vaFAAeFhxdxW9WAbuw=";
    hash = "sha256-gxoBc7PjS4EQix38VNX6u9cwy4FCjENcUN1euOJJLCo=";
  };

  nativeBuildInputs = [
+39 −13
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub

# build-system
, setuptools

# dependencies
, ecdsa
, rsa
, pycrypto
, pyasn1
, pycryptodome

# optional-dependencies
, cryptography
, pycrypto
, pycryptodome

# tests
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "python-jose";
  version = "3.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "mpdavis";
@@ -21,27 +31,43 @@ buildPythonPackage rec {
    hash = "sha256-6VGC6M5oyGCOiXcYp6mpyhL+JlcYZKIqOQU9Sm/TkKM=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace '"pytest-runner",' ""
  '';

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    cryptography
    ecdsa
    pyasn1
    pycrypto
    pycryptodome
    rsa
  ];

  nativeCheckInputs = [
    pytestCheckHook
  passthru.optional-dependencies = {
    cryptography = [
      cryptography
    ];
    pycrypto = [
      pycrypto
    ];
    pycryptodome = [
      pycryptodome
    ];
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace '"pytest-runner",' ""
  '';
  pythonImportsCheck = [
    "jose"
  ];

  pythonImportsCheck = [ "jose" ];
  nativeCheckInputs = [
    pytestCheckHook
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  meta = with lib; {
    changelog = "https://github.com/mpdavis/python-jose/releases/tag/${version}";
    homepage = "https://github.com/mpdavis/python-jose";
    description = "A JOSE implementation in Python";
    license = licenses.mit;