diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/alternator/__init__.py b/alternator/__init__.py index 2cf21a1..a41759c 100644 --- a/alternator/__init__.py +++ b/alternator/__init__.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Alternator Load Balancing Client for Python. diff --git a/alternator/_constants.py b/alternator/_constants.py index 28c93f3..6adf1bb 100644 --- a/alternator/_constants.py +++ b/alternator/_constants.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Shared constants for Alternator client modules.""" # Attribute names used to store manager and pk_cache references on boto3 clients diff --git a/alternator/_http.py b/alternator/_http.py index d7cdbca..d722165 100644 --- a/alternator/_http.py +++ b/alternator/_http.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """HTTP client helpers for node discovery.""" from __future__ import annotations diff --git a/alternator/_version.py b/alternator/_version.py index b66edad..98a8479 100644 --- a/alternator/_version.py +++ b/alternator/_version.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Version information for alternator.""" __version__ = "1.0.0" diff --git a/alternator/async_client.py b/alternator/async_client.py index dc1541c..8afc347 100644 --- a/alternator/async_client.py +++ b/alternator/async_client.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Asynchronous client factory for Alternator load balancing.""" from __future__ import annotations diff --git a/alternator/client.py b/alternator/client.py index 385581d..7012fbb 100644 --- a/alternator/client.py +++ b/alternator/client.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Synchronous client factory for Alternator load balancing.""" from __future__ import annotations diff --git a/alternator/config.py b/alternator/config.py index fc98a8a..7d753cd 100644 --- a/alternator/config.py +++ b/alternator/config.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Configuration classes for Alternator load balancing client.""" from __future__ import annotations diff --git a/alternator/core/__init__.py b/alternator/core/__init__.py index ea22462..9e46094 100644 --- a/alternator/core/__init__.py +++ b/alternator/core/__init__.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Core modules for Alternator load balancing.""" from alternator.core.live_nodes import ( diff --git a/alternator/core/auth.py b/alternator/core/auth.py index 8aa5614..6084f58 100644 --- a/alternator/core/auth.py +++ b/alternator/core/auth.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Authentication helpers for Alternator boto clients.""" from __future__ import annotations diff --git a/alternator/core/compression.py b/alternator/core/compression.py index f4205d4..9c48345 100644 --- a/alternator/core/compression.py +++ b/alternator/core/compression.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Request body compression for bandwidth optimization.""" from __future__ import annotations diff --git a/alternator/core/deterministic_rand.py b/alternator/core/deterministic_rand.py index fba15c7..1259c21 100644 --- a/alternator/core/deterministic_rand.py +++ b/alternator/core/deterministic_rand.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Deterministic PRNG for request-scoped node ordering. The generator uses the project's stable lagged-Fibonacci sequence so clients diff --git a/alternator/core/handlers.py b/alternator/core/handlers.py index 500166f..be7380c 100644 --- a/alternator/core/handlers.py +++ b/alternator/core/handlers.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Shared event handlers for Alternator clients.""" from __future__ import annotations diff --git a/alternator/core/hashing.py b/alternator/core/hashing.py index 7225d49..f18bce2 100644 --- a/alternator/core/hashing.py +++ b/alternator/core/hashing.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ MurmurHash3 x64 128-bit implementation for cross-language compatibility. diff --git a/alternator/core/headers.py b/alternator/core/headers.py index 40b8578..d16b221 100644 --- a/alternator/core/headers.py +++ b/alternator/core/headers.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Request header filtering for bandwidth optimization.""" from __future__ import annotations diff --git a/alternator/core/key_affinity.py b/alternator/core/key_affinity.py index b5303fd..e90445c 100644 --- a/alternator/core/key_affinity.py +++ b/alternator/core/key_affinity.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Key route affinity for LWT-optimized routing.""" from __future__ import annotations diff --git a/alternator/core/live_nodes.py b/alternator/core/live_nodes.py index 74dace3..89d7db2 100644 --- a/alternator/core/live_nodes.py +++ b/alternator/core/live_nodes.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Live nodes management and selection for Alternator load balancing.""" from __future__ import annotations diff --git a/alternator/core/query_plan.py b/alternator/core/query_plan.py index b8bb29d..412a2e5 100644 --- a/alternator/core/query_plan.py +++ b/alternator/core/query_plan.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Lazy query plan for request-scoped node routing.""" from __future__ import annotations diff --git a/alternator/core/request.py b/alternator/core/request.py index 9a598dc..b98a957 100644 --- a/alternator/core/request.py +++ b/alternator/core/request.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Request parsing utilities for Alternator client.""" from __future__ import annotations diff --git a/alternator/core/routing_scope.py b/alternator/core/routing_scope.py index c2a241d..2260e67 100644 --- a/alternator/core/routing_scope.py +++ b/alternator/core/routing_scope.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Routing scope classes for topology-aware request routing.""" from __future__ import annotations diff --git a/alternator/core/tls.py b/alternator/core/tls.py index 1406a5e..09a6d07 100644 --- a/alternator/core/tls.py +++ b/alternator/core/tls.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """TLS configuration utilities.""" from __future__ import annotations diff --git a/alternator/exceptions.py b/alternator/exceptions.py index 4884f4a..49a6bb7 100644 --- a/alternator/exceptions.py +++ b/alternator/exceptions.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Custom exceptions for Alternator load balancing client.""" from __future__ import annotations diff --git a/alternator/vector.py b/alternator/vector.py index 7574e15..3034189 100644 --- a/alternator/vector.py +++ b/alternator/vector.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Vector search support for ScyllaDB Alternator. This module provides the :class:`Vector` type and the diff --git a/examples/async_demo.py b/examples/async_demo.py index 7171302..a1f35d4 100644 --- a/examples/async_demo.py +++ b/examples/async_demo.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Asynchronous usage demo for Alternator load balancing client. diff --git a/examples/capability_configuration.py b/examples/capability_configuration.py index 35b3cee..31a3092 100644 --- a/examples/capability_configuration.py +++ b/examples/capability_configuration.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Configuration recipes for advanced Alternator client capabilities. diff --git a/examples/compare_aws_sdk.py b/examples/compare_aws_sdk.py index 166031d..73b548b 100644 --- a/examples/compare_aws_sdk.py +++ b/examples/compare_aws_sdk.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Compare an Alternator client with a regular AWS SDK DynamoDB client. diff --git a/examples/sync_demo.py b/examples/sync_demo.py index a45de46..6b11c67 100644 --- a/examples/sync_demo.py +++ b/examples/sync_demo.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Basic synchronous usage demo for Alternator load balancing client. diff --git a/pyproject.toml b/pyproject.toml index 203522f..a0b4b0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ dev = [ "pytest-timeout>=2.0", "hypothesis>=6.0", "mypy>=1.0", - "ruff>=0.1.0", + "ruff>=0.16.0", "types-aiobotocore[dynamodb]>=2.5.0", "boto3-stubs[dynamodb]>=1.28.0", ] @@ -98,6 +98,7 @@ select = [ "I", # isort "B", # flake8-bugbear "C4", # flake8-comprehensions + "CPY", # flake8-copyright "UP", # pyupgrade "ARG", # flake8-unused-arguments "SIM", # flake8-simplify @@ -117,6 +118,9 @@ ignore = [ [tool.ruff.lint.isort] known-first-party = ["alternator"] +[tool.ruff.lint.flake8-copyright] +notice-rgx = "(?i)Copyright ScyllaDB, Inc\\." + [tool.pytest.ini_options] testpaths = ["tests"] asyncio_mode = "auto" diff --git a/tests/__init__.py b/tests/__init__.py index 31562e1..9e49932 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1,15 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for alternator package.""" diff --git a/tests/conftest.py b/tests/conftest.py index cbee961..44d78f4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Shared pytest fixtures and configuration.""" from __future__ import annotations diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 3f81139..c4c0101 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for alternator package.""" import os diff --git a/tests/integration/scylla_version.py b/tests/integration/scylla_version.py index 0a6c4c1..a01763c 100644 --- a/tests/integration/scylla_version.py +++ b/tests/integration/scylla_version.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ScyllaDB version detection for integration tests. This module provides utilities to detect the running ScyllaDB version diff --git a/tests/integration/test_async_client.py b/tests/integration/test_async_client.py index a807fc3..e16bd7a 100644 --- a/tests/integration/test_async_client.py +++ b/tests/integration/test_async_client.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for asynchronous client. These tests require a running Scylla cluster with Alternator enabled. diff --git a/tests/integration/test_batch_transactions.py b/tests/integration/test_batch_transactions.py index d94cc84..87f8056 100644 --- a/tests/integration/test_batch_transactions.py +++ b/tests/integration/test_batch_transactions.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for batch operations. These tests require a running Scylla cluster with Alternator enabled. diff --git a/tests/integration/test_composite_keys.py b/tests/integration/test_composite_keys.py index 247b76d..26f6ec5 100644 --- a/tests/integration/test_composite_keys.py +++ b/tests/integration/test_composite_keys.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for tables with composite keys (HASH + RANGE). These tests require a running Scylla cluster with Alternator enabled. diff --git a/tests/integration/test_connection_reuse.py b/tests/integration/test_connection_reuse.py index 3578588..1cf348b 100644 --- a/tests/integration/test_connection_reuse.py +++ b/tests/integration/test_connection_reuse.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for HTTP/HTTPS connection reuse and pooling. These tests verify that the client properly reuses TCP connections for both diff --git a/tests/integration/test_header_optimization.py b/tests/integration/test_header_optimization.py index 7b2552d..7c87384 100644 --- a/tests/integration/test_header_optimization.py +++ b/tests/integration/test_header_optimization.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for prepared-request header filtering.""" from __future__ import annotations diff --git a/tests/integration/test_key_affinity_operations.py b/tests/integration/test_key_affinity_operations.py index 21a5498..36b36a2 100644 --- a/tests/integration/test_key_affinity_operations.py +++ b/tests/integration/test_key_affinity_operations.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for per-operation-type key affinity routing. Tests verify that key affinity works correctly for each DynamoDB operation type diff --git a/tests/integration/test_live_nodes.py b/tests/integration/test_live_nodes.py index 46c60d8..71979b6 100644 --- a/tests/integration/test_live_nodes.py +++ b/tests/integration/test_live_nodes.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for live-node discovery through public helpers.""" from __future__ import annotations diff --git a/tests/integration/test_node_health.py b/tests/integration/test_node_health.py index 4d1a59a..75b46e7 100644 --- a/tests/integration/test_node_health.py +++ b/tests/integration/test_node_health.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for node health tracking behavior. Tests verify node discovery, node list refresh, and behavior when nodes diff --git a/tests/integration/test_request_compression.py b/tests/integration/test_request_compression.py index 89ce879..f83a144 100644 --- a/tests/integration/test_request_compression.py +++ b/tests/integration/test_request_compression.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for request compression on prepared requests.""" from __future__ import annotations diff --git a/tests/integration/test_response_compression.py b/tests/integration/test_response_compression.py index e2e7938..a994c42 100644 --- a/tests/integration/test_response_compression.py +++ b/tests/integration/test_response_compression.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for HTTP response compression.""" from __future__ import annotations diff --git a/tests/integration/test_sdk_config.py b/tests/integration/test_sdk_config.py index 36be532..17aa6fb 100644 --- a/tests/integration/test_sdk_config.py +++ b/tests/integration/test_sdk_config.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for SDK client configuration propagation.""" from __future__ import annotations diff --git a/tests/integration/test_sync_client.py b/tests/integration/test_sync_client.py index 4f4bf01..456a995 100644 --- a/tests/integration/test_sync_client.py +++ b/tests/integration/test_sync_client.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for synchronous client. These tests require a running Scylla cluster with Alternator enabled. diff --git a/tests/integration/test_tls.py b/tests/integration/test_tls.py index 4a72e13..992de47 100644 --- a/tests/integration/test_tls.py +++ b/tests/integration/test_tls.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for TLS configuration. Tests TLS session caching for both ALN (node discovery) and DynamoDB API requests, diff --git a/tests/integration/test_vector.py b/tests/integration/test_vector.py index 4589130..63ff708 100644 --- a/tests/integration/test_vector.py +++ b/tests/integration/test_vector.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for vector search support. These tests require a running ScyllaDB cluster with Alternator and vector diff --git a/tests/integration/test_wrong_dc_rack.py b/tests/integration/test_wrong_dc_rack.py index 9681eff..d57e062 100644 --- a/tests/integration/test_wrong_dc_rack.py +++ b/tests/integration/test_wrong_dc_rack.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Integration tests for wrong DC/rack error handling and fallback. These tests verify that the client gracefully handles incorrect datacenter diff --git a/tests/integration/wire_capture.py b/tests/integration/wire_capture.py index 88f3d7a..3f2dac1 100644 --- a/tests/integration/wire_capture.py +++ b/tests/integration/wire_capture.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Helpers for inspecting botocore requests immediately before transport send.""" from __future__ import annotations diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index e69de29..6566043 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -0,0 +1,13 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/unit/test_async_manager.py b/tests/unit/test_async_manager.py index 80bb1fa..7520b14 100644 --- a/tests/unit/test_async_manager.py +++ b/tests/unit/test_async_manager.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for AsyncLiveNodesManager and AsyncPartitionKeyCache.""" import asyncio diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py index 370da5e..4f285d1 100644 --- a/tests/unit/test_auth.py +++ b/tests/unit/test_auth.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for explicit Alternator auth configuration.""" import pytest diff --git a/tests/unit/test_boto_config.py b/tests/unit/test_boto_config.py index 769f0b0..71c8eb0 100644 --- a/tests/unit/test_boto_config.py +++ b/tests/unit/test_boto_config.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for internal BotoConfig creation.""" import contextlib diff --git a/tests/unit/test_client_alias.py b/tests/unit/test_client_alias.py index f116a08..cf81632 100644 --- a/tests/unit/test_client_alias.py +++ b/tests/unit/test_client_alias.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for top-level client convenience alias.""" import pytest diff --git a/tests/unit/test_compression.py b/tests/unit/test_compression.py index 189da47..09e55c4 100644 --- a/tests/unit/test_compression.py +++ b/tests/unit/test_compression.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for request body compression.""" import gzip diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index d0d736f..fc98a96 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for configuration classes.""" from pathlib import Path diff --git a/tests/unit/test_deterministic_rand.py b/tests/unit/test_deterministic_rand.py index fd4cce3..addd1cf 100644 --- a/tests/unit/test_deterministic_rand.py +++ b/tests/unit/test_deterministic_rand.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for deterministic query-plan PRNG.""" from __future__ import annotations diff --git a/tests/unit/test_fake_alternator_server.py b/tests/unit/test_fake_alternator_server.py index 53899d2..085507d 100644 --- a/tests/unit/test_fake_alternator_server.py +++ b/tests/unit/test_fake_alternator_server.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for the fake Alternator HTTP server fixture.""" from alternator._http import create_sync_http_fetcher diff --git a/tests/unit/test_hashing.py b/tests/unit/test_hashing.py index a9dd27b..0329fd2 100644 --- a/tests/unit/test_hashing.py +++ b/tests/unit/test_hashing.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for MurmurHash3 implementation and hash vectors.""" import pytest diff --git a/tests/unit/test_hashing_properties.py b/tests/unit/test_hashing_properties.py index b325935..eb8f7fc 100644 --- a/tests/unit/test_hashing_properties.py +++ b/tests/unit/test_hashing_properties.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Property-based tests for hash distribution verification.""" from hypothesis import given, settings diff --git a/tests/unit/test_headers.py b/tests/unit/test_headers.py index d7bfff7..6101d54 100644 --- a/tests/unit/test_headers.py +++ b/tests/unit/test_headers.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for header filtering functionality.""" from collections.abc import Callable diff --git a/tests/unit/test_helper.py b/tests/unit/test_helper.py index cbe0830..2caf0bb 100644 --- a/tests/unit/test_helper.py +++ b/tests/unit/test_helper.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for public Helper facades.""" from __future__ import annotations diff --git a/tests/unit/test_http.py b/tests/unit/test_http.py index 3cd4083..c53e285 100644 --- a/tests/unit/test_http.py +++ b/tests/unit/test_http.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for HTTP fetcher and SSL context creation.""" import json diff --git a/tests/unit/test_key_affinity.py b/tests/unit/test_key_affinity.py index ab1bf48..fff9376 100644 --- a/tests/unit/test_key_affinity.py +++ b/tests/unit/test_key_affinity.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for key route affinity module.""" import contextlib diff --git a/tests/unit/test_live_nodes.py b/tests/unit/test_live_nodes.py index 15318f7..e6460af 100644 --- a/tests/unit/test_live_nodes.py +++ b/tests/unit/test_live_nodes.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for live nodes management and selection.""" import threading diff --git a/tests/unit/test_network_failures.py b/tests/unit/test_network_failures.py index 1260115..89db198 100644 --- a/tests/unit/test_network_failures.py +++ b/tests/unit/test_network_failures.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for network failure scenarios.""" from __future__ import annotations diff --git a/tests/unit/test_query_plan.py b/tests/unit/test_query_plan.py index fed0beb..bd1fb95 100644 --- a/tests/unit/test_query_plan.py +++ b/tests/unit/test_query_plan.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for LazyQueryPlan class.""" from collections import Counter diff --git a/tests/unit/test_request.py b/tests/unit/test_request.py index 61879ec..3a6facd 100644 --- a/tests/unit/test_request.py +++ b/tests/unit/test_request.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for request parsing utilities.""" import json diff --git a/tests/unit/test_request_lifecycle.py b/tests/unit/test_request_lifecycle.py index ba286dd..2cb512f 100644 --- a/tests/unit/test_request_lifecycle.py +++ b/tests/unit/test_request_lifecycle.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for Alternator request mutation timing.""" from __future__ import annotations diff --git a/tests/unit/test_response_compression.py b/tests/unit/test_response_compression.py index 670d1fc..9962af8 100644 --- a/tests/unit/test_response_compression.py +++ b/tests/unit/test_response_compression.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for HTTP response compression handlers.""" from __future__ import annotations diff --git a/tests/unit/test_routing_scope.py b/tests/unit/test_routing_scope.py index 92d90b5..e7032dc 100644 --- a/tests/unit/test_routing_scope.py +++ b/tests/unit/test_routing_scope.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for routing scope classes.""" from alternator.core.routing_scope import ( diff --git a/tests/unit/test_scylla_version.py b/tests/unit/test_scylla_version.py index 51b2f82..0562bc8 100644 --- a/tests/unit/test_scylla_version.py +++ b/tests/unit/test_scylla_version.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Unit tests for ScyllaDB version detection.""" import os diff --git a/tests/unit/test_sync_manager.py b/tests/unit/test_sync_manager.py index e77f93a..209583e 100644 --- a/tests/unit/test_sync_manager.py +++ b/tests/unit/test_sync_manager.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for SyncLiveNodesManager.""" import time diff --git a/tests/unit/test_tls.py b/tests/unit/test_tls.py index 8733f96..cfa9db4 100644 --- a/tests/unit/test_tls.py +++ b/tests/unit/test_tls.py @@ -1,3 +1,17 @@ +# Copyright ScyllaDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Tests for TLS configuration utilities.""" import ssl