diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml new file mode 100644 index 000000000..56f868164 --- /dev/null +++ b/.github/workflows/check-license.yml @@ -0,0 +1,20 @@ +name: License Header Check + +on: + pull_request: + branches: + - develop + push: + branches: + - develop + +jobs: + check-license-header: + name: Check License Header + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: apache/skywalking-eyes/header@main + with: + mode: check diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 000000000..a6fb34d75 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,22 @@ +header: + license: + spdx-id: Apache-2.0 + copyright-owner: Amazon.com, Inc. or its affiliates. + content: | + Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + SPDX-License-Identifier: Apache-2.0 + + paths: + - '**/*.py' + + paths-ignore: + - '**/*.md' + - '**/*.java' + - 'LICENSE' + - 'NOTICE' + - '**/smithy_core/rfc3986.py' + + language: + Python: + extensions: + - ".py" diff --git a/packages/aws-sdk-signers/tests/__init__.py b/packages/aws-sdk-signers/tests/__init__.py index e69de29bb..04f8b7b76 100644 --- a/packages/aws-sdk-signers/tests/__init__.py +++ b/packages/aws-sdk-signers/tests/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-sdk-signers/tests/unit/__init__.py b/packages/aws-sdk-signers/tests/unit/__init__.py index e69de29bb..04f8b7b76 100644 --- a/packages/aws-sdk-signers/tests/unit/__init__.py +++ b/packages/aws-sdk-signers/tests/unit/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-sdk-signers/tests/unit/auth/__init__.py b/packages/aws-sdk-signers/tests/unit/auth/__init__.py index e69de29bb..04f8b7b76 100644 --- a/packages/aws-sdk-signers/tests/unit/auth/__init__.py +++ b/packages/aws-sdk-signers/tests/unit/auth/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-sdk-signers/tests/unit/auth/test_sigv4.py b/packages/aws-sdk-signers/tests/unit/auth/test_sigv4.py index 73ccfc366..a62f082ac 100644 --- a/packages/aws-sdk-signers/tests/unit/auth/test_sigv4.py +++ b/packages/aws-sdk-signers/tests/unit/auth/test_sigv4.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os import pathlib import re diff --git a/packages/aws-sdk-signers/tests/unit/test_identity.py b/packages/aws-sdk-signers/tests/unit/test_identity.py index f09c99dee..aacb2438d 100644 --- a/packages/aws-sdk-signers/tests/unit/test_identity.py +++ b/packages/aws-sdk-signers/tests/unit/test_identity.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from datetime import UTC, datetime, timedelta import pytest diff --git a/packages/smithy-aws-core/src/smithy_aws_core/aio/protocols.py b/packages/smithy-aws-core/src/smithy_aws_core/aio/protocols.py index ba0e8be8c..91e5edffa 100644 --- a/packages/smithy-aws-core/src/smithy_aws_core/aio/protocols.py +++ b/packages/smithy-aws-core/src/smithy_aws_core/aio/protocols.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Any, Final from smithy_core.codecs import Codec diff --git a/packages/smithy-aws-core/src/smithy_aws_core/interfaces/__init__.py b/packages/smithy-aws-core/src/smithy_aws_core/interfaces/__init__.py index e69de29bb..04f8b7b76 100644 --- a/packages/smithy-aws-core/src/smithy_aws_core/interfaces/__init__.py +++ b/packages/smithy-aws-core/src/smithy_aws_core/interfaces/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/smithy-aws-core/tests/unit/aio/__init__.py b/packages/smithy-aws-core/tests/unit/aio/__init__.py index e69de29bb..04f8b7b76 100644 --- a/packages/smithy-aws-core/tests/unit/aio/__init__.py +++ b/packages/smithy-aws-core/tests/unit/aio/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/exceptions.py b/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/exceptions.py index 1a8b5266d..e08cfff92 100644 --- a/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/exceptions.py +++ b/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/exceptions.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 """Binary Event Stream support for the application/vnd.amazon.eventstream format.""" from typing import Any diff --git a/packages/smithy-core/src/smithy_core/codecs.py b/packages/smithy-core/src/smithy_core/codecs.py index bb79fd535..3de41f52c 100644 --- a/packages/smithy-core/src/smithy_core/codecs.py +++ b/packages/smithy-core/src/smithy_core/codecs.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from io import BytesIO from typing import TYPE_CHECKING, Protocol, runtime_checkable diff --git a/packages/smithy-core/src/smithy_core/deserializers.py b/packages/smithy-core/src/smithy_core/deserializers.py index 4a9f9dc58..204197dee 100644 --- a/packages/smithy-core/src/smithy_core/deserializers.py +++ b/packages/smithy-core/src/smithy_core/deserializers.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import datetime from collections.abc import Callable from decimal import Decimal diff --git a/packages/smithy-core/src/smithy_core/documents.py b/packages/smithy-core/src/smithy_core/documents.py index 1c565fa9e..642e55277 100644 --- a/packages/smithy-core/src/smithy_core/documents.py +++ b/packages/smithy-core/src/smithy_core/documents.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import datetime from collections.abc import Callable, Iterator, Mapping, Sequence from contextlib import contextmanager diff --git a/packages/smithy-core/src/smithy_core/serializers.py b/packages/smithy-core/src/smithy_core/serializers.py index 8c4e20df6..3a0ad56eb 100644 --- a/packages/smithy-core/src/smithy_core/serializers.py +++ b/packages/smithy-core/src/smithy_core/serializers.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import datetime from abc import ABCMeta, abstractmethod from collections.abc import Callable, Iterator diff --git a/packages/smithy-core/src/smithy_core/shapes.py b/packages/smithy-core/src/smithy_core/shapes.py index 0f25383fe..dd162f0cd 100644 --- a/packages/smithy-core/src/smithy_core/shapes.py +++ b/packages/smithy-core/src/smithy_core/shapes.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from enum import Enum from typing import Self diff --git a/packages/smithy-core/tests/unit/test_documents.py b/packages/smithy-core/tests/unit/test_documents.py index 0b4ff052c..37fb48fed 100644 --- a/packages/smithy-core/tests/unit/test_documents.py +++ b/packages/smithy-core/tests/unit/test_documents.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 # pyright: reportPrivateUsage=false from dataclasses import dataclass, replace from datetime import datetime diff --git a/packages/smithy-core/tests/unit/test_schemas.py b/packages/smithy-core/tests/unit/test_schemas.py index b15fe472a..c6b835228 100644 --- a/packages/smithy-core/tests/unit/test_schemas.py +++ b/packages/smithy-core/tests/unit/test_schemas.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from dataclasses import replace from typing import Any diff --git a/packages/smithy-core/tests/unit/test_shapes.py b/packages/smithy-core/tests/unit/test_shapes.py index fd6f25117..bdc87931c 100644 --- a/packages/smithy-core/tests/unit/test_shapes.py +++ b/packages/smithy-core/tests/unit/test_shapes.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from smithy_core.exceptions import ExpectationNotMetError, SmithyError from smithy_core.shapes import ShapeID diff --git a/packages/smithy-core/tests/unit/test_type_registry.py b/packages/smithy-core/tests/unit/test_type_registry.py index 7375abaaa..a44303a83 100644 --- a/packages/smithy-core/tests/unit/test_type_registry.py +++ b/packages/smithy-core/tests/unit/test_type_registry.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from smithy_core.deserializers import DeserializeableShape, ShapeDeserializer from smithy_core.documents import Document, TypeRegistry diff --git a/packages/smithy-http/src/smithy_http/aio/protocols.py b/packages/smithy-http/src/smithy_http/aio/protocols.py index e842bec82..2c8ecfc1e 100644 --- a/packages/smithy-http/src/smithy_http/aio/protocols.py +++ b/packages/smithy-http/src/smithy_http/aio/protocols.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os from collections.abc import AsyncIterable from inspect import iscoroutinefunction diff --git a/packages/smithy-http/src/smithy_http/serializers.py b/packages/smithy-http/src/smithy_http/serializers.py index 577ce24f0..b7dcc516a 100644 --- a/packages/smithy-http/src/smithy_http/serializers.py +++ b/packages/smithy-http/src/smithy_http/serializers.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from asyncio import iscoroutinefunction from collections.abc import Callable, Iterator from contextlib import contextmanager diff --git a/packages/smithy-http/tests/unit/interceptors/test_user_agent.py b/packages/smithy-http/tests/unit/interceptors/test_user_agent.py index 6f73e887d..a43a515d1 100644 --- a/packages/smithy-http/tests/unit/interceptors/test_user_agent.py +++ b/packages/smithy-http/tests/unit/interceptors/test_user_agent.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import platform import smithy_core diff --git a/packages/smithy-http/tests/unit/test_user_agent.py b/packages/smithy-http/tests/unit/test_user_agent.py index 0e4ec3611..69b28df27 100644 --- a/packages/smithy-http/tests/unit/test_user_agent.py +++ b/packages/smithy-http/tests/unit/test_user_agent.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from smithy_http.user_agent import ( RawStringUserAgentComponent, diff --git a/packages/smithy-json/tests/unit/__init__.py b/packages/smithy-json/tests/unit/__init__.py index 34d1362ec..294dc5457 100644 --- a/packages/smithy-json/tests/unit/__init__.py +++ b/packages/smithy-json/tests/unit/__init__.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass from datetime import UTC, datetime from decimal import Decimal diff --git a/packages/smithy-json/tests/unit/test_deserializers.py b/packages/smithy-json/tests/unit/test_deserializers.py index f67e9c380..309a7feae 100644 --- a/packages/smithy-json/tests/unit/test_deserializers.py +++ b/packages/smithy-json/tests/unit/test_deserializers.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from datetime import datetime from decimal import Decimal from typing import Any diff --git a/packages/smithy-json/tests/unit/test_serializers.py b/packages/smithy-json/tests/unit/test_serializers.py index 1eb504b4f..552c23a0b 100644 --- a/packages/smithy-json/tests/unit/test_serializers.py +++ b/packages/smithy-json/tests/unit/test_serializers.py @@ -1,3 +1,5 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from datetime import datetime from decimal import Decimal from io import BytesIO