Date: Friday, November 25, 2022 @ 05:06:50 Author: yan12125 Revision: 1353738
upgpkg: python-aws-sam-translator 1.54.0-1; switch merged patch for jsonschema compatibility Added: python-aws-sam-translator/trunk/66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4.patch python-aws-sam-translator/trunk/74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb.patch Modified: python-aws-sam-translator/trunk/PKGBUILD Deleted: python-aws-sam-translator/trunk/python-aws-sam-translator-jsonschema-4.patch ------------------------------------------------+ 66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4.patch | 183 +++++++++++++++++++++++ 74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb.patch | 22 ++ PKGBUILD | 19 +- python-aws-sam-translator-jsonschema-4.patch | 34 ---- 4 files changed, 218 insertions(+), 40 deletions(-) Added: 66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4.patch =================================================================== --- 66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4.patch (rev 0) +++ 66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4.patch 2022-11-25 05:06:50 UTC (rev 1353738) @@ -0,0 +1,183 @@ +From 66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4 Mon Sep 17 00:00:00 2001 +From: jordanvance <[email protected]> +Date: Thu, 17 Nov 2022 16:14:17 -0500 +Subject: [PATCH] chore: flexible jsonschema version (#2511) + +Co-authored-by: Wing Fung Lau <[email protected]> +Co-authored-by: Jordan Vance <[email protected]> +Co-authored-by: Chris Rehn <[email protected]> +Co-authored-by: _sam <[email protected]> +--- + requirements/base.txt | 2 +- + .../api/error_definitionuri_jsonschema3.yaml | 87 +++++++++++++++++++ + .../output/api/error_definitionuri.json | 4 +- + .../api/error_definitionuri_jsonschema3.json | 10 +++ + tests/validator/test_validator_api.py | 9 +- + 5 files changed, 109 insertions(+), 3 deletions(-) + create mode 100644 tests/validator/input/api/error_definitionuri_jsonschema3.yaml + create mode 100644 tests/validator/output/api/error_definitionuri_jsonschema3.json + +diff --git a/requirements/base.txt b/requirements/base.txt +index 5a3e77e5d..b27568b4f 100755 +--- a/requirements/base.txt ++++ b/requirements/base.txt +@@ -1,2 +1,2 @@ + boto3>=1.19.5,==1.* +-jsonschema~=3.2 ++jsonschema<5,>=3.2 # TODO: evaluate risk of removing jsonschema 3.x support +diff --git a/tests/validator/input/api/error_definitionuri_jsonschema3.yaml b/tests/validator/input/api/error_definitionuri_jsonschema3.yaml +new file mode 100644 +index 000000000..c90913e64 +--- /dev/null ++++ b/tests/validator/input/api/error_definitionuri_jsonschema3.yaml +@@ -0,0 +1,87 @@ ++Transform: AWS::Serverless-2016-10-31 ++Resources: ++ # DefinitionUri is empty ++ ApiDefinitionUriEmpty: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ StageName: Stage name ++ ++ # DefinitionUri is not a string or an object ++ ApiDefinitionUriNotStringOrObject: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: 3 ++ StageName: Stage name ++ ++ # DefinitionUri Bucket missing ++ ApiDefinitionUriBucketMissing: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Key: mykey ++ StageName: Stage name ++ ++ # DefinitionUri Bucket empty ++ ApiDefinitionUriBucketEmpty: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Bucket: ++ Key: mykey ++ StageName: Stage name ++ ++ # DefinitionUri Bucket not string ++ ApiDefinitionUriBucketNotString: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Bucket: 3 ++ Key: mykey ++ StageName: Stage name ++ ++ # DefinitionUri Bucket not string ++ ApiDefinitionUriBucketNotIntrinsic: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Bucket: ++ Not: Intrinsic ++ Key: mykey ++ StageName: Stage name ++ ++ # DefinitionUri Key missing ++ ApiDefinitionUriKeyMissing: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Bucket: mybucket ++ StageName: Stage name ++ ++ # DefinitionUri Key empty ++ ApiDefinitionUriKeyEmpty: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Bucket: mybucket ++ Key: ++ StageName: Stage name ++ ++ # DefinitionUri Key not string ++ ApiDefinitionUriKeyNotString: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Bucket: mybucket ++ Key: 3 ++ StageName: Stage name ++ ++ # DefinitionUri Key not intrinsic ++ ApiDefinitionUriKeyNotStringIntrinsic: ++ Type: AWS::Serverless::Api ++ Properties: ++ DefinitionUri: ++ Bucket: mybucket ++ Key: ++ Not: Intrinsic ++ StageName: Stage name +diff --git a/tests/validator/output/api/error_definitionuri.json b/tests/validator/output/api/error_definitionuri.json +index b48aa412f..0c2e540fb 100644 +--- a/tests/validator/output/api/error_definitionuri.json ++++ b/tests/validator/output/api/error_definitionuri.json +@@ -3,8 +3,10 @@ + "[Resources.ApiDefinitionUriBucketMissing.Properties.DefinitionUri] 'Bucket' is a required property", + "[Resources.ApiDefinitionUriBucketNotIntrinsic.Properties.DefinitionUri.Bucket] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'", + "[Resources.ApiDefinitionUriBucketNotString.Properties.DefinitionUri.Bucket] 3 is not of type 'string', 'intrinsic'", ++ "[Resources.ApiDefinitionUriEmpty.Properties.DefinitionUri] Must not be empty", + "[Resources.ApiDefinitionUriKeyEmpty.Properties.DefinitionUri.Key] Must not be empty", + "[Resources.ApiDefinitionUriKeyMissing.Properties.DefinitionUri] 'Key' is a required property", + "[Resources.ApiDefinitionUriKeyNotString.Properties.DefinitionUri.Key] 3 is not of type 'string', 'intrinsic'", +- "[Resources.ApiDefinitionUriKeyNotStringIntrinsic.Properties.DefinitionUri.Key] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'" ++ "[Resources.ApiDefinitionUriKeyNotStringIntrinsic.Properties.DefinitionUri.Key] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'", ++ "[Resources.ApiDefinitionUriNotStringOrObject.Properties.DefinitionUri] 3 is not of type 'string', 'object'" + ] +diff --git a/tests/validator/output/api/error_definitionuri_jsonschema3.json b/tests/validator/output/api/error_definitionuri_jsonschema3.json +new file mode 100644 +index 000000000..b48aa412f +--- /dev/null ++++ b/tests/validator/output/api/error_definitionuri_jsonschema3.json +@@ -0,0 +1,10 @@ ++[ ++ "[Resources.ApiDefinitionUriBucketEmpty.Properties.DefinitionUri.Bucket] Must not be empty", ++ "[Resources.ApiDefinitionUriBucketMissing.Properties.DefinitionUri] 'Bucket' is a required property", ++ "[Resources.ApiDefinitionUriBucketNotIntrinsic.Properties.DefinitionUri.Bucket] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'", ++ "[Resources.ApiDefinitionUriBucketNotString.Properties.DefinitionUri.Bucket] 3 is not of type 'string', 'intrinsic'", ++ "[Resources.ApiDefinitionUriKeyEmpty.Properties.DefinitionUri.Key] Must not be empty", ++ "[Resources.ApiDefinitionUriKeyMissing.Properties.DefinitionUri] 'Key' is a required property", ++ "[Resources.ApiDefinitionUriKeyNotString.Properties.DefinitionUri.Key] 3 is not of type 'string', 'intrinsic'", ++ "[Resources.ApiDefinitionUriKeyNotStringIntrinsic.Properties.DefinitionUri.Key] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'" ++] +diff --git a/tests/validator/test_validator_api.py b/tests/validator/test_validator_api.py +index 35bf53de7..9dfd27088 100644 +--- a/tests/validator/test_validator_api.py ++++ b/tests/validator/test_validator_api.py +@@ -1,3 +1,4 @@ ++import jsonschema + import os.path + from parameterized import parameterized + import pytest +@@ -12,6 +13,12 @@ + + + class TestValidatorApi(TestValidatorBase): ++ ++ # jsonschema 4.* is more restrictive than 3, so we need a separate check ++ # See https://github.com/aws/serverless-application-model/issues/2426 ++ jsonschemaMajorVersion = int(jsonschema.__version__.split(".")[0]) ++ _error_definitionuri = "error_definitionuri" if jsonschemaMajorVersion > 3 else "error_definitionuri_jsonschema3" ++ + @parameterized.expand( + [ + "error_accesslogsetting", +@@ -27,7 +34,7 @@ class TestValidatorApi(TestValidatorBase): + "error_canarysetting", + "error_cors", + "error_definitionbody", +- "error_definitionuri", ++ _error_definitionuri, + "error_description", + "error_domain", + "error_endpointconfiguration", Added: 74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb.patch =================================================================== --- 74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb.patch (rev 0) +++ 74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb.patch 2022-11-25 05:06:50 UTC (rev 1353738) @@ -0,0 +1,22 @@ +From 74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb Mon Sep 17 00:00:00 2001 +From: _sam <[email protected]> +Date: Wed, 16 Nov 2022 10:53:02 -0800 +Subject: [PATCH] chore: Prevent bin/ from installed as a package (#2597) + +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 7c4fcd876..f99184d19 100755 +--- a/setup.py ++++ b/setup.py +@@ -59,7 +59,7 @@ def read_requirements(req="base.txt"): + license="Apache License 2.0", + # Exclude all but the code folders + packages=find_packages( +- exclude=("tests", "tests.*", "integration", "integration.*", "docs", "examples", "versions") ++ exclude=("bin", "bin.*", "tests", "tests.*", "integration", "integration.*", "docs", "examples", "versions") + ), + license_files=( + "LICENSE", Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-11-25 02:58:18 UTC (rev 1353737) +++ PKGBUILD 2022-11-25 05:06:50 UTC (rev 1353738) @@ -2,7 +2,7 @@ pkgname=python-aws-sam-translator # https://github.com/aws/serverless-application-model/releases -pkgver=1.53.0 +pkgver=1.54.0 pkgrel=1 pkgdesc='AWS Serverless Application Model (AWS SAM) prescribes rules for expressing Serverless applications on AWS' arch=(any) @@ -11,19 +11,26 @@ depends=(python python-botocore python-boto3 python-jsonschema) makedepends=(python-setuptools) # python-yaml is needed by samtranslator.yaml_helper, while the latter is used in tests only -checkdepends=(python-pytest python-yaml python-parameterized) +checkdepends=(python-pytest python-pytest-rerunfailures python-yaml python-parameterized) # Upstream intentionally exclude tests from sdist # https://github.com/aws/serverless-application-model/pull/381#issuecomment-382143094 source=("https://github.com/aws/serverless-application-model/archive/v$pkgver/$pkgname-$pkgver.tar.gz" - "$pkgname-jsonschema-4.patch") -sha256sums=('79b2117a14207c440ac1a8a5c48072038ea417dc0afe2e93e2c5ebbce8973d12' - '7bba093258d9d7768112463f9a6fbe63bb78e060081d9585637582caf0da1d20') + "66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4.patch" + "74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb.patch") +sha256sums=('bd637223e5e922950757d5026d7598d0da050e87a1c9685bdf53028e624467e2' + '650733dc475753f22ad96d664666ac3304eac595c99662649c39e8c8dd950a5b' + 'd7985de11acb845ea93b615765a8496277c1aaf63b437dd1e3cd53312677d9a4') prepare() { cd serverless-application-model-$pkgver # skip pytest-coverage sed -i -r 's#--cov\S*\s+\S+##g' pytest.ini - patch -Np1 -i ../$pkgname-jsonschema-4.patch + # For jsonschema 4.x. Backported from + # https://github.com/aws/serverless-application-model/pull/2511 + patch -Np1 -i ../66636f1d9c627bbb69cf1e3c2e7f571eb4dbc2d4.patch + # A regression fix - prevent bin/ from installed as a package + # Backported from https://github.com/aws/serverless-application-model/pull/2597 + patch -Np1 -i ../74cc6eb7881be7b9cb5d9fdd90e6d7e30d4639fb.patch } build() { Deleted: python-aws-sam-translator-jsonschema-4.patch =================================================================== --- python-aws-sam-translator-jsonschema-4.patch 2022-11-25 02:58:18 UTC (rev 1353737) +++ python-aws-sam-translator-jsonschema-4.patch 2022-11-25 05:06:50 UTC (rev 1353738) @@ -1,34 +0,0 @@ -From e847f1723f50bf79369e0a27773018b04fac28a3 Mon Sep 17 00:00:00 2001 -From: Wing Fung Lau <[email protected]> -Date: Wed, 6 Jul 2022 19:33:29 -0700 -Subject: [PATCH] Bump jsonschema version - ---- - requirements/base.txt | 2 +- - tests/validator/output/api/error_definitionuri.json | 4 +++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/requirements/base.txt b/requirements/base.txt -index 5a3e77e5d..25cd84cb9 100755 ---- a/requirements/base.txt -+++ b/requirements/base.txt -@@ -1,2 +1,2 @@ - boto3>=1.19.5,==1.* --jsonschema~=3.2 -+jsonschema~=4.6 -diff --git a/tests/validator/output/api/error_definitionuri.json b/tests/validator/output/api/error_definitionuri.json -index bc3756e1a..f6adbb76a 100644 ---- a/tests/validator/output/api/error_definitionuri.json -+++ b/tests/validator/output/api/error_definitionuri.json -@@ -3,7 +3,9 @@ - "[Resources.ApiDefinitionUriBucketMissing.Properties.DefinitionUri] 'Bucket' is a required property", - "[Resources.ApiDefinitionUriBucketNotIntrinsic.Properties.DefinitionUri.Bucket] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'", - "[Resources.ApiDefinitionUriBucketNotString.Properties.DefinitionUri.Bucket] 3 is not of type 'string', 'intrinsic'", -+ "[Resources.ApiDefinitionUriEmpty.Properties.DefinitionUri] Must not be empty", - "[Resources.ApiDefinitionUriKeyEmpty.Properties.DefinitionUri.Key] Must not be empty", - "[Resources.ApiDefinitionUriKeyMissing.Properties.DefinitionUri] 'Key' is a required property", -- "[Resources.ApiDefinitionUriKeyNotString.Properties.DefinitionUri.Key] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'" -+ "[Resources.ApiDefinitionUriKeyNotString.Properties.DefinitionUri.Key] {'Not': 'Intrinsic'} is not of type 'string', 'intrinsic'", -+ "[Resources.ApiDefinitionUriNotStringOrObject.Properties.DefinitionUri] 3 is not of type 'string', 'object'" - ] -\ No newline at end of file
