Repository: goblet/goblet (language: python)

Issue:
[Cleanup] Rename resources to handlers
Right now the name `resources` is a little unclear. 

I am thinking of renaming to handlers to better describe the action going on. It may cause some breaking changes depending on how people are importing various classes. 


Discussion / hints:

Fix patch:
diff --git a/.flake8 b/.flake8
index 5502f3f8..b2620d9d 100644
--- a/.flake8
+++ b/.flake8
@@ -1,8 +1,7 @@
 [flake8]
 max-line-length = 88
-ignore = E501, W503, E266 
+ignore = E501, W503, E266, E203
 #E501 line too long
 #W503 line break before binary operator
 ; exclude = .git,__pycache__,docs
 max-complexity = 15
-extend-ignore = 203
diff --git a/README.md b/README.md
index 4072ba02..d90a2601 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,13 @@ $ curl https://api.uc.gateway.dev/home
 
 ## Resources Supported
 
+#### Infrastructure
+* vpc connector
+* redis
+* alerts
+* api gateway
+* cloudtaskqueue
+
 #### Backends
 * cloudfunction
 * cloudfunction V2
@@ -84,7 +91,7 @@ $ curl https://api.uc.gateway.dev/home
 * api gateway
 * http
 
-#### Triggering
+#### Handlers
 * pubsub
 * scheduler
 * storage
@@ -93,13 +100,6 @@ $ curl https://api.uc.gateway.dev/home
 * bq remote functions
 * cloudtasktarget
 
-#### Infrastructure
-* vpc connector
-* redis
-* alerts
-* api gateway
-* cloudtaskqueue
-
 ## Data Typing Frameworks Supported
 
 * pydantic
diff --git a/docs/source/resources.rst b/docs/source/handlers.rst
similarity index 99%
rename from docs/source/resources.rst
rename to docs/source/handlers.rst
index 2a52678b..8f11a4aa 100644
--- a/docs/source/resources.rst
+++ b/docs/source/handlers.rst
@@ -1,6 +1,6 @@
-=========
-Resources
-=========
+========
+Handlers
+========
 
 Http
 ^^^^
@@ -443,4 +443,3 @@ Another example using ``app.cloudtaskqueue`` to queue and handle tasks in the sa
         payload = {"message": {"title": "enqueue"}}
         client.enqueue(target="target", payload=payload)
         return {}
-
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 106349b3..22348c69 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -87,13 +87,13 @@ Topics
 
    topics
 
-Resources
-----------
+Handlers
+--------
 
 .. toctree::
    :maxdepth: 2
 
-   resources
+   handlers
 
 Backends
 ----------
@@ -142,4 +142,3 @@ Examples
    :maxdepth: 2
 
    examples
-
diff --git a/goblet/__version__.py b/goblet/__version__.py
index 683e4461..33a179e4 100644
--- a/goblet/__version__.py
+++ b/goblet/__version__.py
@@ -1,4 +1,4 @@
-VERSION = (0, 10, 4)
+VERSION = (0, 10, 5)
 
 
 __version__ = ".".join(map(str, VERSION))
diff --git a/goblet/decorators.py b/goblet/decorators.py
index 09def0df..ced9433b 100644
--- a/goblet/decorators.py
+++ b/goblet/decorators.py
@@ -4,26 +4,29 @@
 from warnings import warn
 import logging
 from googleapiclient.errors import HttpError
+
+from goblet.client import VersionedClients
+from goblet_gcp_client.client import get_default_location, get_default_project
+
 from goblet.backends.cloudfunctionv1 import CloudFunctionV1
 from goblet.backends.cloudfunctionv2 import CloudFunctionV2
 from goblet.backends.cloudrun import CloudRun
-from goblet.client import VersionedClients
-from goblet_gcp_client.client import get_default_location, get_default_project
-from goblet.infrastructures.cloudtask import CloudTaskQueue
-from goblet.resources.bq_remote_function import BigQueryRemoteFunction
-from goblet.resources.eventarc import EventArc
-from goblet.resources.pubsub import PubSub
-from goblet.resources.routes import Routes
-from goblet.resources.scheduler import Scheduler
-from goblet.resources.cloudtasktarget import CloudTaskTarget
-from goblet.resources.storage import Storage
-from goblet.resources.http import HTTP
-from goblet.resources.jobs import Jobs
+
+from goblet.handlers.bq_remote_function import BigQueryRemoteFunction
+from goblet.handlers.eventarc import EventArc
+from goblet.handlers.pubsub import PubSub
+from goblet.handlers.routes import Routes
+from goblet.handlers.scheduler import Scheduler
+from goblet.handlers.cloudtasktarget import CloudTaskTarget
+from goblet.handlers.storage import Storage
+from goblet.handlers.http import HTTP
+from goblet.handlers.jobs import Jobs
 
 from goblet.infrastructures.redis import Redis
 from goblet.infrastructures.vpcconnector import VPCConnector
 from goblet.infrastructures.alerts import Alerts
 from goblet.infrastructures.apigateway import ApiGateway
+from goblet.infrastructures.cloudtask import CloudTaskQueue
 
 log = logging.getLogger(__name__)
 log.setLevel(logging.INFO)
diff --git a/goblet/resources/__init__.py b/goblet/handlers/__init__.py
similarity index 100%
rename from goblet/resources/__init__.py
rename to goblet/handlers/__init__.py
diff --git a/goblet/resources/bq_remote_function.py b/goblet/handlers/bq_remote_function.py
similarity index 99%
rename from goblet/resources/bq_remote_function.py
rename to goblet/handlers/bq_remote_function.py
index 8a176864..2b763c10 100644
--- a/goblet/resources/bq_remote_function.py
+++ b/goblet/handlers/bq_remote_function.py
@@ -4,7 +4,7 @@
 
 from googleapiclient.errors import HttpError
 
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 from goblet_gcp_client.client import get_default_project
 
 
diff --git a/goblet/resources/cloudtasktarget.py b/goblet/handlers/cloudtasktarget.py
similarity index 96%
rename from goblet/resources/cloudtasktarget.py
rename to goblet/handlers/cloudtasktarget.py
index 7d9dffbb..c6897090 100644
--- a/goblet/resources/cloudtasktarget.py
+++ b/goblet/handlers/cloudtasktarget.py
@@ -1,4 +1,4 @@
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 
 import logging
 
diff --git a/goblet/resources/eventarc.py b/goblet/handlers/eventarc.py
similarity index 99%
rename from goblet/resources/eventarc.py
rename to goblet/handlers/eventarc.py
index 8db113f5..535b072b 100644
--- a/goblet/resources/eventarc.py
+++ b/goblet/handlers/eventarc.py
@@ -6,7 +6,7 @@
 from goblet.response import Response
 import logging
 
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 from goblet_gcp_client.client import get_default_project, get_default_location
 
 log = logging.getLogger("goblet.deployer")
diff --git a/goblet/resources/handler.py b/goblet/handlers/handler.py
similarity index 100%
rename from goblet/resources/handler.py
rename to goblet/handlers/handler.py
diff --git a/goblet/resources/http.py b/goblet/handlers/http.py
similarity index 96%
rename from goblet/resources/http.py
rename to goblet/handlers/http.py
index 30271e61..be407318 100644
--- a/goblet/resources/http.py
+++ b/goblet/handlers/http.py
@@ -1,4 +1,4 @@
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 
 
 class HTTP(Handler):
diff --git a/goblet/resources/jobs.py b/goblet/handlers/jobs.py
similarity index 99%
rename from goblet/resources/jobs.py
rename to goblet/handlers/jobs.py
index 2a7989c0..47b456bc 100644
--- a/goblet/resources/jobs.py
+++ b/goblet/handlers/jobs.py
@@ -1,6 +1,6 @@
 import logging
 
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 from goblet.common_cloud_actions import getCloudbuildArtifact
 from goblet.config import GConfig
 
diff --git a/goblet/resources/plugins/__init__.py b/goblet/handlers/plugins/__init__.py
similarity index 100%
rename from goblet/resources/plugins/__init__.py
rename to goblet/handlers/plugins/__init__.py
diff --git a/goblet/resources/plugins/pydantic.py b/goblet/handlers/plugins/pydantic.py
similarity index 100%
rename from goblet/resources/plugins/pydantic.py
rename to goblet/handlers/plugins/pydantic.py
diff --git a/goblet/resources/pubsub.py b/goblet/handlers/pubsub.py
similarity index 99%
rename from goblet/resources/pubsub.py
rename to goblet/handlers/pubsub.py
index a12e29c3..a82dd331 100644
--- a/goblet/resources/pubsub.py
+++ b/goblet/handlers/pubsub.py
@@ -11,7 +11,7 @@
 from goblet.config import GConfig
 import logging
 
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 from goblet_gcp_client.client import get_default_project
 from goblet.utils import attributes_to_filter
 
diff --git a/goblet/resources/routes.py b/goblet/handlers/routes.py
similarity index 99%
rename from goblet/resources/routes.py
rename to goblet/handlers/routes.py
index aff5988e..0c214b4f 100644
--- a/goblet/resources/routes.py
+++ b/goblet/handlers/routes.py
@@ -9,8 +9,8 @@
 
 import goblet
 
-from goblet.resources.handler import Handler
-from goblet.resources.plugins.pydantic import PydanticPlugin
+from goblet.handlers.handler import Handler
+from goblet.handlers.plugins.pydantic import PydanticPlugin
 from goblet.utils import get_g_dir
 from goblet.config import GConfig
 from goblet.common_cloud_actions import deploy_apigateway, destroy_apigateway
diff --git a/goblet/resources/scheduler.py b/goblet/handlers/scheduler.py
similarity index 99%
rename from goblet/resources/scheduler.py
rename to goblet/handlers/scheduler.py
index 71cccb40..a217c5ff 100644
--- a/goblet/resources/scheduler.py
+++ b/goblet/handlers/scheduler.py
@@ -1,6 +1,6 @@
 import logging
 
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 from goblet_gcp_client.client import get_default_project, get_default_location
 
 from goblet.common_cloud_actions import get_cloudrun_url
diff --git a/goblet/resources/storage.py b/goblet/handlers/storage.py
similarity index 99%
rename from goblet/resources/storage.py
rename to goblet/handlers/storage.py
index ab829f42..fb17bc00 100644
--- a/goblet/resources/storage.py
+++ b/goblet/handlers/storage.py
@@ -1,7 +1,7 @@
 from goblet.config import GConfig
 import logging
 
-from goblet.resources.handler import Handler
+from goblet.handlers.handler import Handler
 from goblet_gcp_client.client import get_default_project, get_default_location
 from goblet.common_cloud_actions import (
     get_function_runtime,
diff --git a/goblet/infrastructures/apigateway.py b/goblet/infrastructures/apigateway.py
index ead825c7..80a20fb5 100644
--- a/goblet/infrastructures/apigateway.py
+++ b/goblet/infrastructures/apigateway.py
@@ -3,7 +3,7 @@
 
 from goblet.common_cloud_actions import deploy_apigateway, destroy_apigateway
 from goblet.infrastructures.infrastructure import Infrastructure
-from goblet.resources.routes import OpenApiSpec
+from goblet.handlers.routes import OpenApiSpec
 from goblet.utils import get_g_dir, get_dir
 
 log = logging.getLogger("goblet.deployer")


Test patch:
diff --git a/goblet/tests/test_apigateway.py b/goblet/tests/test_apigateway.py
index 8d1b8b26..201f9a64 100644
--- a/goblet/tests/test_apigateway.py
+++ b/goblet/tests/test_apigateway.py
@@ -1,7 +1,7 @@
 import pytest
 from goblet import Goblet
 from goblet.config import GConfig
-from goblet.resources.routes import Routes
+from goblet.handlers.routes import Routes
 
 from goblet.backends import CloudFunctionV1, CloudFunctionV2, CloudRun
 from goblet_gcp_client import get_replay_count
diff --git a/goblet/tests/test_bqremotefunction.py b/goblet/tests/test_bqremotefunction.py
index 0d5c0675..9cc8cb41 100644
--- a/goblet/tests/test_bqremotefunction.py
+++ b/goblet/tests/test_bqremotefunction.py
@@ -2,7 +2,7 @@
 from unittest.mock import Mock
 from goblet import Goblet
 from goblet_gcp_client import get_responses
-from goblet.resources.bq_remote_function import BigQueryRemoteFunction
+from goblet.handlers.bq_remote_function import BigQueryRemoteFunction
 
 
 class TestBqRemoteFunction:
diff --git a/goblet/tests/test_deployer.py b/goblet/tests/test_deployer.py
index 3b146c69..085d2a0f 100644
--- a/goblet/tests/test_deployer.py
+++ b/goblet/tests/test_deployer.py
@@ -1,5 +1,5 @@
 from goblet import Goblet
-from goblet.resources.http import HTTP
+from goblet.handlers.http import HTTP
 from goblet_gcp_client import get_responses, get_response
 from goblet.test_utils import dummy_function, DATA_DIR_MAIN
 from goblet.errors import GobletError
diff --git a/goblet/tests/test_eventarc.py b/goblet/tests/test_eventarc.py
index 7880904d..076a84a5 100644
--- a/goblet/tests/test_eventarc.py
+++ b/goblet/tests/test_eventarc.py
@@ -1,5 +1,5 @@
 from goblet import Goblet
-from goblet.resources.eventarc import EventArc
+from goblet.handlers.eventarc import EventArc
 from goblet.test_utils import (
     dummy_function,
     mock_dummy_function,
diff --git a/goblet/tests/test_jobs.py b/goblet/tests/test_jobs.py
index 93b41409..fda8df5a 100644
--- a/goblet/tests/test_jobs.py
+++ b/goblet/tests/test_jobs.py
@@ -1,6 +1,6 @@
 from unittest.mock import Mock
 from goblet import Goblet
-from goblet.resources.jobs import Jobs
+from goblet.handlers.jobs import Jobs
 import pytest
 
 from goblet.test_utils import (
diff --git a/goblet/tests/test_openapispec.py b/goblet/tests/test_openapispec.py
index e3f05f8b..aeb81bc1 100644
--- a/goblet/tests/test_openapispec.py
+++ b/goblet/tests/test_openapispec.py
@@ -1,6 +1,6 @@
 from typing import List, Optional
 from marshmallow import Schema, fields
-from goblet.resources.routes import OpenApiSpec, RouteEntry
+from goblet.handlers.routes import OpenApiSpec, RouteEntry
 from pydantic import BaseModel
 
 
diff --git a/goblet/tests/test_pubsub.py b/goblet/tests/test_pubsub.py
index 38365c57..d7ac7b1a 100644
--- a/goblet/tests/test_pubsub.py
+++ b/goblet/tests/test_pubsub.py
@@ -4,7 +4,7 @@
 import pytest
 
 from goblet import Goblet, Response
-from goblet.resources.pubsub import PubSub
+from goblet.handlers.pubsub import PubSub
 from goblet.test_utils import (
     dummy_function,
     mock_dummy_function,
diff --git a/goblet/tests/test_routes.py b/goblet/tests/test_routes.py
index ee674fd2..22e4d177 100644
--- a/goblet/tests/test_routes.py
+++ b/goblet/tests/test_routes.py
@@ -1,7 +1,7 @@
 from unittest.mock import Mock
 import pytest
 from goblet import Goblet, Response, jsonify
-from goblet.resources.routes import Routes, CORSConfig
+from goblet.handlers.routes import Routes, CORSConfig
 from goblet.test_utils import (
     dummy_function,
     mock_dummy_function,
diff --git a/goblet/tests/test_scheduler.py b/goblet/tests/test_scheduler.py
index 2792d4a4..44fffd23 100644
--- a/goblet/tests/test_scheduler.py
+++ b/goblet/tests/test_scheduler.py
@@ -1,6 +1,6 @@
 from unittest.mock import Mock
 from goblet import Goblet
-from goblet.resources.scheduler import Scheduler
+from goblet.handlers.scheduler import Scheduler
 from goblet.test_utils import (
     mock_dummy_function,
     dummy_function,
diff --git a/goblet/tests/test_storage.py b/goblet/tests/test_storage.py
index b4962fc8..e338ef51 100644
--- a/goblet/tests/test_storage.py
+++ b/goblet/tests/test_storage.py
@@ -1,5 +1,5 @@
 from goblet import Goblet
-from goblet.resources.storage import Storage
+from goblet.handlers.storage import Storage
 from goblet_gcp_client import get_responses
 from goblet.test_utils import dummy_function, mock_dummy_function
 from goblet.backends import CloudFunctionV1