diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f9765d00..3e1f70fe9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,7 +21,9 @@ jobs: - name: Install dependencies run: pip install tox - name: Run linter - run: tox -e lint + run: | + tox -e lint + ./scripts/copyright.sh unit-tests: needs: lint diff --git a/Makefile b/Makefile index b8a013a7f..ba7f0b3f1 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,9 @@ test: lint tox -e integration .PHONY: lint -lint: +lint: + @./scripts/copyright.sh + @echo "==> Running flake8 linter" tox -e lint .PHONY: docs diff --git a/docs/conf.py b/docs/conf.py index ba33ac5cf..87c54f91b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # -*- coding: utf-8 -*- # # libjuju documentation build configuration file, created by diff --git a/examples/action.py b/examples/action.py index a73558812..b0db1b7e8 100644 --- a/examples/action.py +++ b/examples/action.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/add_k8s.py b/examples/add_k8s.py index 3e2bec7cc..c9c63045e 100644 --- a/examples/add_k8s.py +++ b/examples/add_k8s.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/add_machine.py b/examples/add_machine.py index 9fa25c76d..47c602d0c 100755 --- a/examples/add_machine.py +++ b/examples/add_machine.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/add_model.py b/examples/add_model.py index 041b11df9..06cd18084 100644 --- a/examples/add_model.py +++ b/examples/add_model.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/add_secrets_backend.py b/examples/add_secrets_backend.py index 1d741dca9..10e00d24a 100644 --- a/examples/add_secrets_backend.py +++ b/examples/add_secrets_backend.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju import jasyncio from juju.model import Model diff --git a/examples/allwatcher.py b/examples/allwatcher.py index 2047e9824..b0934e342 100644 --- a/examples/allwatcher.py +++ b/examples/allwatcher.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/charmhub_deploy_k8s.py b/examples/charmhub_deploy_k8s.py index 20e62ded0..c49a74df0 100644 --- a/examples/charmhub_deploy_k8s.py +++ b/examples/charmhub_deploy_k8s.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/charmhub_deploy_machine.py b/examples/charmhub_deploy_machine.py index 7765016ff..479ec2fe5 100644 --- a/examples/charmhub_deploy_machine.py +++ b/examples/charmhub_deploy_machine.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/charmhub_find.py b/examples/charmhub_find.py index a2ed391e8..22526adf8 100644 --- a/examples/charmhub_find.py +++ b/examples/charmhub_find.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ Example to show how to connect to the current model and search the charm-hub repository for charms. diff --git a/examples/charmhub_info.py b/examples/charmhub_info.py index d07505069..44d6dbfec 100644 --- a/examples/charmhub_info.py +++ b/examples/charmhub_info.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ Example to show how to connect to the current model and query the charm-hub repository for information about a given charm. diff --git a/examples/cloud.py b/examples/cloud.py index 3c06da4f5..6dfa5ce92 100644 --- a/examples/cloud.py +++ b/examples/cloud.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/clouds.py b/examples/clouds.py index 5ac97d017..62750bc9a 100644 --- a/examples/clouds.py +++ b/examples/clouds.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/config.py b/examples/config.py index 673f58fcf..278c9b8bf 100644 --- a/examples/config.py +++ b/examples/config.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/connect_current_model.py b/examples/connect_current_model.py index e8d922798..1b7b2749b 100644 --- a/examples/connect_current_model.py +++ b/examples/connect_current_model.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This is a very basic example that connects to the currently selected model and prints the number of applications deployed to it. diff --git a/examples/controller.py b/examples/controller.py index a7f429fbd..173c9e1a7 100644 --- a/examples/controller.py +++ b/examples/controller.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/credential.py b/examples/credential.py index e908b19c6..9c7dfe19e 100644 --- a/examples/credential.py +++ b/examples/credential.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import sys from juju import jasyncio from juju.controller import Controller diff --git a/examples/crossmodel.py b/examples/crossmodel.py index 7cef75a90..a5fdacc4a 100644 --- a/examples/crossmodel.py +++ b/examples/crossmodel.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/crossmodel_bundle.py b/examples/crossmodel_bundle.py index 0d7cb9554..6a3ae71d6 100644 --- a/examples/crossmodel_bundle.py +++ b/examples/crossmodel_bundle.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/crossmodel_controller.py b/examples/crossmodel_controller.py index 3e7974f49..00167d00e 100644 --- a/examples/crossmodel_controller.py +++ b/examples/crossmodel_controller.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/crossmodel_relation.py b/examples/crossmodel_relation.py index 9159da06f..d878db9a0 100644 --- a/examples/crossmodel_relation.py +++ b/examples/crossmodel_relation.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/debug-log.py b/examples/debug-log.py index c2e2c9589..823c9852f 100644 --- a/examples/debug-log.py +++ b/examples/debug-log.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example demonstrate how debug-log works diff --git a/examples/deploy.py b/examples/deploy.py index 3e553cb87..9d1ea00fc 100644 --- a/examples/deploy.py +++ b/examples/deploy.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_bundle.py b/examples/deploy_bundle.py index 226eb194f..eb4ac6374 100644 --- a/examples/deploy_bundle.py +++ b/examples/deploy_bundle.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_bundle_charmhub.py b/examples/deploy_bundle_charmhub.py index 119a8fa47..9119b6fd8 100644 --- a/examples/deploy_bundle_charmhub.py +++ b/examples/deploy_bundle_charmhub.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: 1. Connects to the current model diff --git a/examples/deploy_bundle_with_trust.py b/examples/deploy_bundle_with_trust.py index f068fb7d1..22a3cd442 100644 --- a/examples/deploy_bundle_with_trust.py +++ b/examples/deploy_bundle_with_trust.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_constraints.py b/examples/deploy_constraints.py index 3780d8c68..077e59bc1 100644 --- a/examples/deploy_constraints.py +++ b/examples/deploy_constraints.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_local_big_k8s_bundle.py b/examples/deploy_local_big_k8s_bundle.py index 020d79a33..76a548f58 100644 --- a/examples/deploy_local_big_k8s_bundle.py +++ b/examples/deploy_local_big_k8s_bundle.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_local_bundle_with_resources.py b/examples/deploy_local_bundle_with_resources.py index 1ab44376f..bb32badc6 100644 --- a/examples/deploy_local_bundle_with_resources.py +++ b/examples/deploy_local_bundle_with_resources.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_local_file_resource.py b/examples/deploy_local_file_resource.py index a4ad3d104..59da4da6b 100644 --- a/examples/deploy_local_file_resource.py +++ b/examples/deploy_local_file_resource.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_local_resource.py b/examples/deploy_local_resource.py index fe58649ad..c2a34588e 100644 --- a/examples/deploy_local_resource.py +++ b/examples/deploy_local_resource.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/deploy_with_revision.py b/examples/deploy_with_revision.py index a1f96fbc2..8ceafc066 100644 --- a/examples/deploy_with_revision.py +++ b/examples/deploy_with_revision.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju import jasyncio from juju.model import Model diff --git a/examples/expose-application.py b/examples/expose-application.py index 18e73ffd7..a9dbf1722 100644 --- a/examples/expose-application.py +++ b/examples/expose-application.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/formatted_status.py b/examples/formatted_status.py index 58888cd24..74932fce6 100644 --- a/examples/formatted_status.py +++ b/examples/formatted_status.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example demonstrates how to obtain a formatted full status description. For a similar solution using the FullStatus object diff --git a/examples/fullstatus.py b/examples/fullstatus.py index af4e82e80..918415218 100644 --- a/examples/fullstatus.py +++ b/examples/fullstatus.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju import jasyncio from juju.model import Model diff --git a/examples/future.py b/examples/future.py index 292433010..c9b789909 100644 --- a/examples/future.py +++ b/examples/future.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example doesn't work - it demonstrates features that don't exist yet. diff --git a/examples/get_cloud.py b/examples/get_cloud.py index 798029b9f..be3f80cd4 100644 --- a/examples/get_cloud.py +++ b/examples/get_cloud.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/leadership.py b/examples/leadership.py index ac7113f3d..d11d7cd5b 100644 --- a/examples/leadership.py +++ b/examples/leadership.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/list_secrets.py b/examples/list_secrets.py index 38e732eab..c7467ba6d 100644 --- a/examples/list_secrets.py +++ b/examples/list_secrets.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju import jasyncio from juju.model import Model diff --git a/examples/livemodel.py b/examples/livemodel.py index ba7271b33..a16423e5b 100644 --- a/examples/livemodel.py +++ b/examples/livemodel.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/local_refresh.py b/examples/local_refresh.py index 749658c56..b2fe26b58 100644 --- a/examples/local_refresh.py +++ b/examples/local_refresh.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/localcharm.py b/examples/localcharm.py index 48df66def..bf2012a01 100644 --- a/examples/localcharm.py +++ b/examples/localcharm.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example shows how to deploy a local charm. It: diff --git a/examples/machine_hostname.py b/examples/machine_hostname.py index d0db81f3f..8ea959b90 100644 --- a/examples/machine_hostname.py +++ b/examples/machine_hostname.py @@ -1,5 +1,9 @@ #!/usr/bin/env python3 +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + + """ This example: diff --git a/examples/model.py b/examples/model.py index 7581973fb..06b24b690 100755 --- a/examples/model.py +++ b/examples/model.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example shows how to reconnect to a model if you encounter an error diff --git a/examples/modelsummaries.py b/examples/modelsummaries.py index 166b99ad6..ffe3422da 100644 --- a/examples/modelsummaries.py +++ b/examples/modelsummaries.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/relate.py b/examples/relate.py index e3f3d6821..938ca3122 100644 --- a/examples/relate.py +++ b/examples/relate.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/run_action.py b/examples/run_action.py index 7a35fb52b..0f8ddfd4c 100644 --- a/examples/run_action.py +++ b/examples/run_action.py @@ -1,3 +1,5 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. from juju import jasyncio from juju.model import Model diff --git a/examples/scp.py b/examples/scp.py index 972055384..37daa7aa6 100644 --- a/examples/scp.py +++ b/examples/scp.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This is a very basic example that connects to the currently selected model and prints the number of applications deployed to it. diff --git a/examples/status.py b/examples/status.py index 6068c8aab..0f1e0134f 100644 --- a/examples/status.py +++ b/examples/status.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example demonstrate how status works diff --git a/examples/unitrun.py b/examples/unitrun.py index 6240f4578..eeeb12fad 100644 --- a/examples/unitrun.py +++ b/examples/unitrun.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/examples/upgrade_local_charm_k8s.py b/examples/upgrade_local_charm_k8s.py index 0128ef505..3b6002b36 100644 --- a/examples/upgrade_local_charm_k8s.py +++ b/examples/upgrade_local_charm_k8s.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ This example: diff --git a/juju/access.py b/juju/access.py index ec281a12b..de3c8b7aa 100644 --- a/juju/access.py +++ b/juju/access.py @@ -1,3 +1,5 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. from .errors import JujuNotValid diff --git a/juju/action.py b/juju/action.py index dbe0aa6d7..17a8fb90f 100644 --- a/juju/action.py +++ b/juju/action.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from . import model diff --git a/juju/annotation.py b/juju/annotation.py index 73c9b1c3c..2d70eafa0 100644 --- a/juju/annotation.py +++ b/juju/annotation.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging from . import model diff --git a/juju/annotationhelper.py b/juju/annotationhelper.py index cb4876987..a6be596ff 100644 --- a/juju/annotationhelper.py +++ b/juju/annotationhelper.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging from .client import client diff --git a/juju/application.py b/juju/application.py index 437455e7b..b530346c8 100644 --- a/juju/application.py +++ b/juju/application.py @@ -1,16 +1,5 @@ -# Copyright 2016 Canonical Ltd. -# -# 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. +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. import hashlib import json diff --git a/juju/bundle.py b/juju/bundle.py index 804ee1f45..80e3334de 100644 --- a/juju/bundle.py +++ b/juju/bundle.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging import io import os diff --git a/juju/charm.py b/juju/charm.py index 59ad2b456..e5883316a 100644 --- a/juju/charm.py +++ b/juju/charm.py @@ -1,16 +1,5 @@ -# Copyright 2019 Canonical Ltd. -# -# 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. +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. import logging from . import model diff --git a/juju/charmhub.py b/juju/charmhub.py index c5d573bc7..b37654266 100644 --- a/juju/charmhub.py +++ b/juju/charmhub.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from .client import client from .errors import JujuError from juju import jasyncio diff --git a/juju/client/client.py b/juju/client/client.py index 2721d07f9..e68601ac7 100644 --- a/juju/client/client.py +++ b/juju/client/client.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + '''Replace auto-generated classes with our own, where necessary. ''' diff --git a/juju/client/codegen.py b/juju/client/codegen.py index f8a792a7b..137d4ecf8 100644 --- a/juju/client/codegen.py +++ b/juju/client/codegen.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from collections import defaultdict from io import StringIO from textwrap import indent diff --git a/juju/client/connection.py b/juju/client/connection.py index 480233454..7e98ca8ed 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import base64 import json import logging diff --git a/juju/client/connector.py b/juju/client/connector.py index 3eeefe29e..b037b5db9 100644 --- a/juju/client/connector.py +++ b/juju/client/connector.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import copy import logging diff --git a/juju/client/facade.py b/juju/client/facade.py index b64ddfcfb..2fa16dcd0 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import argparse import builtins import functools diff --git a/juju/client/flags.py b/juju/client/flags.py index 940ec5fc4..fc6784523 100644 --- a/juju/client/flags.py +++ b/juju/client/flags.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import os PYLIBJUJU_DEV_FEATURE_FLAG = "PYLIBJUJU_DEV_FEATURE_FLAGS" diff --git a/juju/client/gocookies.py b/juju/client/gocookies.py index 3e48b8d2a..e53ccde9e 100644 --- a/juju/client/gocookies.py +++ b/juju/client/gocookies.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import datetime import http.cookiejar as cookiejar import json diff --git a/juju/client/jujudata.py b/juju/client/jujudata.py index 7e08b2ff5..79e924c63 100644 --- a/juju/client/jujudata.py +++ b/juju/client/jujudata.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import abc import io import os diff --git a/juju/client/overrides.py b/juju/client/overrides.py index 4ef8c2766..be3f2440d 100644 --- a/juju/client/overrides.py +++ b/juju/client/overrides.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import re from collections import namedtuple diff --git a/juju/client/proxy/factory.py b/juju/client/proxy/factory.py index 696ce5f53..725d7dc59 100644 --- a/juju/client/proxy/factory.py +++ b/juju/client/proxy/factory.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju.client.proxy.kubernetes.proxy import KubernetesProxy diff --git a/juju/client/proxy/kubernetes/proxy.py b/juju/client/proxy/kubernetes/proxy.py index 44b06f8b6..0c77ef62e 100644 --- a/juju/client/proxy/kubernetes/proxy.py +++ b/juju/client/proxy/kubernetes/proxy.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import tempfile from juju.client.proxy.proxy import Proxy, ProxyNotConnectedError diff --git a/juju/client/proxy/proxy.py b/juju/client/proxy/proxy.py index 90df5532c..5105c5f6c 100644 --- a/juju/client/proxy/proxy.py +++ b/juju/client/proxy/proxy.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from abc import abstractmethod from juju.errors import AbstractMethodError diff --git a/juju/client/runner.py b/juju/client/runner.py index 6545bc413..9401718ff 100644 --- a/juju/client/runner.py +++ b/juju/client/runner.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + class AsyncRunner: async def __call__(self, facade_method, *args, **kwargs): diff --git a/juju/constraints.py b/juju/constraints.py index 5c141ed77..2574b6b08 100644 --- a/juju/constraints.py +++ b/juju/constraints.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # # Module that parses constraints # diff --git a/juju/controller.py b/juju/controller.py index fd1cf4234..3304517f4 100644 --- a/juju/controller.py +++ b/juju/controller.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import json import logging from concurrent.futures import CancelledError diff --git a/juju/delta.py b/juju/delta.py index 7fa16746d..6f65e4425 100644 --- a/juju/delta.py +++ b/juju/delta.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from .client import client diff --git a/juju/errors.py b/juju/errors.py index 9a9a254f5..a34dfbd04 100644 --- a/juju/errors.py +++ b/juju/errors.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + class JujuError(Exception): def __init__(self, *args, **kwargs): self.message = '' diff --git a/juju/exceptions.py b/juju/exceptions.py index bcf07b6a9..e0205a0b5 100644 --- a/juju/exceptions.py +++ b/juju/exceptions.py @@ -1,2 +1,5 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + class DeadEntityException(Exception): pass diff --git a/juju/jasyncio.py b/juju/jasyncio.py index 7f55323af..86979ed7c 100644 --- a/juju/jasyncio.py +++ b/juju/jasyncio.py @@ -1,16 +1,5 @@ -# Copyright 2016 Canonical Ltd. -# -# 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. +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. # A compatibility layer on asyncio that ensures we have all the right # bindings for the functions we need from asyncio. Reason for this diff --git a/juju/juju.py b/juju/juju.py index 55eb8798b..1f324341d 100644 --- a/juju/juju.py +++ b/juju/juju.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju.controller import Controller from juju.client.jujudata import FileJujuData from juju.errors import JujuError diff --git a/juju/loop.py b/juju/loop.py index 3372ffb95..6a770c171 100644 --- a/juju/loop.py +++ b/juju/loop.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from .jasyncio import * # noqa import warnings diff --git a/juju/machine.py b/juju/machine.py index e73e21a11..60554fd09 100644 --- a/juju/machine.py +++ b/juju/machine.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import ipaddress import logging diff --git a/juju/model.py b/juju/model.py index 1070aa337..d9809397f 100644 --- a/juju/model.py +++ b/juju/model.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import base64 import collections import hashlib diff --git a/juju/names.py b/juju/names.py index 1a7188465..554e0f805 100644 --- a/juju/names.py +++ b/juju/names.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import re from enum import Enum, unique diff --git a/juju/offerendpoints.py b/juju/offerendpoints.py index 2cd04d286..e72c86c07 100644 --- a/juju/offerendpoints.py +++ b/juju/offerendpoints.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # # Module that parses offer endpoints # diff --git a/juju/origin.py b/juju/origin.py index e6837adc6..bb68596b8 100644 --- a/juju/origin.py +++ b/juju/origin.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from enum import Enum from .errors import JujuError diff --git a/juju/placement.py b/juju/placement.py index d0d42f752..74a29c4a5 100644 --- a/juju/placement.py +++ b/juju/placement.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # # This module allows us to parse a machine placement directive into a # Placement object suitable for passing through the websocket API. diff --git a/juju/provisioner.py b/juju/provisioner.py index 0cde675f6..31e7fe8f5 100644 --- a/juju/provisioner.py +++ b/juju/provisioner.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import os import re import shlex diff --git a/juju/relation.py b/juju/relation.py index 0be76a9b7..c7c84161a 100644 --- a/juju/relation.py +++ b/juju/relation.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging from . import model diff --git a/juju/remoteapplication.py b/juju/remoteapplication.py index 960a08fd3..18100f06a 100644 --- a/juju/remoteapplication.py +++ b/juju/remoteapplication.py @@ -1,16 +1,5 @@ -# Copyright 2019 Canonical Ltd. -# -# 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. +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. import logging diff --git a/juju/status.py b/juju/status.py index a54bce504..46485dac6 100644 --- a/juju/status.py +++ b/juju/status.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging from .client import client diff --git a/juju/tag.py b/juju/tag.py index 3a2772a4e..f6070978b 100644 --- a/juju/tag.py +++ b/juju/tag.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # TODO: Tags should be a proper class, so that we can distinguish whether # something is already a tag or not. For example, 'user-foo' is a valid # username, but is ambiguous with the already-tagged username 'foo'. diff --git a/juju/unit.py b/juju/unit.py index 1597dedd6..a60fab01e 100644 --- a/juju/unit.py +++ b/juju/unit.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging import pyrfc3339 diff --git a/juju/url.py b/juju/url.py index b536799b3..b95b18d8c 100644 --- a/juju/url.py +++ b/juju/url.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from enum import Enum from .errors import JujuError from urllib.parse import urlparse diff --git a/juju/user.py b/juju/user.py index c069b9866..a42886d6e 100644 --- a/juju/user.py +++ b/juju/user.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging import pyrfc3339 diff --git a/juju/utils.py b/juju/utils.py index 7cbe9abd4..37bd628c4 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import os import textwrap from collections import defaultdict diff --git a/juju/version.py b/juju/version.py index 76243afca..3035fce9d 100644 --- a/juju/version.py +++ b/juju/version.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + LTS_RELEASES = ["jammy", "focal", "bionic", "xenial", "trusty", "precise"] diff --git a/scripts/copyright.sh b/scripts/copyright.sh new file mode 100755 index 000000000..b93e035c5 --- /dev/null +++ b/scripts/copyright.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +supports_colors() { + if [[ -z ${TERM} ]] || [[ ${TERM} == "" ]] || [[ ${TERM} == "dumb" ]]; then + echo "NO" + return + fi + if which tput >/dev/null 2>&1; then + # shellcheck disable=SC2046 + if [[ $(tput colors) -gt 1 ]]; then + echo "YES" + return + fi + fi + echo "NO" +} + +red() { + if [[ "$(supports_colors)" == "YES" ]]; then + tput sgr0 + echo "$(tput setaf 1)${1}$(tput sgr0)" + return + fi + echo "${1}" +} + +run_copyright() { + OUT=$(find . -name '*.py' | grep -v -E "./(docs|scripts|debian|juju-egg-info|.tox|.git|juju/client|tests/charm)|__init__" | sort | xargs grep -L -E '# (Copyright|Code generated)' || true) + LINES=$(echo "${OUT}" | wc -w) + if [ "$LINES" != 0 ]; then + echo "" + echo "$(red 'Found some issues:')" + echo -e '\nThe following files are missing copyright headers' + echo "${OUT}" + exit 1 + fi +} + +test_copyright() { + echo "==> Copyright analysis" + + ( + # cd .. || exit + + # Check for copyright notices + run_copyright + ) +} + +test_copyright \ No newline at end of file diff --git a/setup.py b/setup.py index f71423be0..95c82aa08 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,5 @@ -# Copyright 2016 Canonical Ltd. -# -# 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. +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. from pathlib import Path diff --git a/tests/base.py b/tests/base.py index 4c7ef670f..8ded52e0b 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import inspect import subprocess import uuid diff --git a/tests/integration/test_application.py b/tests/integration/test_application.py index 80ecec2c8..1d1a0d629 100644 --- a/tests/integration/test_application.py +++ b/tests/integration/test_application.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from pathlib import Path import pytest diff --git a/tests/integration/test_charmhub.py b/tests/integration/test_charmhub.py index be8f277d7..bbacf5581 100644 --- a/tests/integration/test_charmhub.py +++ b/tests/integration/test_charmhub.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import pytest from .. import base diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index 8c31cac0a..a370483ec 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju.client import client import pytest diff --git a/tests/integration/test_connection.py b/tests/integration/test_connection.py index 9f06b10d3..42faa6264 100644 --- a/tests/integration/test_connection.py +++ b/tests/integration/test_connection.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import http import logging import socket diff --git a/tests/integration/test_controller.py b/tests/integration/test_controller.py index 09c9e1e84..e30298ee2 100644 --- a/tests/integration/test_controller.py +++ b/tests/integration/test_controller.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import asyncio import uuid import hvac diff --git a/tests/integration/test_crossmodel.py b/tests/integration/test_crossmodel.py index 546a58f8d..30dbf5a03 100644 --- a/tests/integration/test_crossmodel.py +++ b/tests/integration/test_crossmodel.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import tempfile from pathlib import Path diff --git a/tests/integration/test_errors.py b/tests/integration/test_errors.py index 5fc868cfa..36e17fc08 100644 --- a/tests/integration/test_errors.py +++ b/tests/integration/test_errors.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import pytest from .. import base diff --git a/tests/integration/test_expose.py b/tests/integration/test_expose.py index 032283be1..05c84fbe0 100644 --- a/tests/integration/test_expose.py +++ b/tests/integration/test_expose.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import pytest from juju.application import ExposedEndpoint diff --git a/tests/integration/test_juju.py b/tests/integration/test_juju.py index a960d97b9..568e29e9c 100644 --- a/tests/integration/test_juju.py +++ b/tests/integration/test_juju.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import pytest from juju.controller import Controller diff --git a/tests/integration/test_macaroon_auth.py b/tests/integration/test_macaroon_auth.py index ed8c6c9b6..ca840c7f0 100644 --- a/tests/integration/test_macaroon_auth.py +++ b/tests/integration/test_macaroon_auth.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import logging import subprocess import os diff --git a/tests/integration/test_machine.py b/tests/integration/test_machine.py index 9631531b7..7d070726e 100644 --- a/tests/integration/test_machine.py +++ b/tests/integration/test_machine.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import asyncio from tempfile import NamedTemporaryFile diff --git a/tests/integration/test_model.py b/tests/integration/test_model.py index 562874703..9f34a2b03 100644 --- a/tests/integration/test_model.py +++ b/tests/integration/test_model.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import json import os import random diff --git a/tests/integration/test_unit.py b/tests/integration/test_unit.py index 99b99eb17..25a79e4f2 100644 --- a/tests/integration/test_unit.py +++ b/tests/integration/test_unit.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import asyncio from pathlib import Path from tempfile import NamedTemporaryFile diff --git a/tests/unit/test_application.py b/tests/unit/test_application.py index 0ac18ddad..dc8310412 100644 --- a/tests/unit/test_application.py +++ b/tests/unit/test_application.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import mock import asynctest import asyncio diff --git a/tests/unit/test_bundle.py b/tests/unit/test_bundle.py index b05dde579..17dd0ebf6 100644 --- a/tests/unit/test_bundle.py +++ b/tests/unit/test_bundle.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from pathlib import Path import unittest from unittest import mock diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 0c4f76320..79af53684 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ Tests for generated client code diff --git a/tests/unit/test_connection.py b/tests/unit/test_connection.py index c4272d99f..0938bf946 100644 --- a/tests/unit/test_connection.py +++ b/tests/unit/test_connection.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import asyncio import json from collections import deque diff --git a/tests/unit/test_constraints.py b/tests/unit/test_constraints.py index 244883eb0..03b2013f7 100644 --- a/tests/unit/test_constraints.py +++ b/tests/unit/test_constraints.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # # Test our constraints parser # diff --git a/tests/unit/test_controller.py b/tests/unit/test_controller.py index 426535e6a..9cc45f267 100644 --- a/tests/unit/test_controller.py +++ b/tests/unit/test_controller.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from pathlib import Path from tempfile import NamedTemporaryFile diff --git a/tests/unit/test_definitions.py b/tests/unit/test_definitions.py index a2258bfab..ac74dd373 100644 --- a/tests/unit/test_definitions.py +++ b/tests/unit/test_definitions.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest from juju.client import client diff --git a/tests/unit/test_flags.py b/tests/unit/test_flags.py index afe7d22c5..e30105402 100644 --- a/tests/unit/test_flags.py +++ b/tests/unit/test_flags.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import os import unittest diff --git a/tests/unit/test_gocookies.py b/tests/unit/test_gocookies.py index 033a0e9ae..57f5c1bd7 100644 --- a/tests/unit/test_gocookies.py +++ b/tests/unit/test_gocookies.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + """ Tests for the gocookies code. """ diff --git a/tests/unit/test_loop.py b/tests/unit/test_loop.py index 6e0ad8318..285d5e8a0 100644 --- a/tests/unit/test_loop.py +++ b/tests/unit/test_loop.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest from juju import jasyncio diff --git a/tests/unit/test_machine.py b/tests/unit/test_machine.py index 74bdef400..13b3b23bb 100644 --- a/tests/unit/test_machine.py +++ b/tests/unit/test_machine.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import asynctest import mock import pytest diff --git a/tests/unit/test_model.py b/tests/unit/test_model.py index e072948be..08088f102 100644 --- a/tests/unit/test_model.py +++ b/tests/unit/test_model.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest from unittest.mock import patch, PropertyMock diff --git a/tests/unit/test_offerendpoint.py b/tests/unit/test_offerendpoint.py index eb983f4f4..cdb295c97 100644 --- a/tests/unit/test_offerendpoint.py +++ b/tests/unit/test_offerendpoint.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # # Test our offer endpoint parser # diff --git a/tests/unit/test_origin.py b/tests/unit/test_origin.py index 979cdc658..40a37e7e3 100644 --- a/tests/unit/test_origin.py +++ b/tests/unit/test_origin.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest from juju.origin import Channel, Origin, Platform, Risk, Source diff --git a/tests/unit/test_overrides.py b/tests/unit/test_overrides.py index a5835ff29..5643940a0 100644 --- a/tests/unit/test_overrides.py +++ b/tests/unit/test_overrides.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from juju.client.overrides import Binary, Number # noqa import pytest diff --git a/tests/unit/test_placement.py b/tests/unit/test_placement.py index 5a933ecc1..74c64404e 100644 --- a/tests/unit/test_placement.py +++ b/tests/unit/test_placement.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # # Test our placement helper # diff --git a/tests/unit/test_proxy.py b/tests/unit/test_proxy.py index c24283e83..a4e9a15f8 100644 --- a/tests/unit/test_proxy.py +++ b/tests/unit/test_proxy.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest from juju.client.proxy.factory import proxy_from_config diff --git a/tests/unit/test_proxy_kubernetes.py b/tests/unit/test_proxy_kubernetes.py index fda776c61..3798b257e 100644 --- a/tests/unit/test_proxy_kubernetes.py +++ b/tests/unit/test_proxy_kubernetes.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest from juju.client.proxy.kubernetes.proxy import KubernetesProxy diff --git a/tests/unit/test_registration_string.py b/tests/unit/test_registration_string.py index f4fea4496..c1e00a1c6 100644 --- a/tests/unit/test_registration_string.py +++ b/tests/unit/test_registration_string.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + # # Test our placement helper # diff --git a/tests/unit/test_relation.py b/tests/unit/test_relation.py index 71936f15e..52d86bc67 100644 --- a/tests/unit/test_relation.py +++ b/tests/unit/test_relation.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest import mock diff --git a/tests/unit/test_status.py b/tests/unit/test_status.py index 20efe16ff..5d891e03f 100644 --- a/tests/unit/test_status.py +++ b/tests/unit/test_status.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest diff --git a/tests/unit/test_unit.py b/tests/unit/test_unit.py index e52fe364d..1289cc928 100644 --- a/tests/unit/test_unit.py +++ b/tests/unit/test_unit.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import asynctest import mock import pytest diff --git a/tests/unit/test_url.py b/tests/unit/test_url.py index 39df320bb..d1f3c6ee3 100644 --- a/tests/unit/test_url.py +++ b/tests/unit/test_url.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest from juju.url import Schema, URL diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 28d79ea22..84f7d214a 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + import unittest import pytest diff --git a/tests/utils.py b/tests/utils.py index 4528ec535..2ae8e0f7b 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,3 +1,6 @@ +# Copyright 2023 Canonical Ltd. +# Licensed under the Apache V2, see LICENCE file for details. + from pathlib import Path # Utilities for tests