From 0081a663f3c4f2968223381bd761036c8c1b42a7 Mon Sep 17 00:00:00 2001 From: Matthew Warren Date: Thu, 18 Apr 2024 09:30:13 -0400 Subject: [PATCH 1/4] add exclude to copyright enforcement pre-commit hook --- .pre-commit-config.yaml | 4 +++- src/dynamic_importer/main.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 862d994..e72067b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,9 +35,11 @@ repos: - id: mypy additional_dependencies: [types-all] args: [--explicit-package-bases, --ignore-missing-imports] - exclude: ^dynamic_importer/samples/|^files/ + exclude: ^samples/|^files/ - repo: https://github.com/sbrunner/hooks rev: 1.0.0 hooks: - id: copyright + exclude: (^samples/|^files/|.*\.yaml|Dockerfile.*) - id: copyright-required + exclude: (^samples/|^files/|.*\.yaml|Dockerfile.*) diff --git a/src/dynamic_importer/main.py b/src/dynamic_importer/main.py index ea63d2d..353c144 100644 --- a/src/dynamic_importer/main.py +++ b/src/dynamic_importer/main.py @@ -242,7 +242,7 @@ def _create_data( if cur_time - start_time > CREATE_DATA_MSG_INTERVAL: click.echo(f"Created {i} parameters, {total_params - i} remaining") start_time = time() - click.echo(f"Usploading template: {template_name}") + click.echo(f"Uploading template: {template_name}") client.upsert_template(project, name=template_name, body=template_data) From d6286e6ddfc0c47ce8f7152b0359d3f7414ff789 Mon Sep 17 00:00:00 2001 From: Matthew Warren Date: Thu, 18 Apr 2024 09:32:20 -0400 Subject: [PATCH 2/4] add pre-commit to actions ci --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3908a04..b7a3e6d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,6 +24,10 @@ jobs: run: | python -m pip install --upgrade pip pip install -e .[dev] + + - name: Run pre-commit checks + uses: pre-commit/action@v3.0.1 + - name: Test with pytest run: | pytest From fbbb4d7652e07414107dfa4bf9ff3ae589da8f1f Mon Sep 17 00:00:00 2001 From: Matthew Warren Date: Thu, 18 Apr 2024 09:48:29 -0400 Subject: [PATCH 3/4] insert copyright to satisfy the pre-commit action --- .pre-commit-config.yaml | 4 ++-- src/dynamic_importer/api/client.py | 5 +++++ src/dynamic_importer/api/exceptions.py | 5 +++++ src/dynamic_importer/api/types.py | 5 +++++ src/dynamic_importer/processors/__init__.py | 5 +++++ src/dynamic_importer/processors/dotenv.py | 5 +++++ src/dynamic_importer/processors/json.py | 5 +++++ src/dynamic_importer/processors/tf.py | 5 +++++ src/dynamic_importer/processors/tfvars.py | 5 +++++ src/dynamic_importer/processors/yaml.py | 5 +++++ src/dynamic_importer/util.py | 5 +++++ src/dynamic_importer/walker.py | 5 +++++ src/tests/fixtures/requests.py | 5 +++++ src/tests/processors/test_yaml.py | 5 +++++ src/tests/test_client.py | 5 +++++ 15 files changed, 72 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e72067b..6b08b3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,6 +40,6 @@ repos: rev: 1.0.0 hooks: - id: copyright - exclude: (^samples/|^files/|.*\.yaml|Dockerfile.*) + exclude: (^samples/|^files/|.*\.yaml|Dockerfile.*|LICENSE|.*\.md|\.gitignore|.*\.toml|\.flake8) - id: copyright-required - exclude: (^samples/|^files/|.*\.yaml|Dockerfile.*) + exclude: (^samples/|^files/|.*\.yaml|Dockerfile.*|LICENSE|.*\.md|\.gitignore|.*\.toml|\.flake8) diff --git a/src/dynamic_importer/api/client.py b/src/dynamic_importer/api/client.py index 816b646..5da0ee0 100644 --- a/src/dynamic_importer/api/client.py +++ b/src/dynamic_importer/api/client.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import os diff --git a/src/dynamic_importer/api/exceptions.py b/src/dynamic_importer/api/exceptions.py index df53b8a..42abc2e 100644 --- a/src/dynamic_importer/api/exceptions.py +++ b/src/dynamic_importer/api/exceptions.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations diff --git a/src/dynamic_importer/api/types.py b/src/dynamic_importer/api/types.py index b864978..7f0ccb4 100644 --- a/src/dynamic_importer/api/types.py +++ b/src/dynamic_importer/api/types.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations diff --git a/src/dynamic_importer/processors/__init__.py b/src/dynamic_importer/processors/__init__.py index 4a90f26..29e1e02 100644 --- a/src/dynamic_importer/processors/__init__.py +++ b/src/dynamic_importer/processors/__init__.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import importlib diff --git a/src/dynamic_importer/processors/dotenv.py b/src/dynamic_importer/processors/dotenv.py index be853ee..52ad0e9 100644 --- a/src/dynamic_importer/processors/dotenv.py +++ b/src/dynamic_importer/processors/dotenv.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import os diff --git a/src/dynamic_importer/processors/json.py b/src/dynamic_importer/processors/json.py index 12f36b3..5ef4a3b 100644 --- a/src/dynamic_importer/processors/json.py +++ b/src/dynamic_importer/processors/json.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import json diff --git a/src/dynamic_importer/processors/tf.py b/src/dynamic_importer/processors/tf.py index f370b70..2d2a4cf 100644 --- a/src/dynamic_importer/processors/tf.py +++ b/src/dynamic_importer/processors/tf.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import os diff --git a/src/dynamic_importer/processors/tfvars.py b/src/dynamic_importer/processors/tfvars.py index 2bac1b5..2b2b560 100644 --- a/src/dynamic_importer/processors/tfvars.py +++ b/src/dynamic_importer/processors/tfvars.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations from re import sub diff --git a/src/dynamic_importer/processors/yaml.py b/src/dynamic_importer/processors/yaml.py index 152d817..69d5969 100644 --- a/src/dynamic_importer/processors/yaml.py +++ b/src/dynamic_importer/processors/yaml.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations from re import sub diff --git a/src/dynamic_importer/util.py b/src/dynamic_importer/util.py index a7b534f..f8aab5c 100644 --- a/src/dynamic_importer/util.py +++ b/src/dynamic_importer/util.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import os diff --git a/src/dynamic_importer/walker.py b/src/dynamic_importer/walker.py index 4c716f7..664ca71 100644 --- a/src/dynamic_importer/walker.py +++ b/src/dynamic_importer/walker.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import os diff --git a/src/tests/fixtures/requests.py b/src/tests/fixtures/requests.py index 147da77..87a76ca 100644 --- a/src/tests/fixtures/requests.py +++ b/src/tests/fixtures/requests.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations diff --git a/src/tests/processors/test_yaml.py b/src/tests/processors/test_yaml.py index f1085d7..953aae0 100644 --- a/src/tests/processors/test_yaml.py +++ b/src/tests/processors/test_yaml.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import pathlib diff --git a/src/tests/test_client.py b/src/tests/test_client.py index d20e136..9e9f34b 100644 --- a/src/tests/test_client.py +++ b/src/tests/test_client.py @@ -1,3 +1,8 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import os From c405df2833eb7f8381c0bb696ee17d42d29150a6 Mon Sep 17 00:00:00 2001 From: Matthew Warren Date: Thu, 18 Apr 2024 10:07:44 -0400 Subject: [PATCH 4/4] missed a few --- src/dynamic_importer/__init__.py | 6 ++++++ src/dynamic_importer/api/__init__.py | 6 ++++++ src/tests/__init__.py | 6 ++++++ src/tests/test_directory_walking.py | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/src/dynamic_importer/__init__.py b/src/dynamic_importer/__init__.py index e69de29..5f0678e 100644 --- a/src/dynamic_importer/__init__.py +++ b/src/dynamic_importer/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# +from __future__ import annotations diff --git a/src/dynamic_importer/api/__init__.py b/src/dynamic_importer/api/__init__.py index e69de29..5f0678e 100644 --- a/src/dynamic_importer/api/__init__.py +++ b/src/dynamic_importer/api/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# +from __future__ import annotations diff --git a/src/tests/__init__.py b/src/tests/__init__.py index e69de29..5f0678e 100644 --- a/src/tests/__init__.py +++ b/src/tests/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# +from __future__ import annotations diff --git a/src/tests/test_directory_walking.py b/src/tests/test_directory_walking.py index ccc639e..d866155 100644 --- a/src/tests/test_directory_walking.py +++ b/src/tests/test_directory_walking.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +# +# Copyright (c) 2024 CloudTruth, Inc. +# All Rights Reserved +# from __future__ import annotations import os