Skip to content

Commit 5f5696d

Browse files
committed
lint
1 parent bc60b84 commit 5f5696d

File tree

6 files changed

+15
-25
lines changed

6 files changed

+15
-25
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ per-file-ignores =
1010
./tests/cloudevent_receiver_server.py: E501
1111
# remove when implemented:
1212
./src/actinia_cloudevent_plugin/api/cloudevent.py: E501
13-
./src/actinia_cloudevent_plugin/api/hook.py: F841
13+
./src/actinia_cloudevent_plugin/api/hooks.py: F841
1414
./src/actinia_cloudevent_plugin/core/cloudevents.py: F841, E501

.vscode/tasks.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,19 @@
99
"tag": "actinia-cloudevent-plugin:latest",
1010
"dockerfile": "${workspaceFolder}/docker/Dockerfile",
1111
"context": "${workspaceFolder}"
12-
// "pull": true // use this when an newer image is available
1312
}
1413
},
1514
{
1615
"type": "docker-run",
1716
"label": "docker-run: debug",
1817
"dependsOn": [
19-
"docker-build",
18+
"docker-build"
2019
],
2120
"python": {
2221
"module": "flask",
2322
"args": [
2423
"run",
2524
"--no-debugger",
26-
// "--no-reload",
2725
"--host",
2826
"0.0.0.0",
2927
"--port",
@@ -32,8 +30,6 @@
3230
},
3331
"dockerRun": {
3432
"remove": true,
35-
// network is needed when connecting to valkey
36-
// while not using docker-compose for startup
3733
"network": "actinia-docker_actinia-dev",
3834
"ports": [
3935
{
@@ -46,12 +42,10 @@
4642
"PYTHONDONWRITEBYTECODE": "1",
4743
"FLASK_APP": "actinia_cloudevent_plugin.main",
4844
"FLASK_DEBUG": "1",
49-
"FLASK_ENV": "development",
45+
"FLASK_ENV": "development"
5046
},
5147
"customOptions": "--ip 172.18.0.12",
5248
"volumes": [
53-
// mount local source code for instant reload
54-
// on changes
5549
{
5650
"localPath": "${workspaceFolder}",
5751
"containerPath": "/src/actinia-cloudevent-plugin",

docker/Dockerfile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@ RUN /usr/bin/python -m venv --system-site-packages --without-pip /opt/venv
99
# hadolint ignore=DL3013
1010
RUN python -m ensurepip && pip3 install --no-cache-dir --upgrade pip pep517 wheel
1111

12-
# gunicorn
1312
# hadolint ignore=DL3013
14-
RUN pip3 install --no-cache-dir gunicorn
15-
16-
# needed for tests
17-
# hadolint ignore=DL3013
18-
RUN pip3 install --no-cache-dir setuptools pwgen==0.8.2.post0 pytest==8.3.5 pytest-cov==6.0.0
13+
RUN pip3 install --no-cache-dir gunicorn && \
14+
# needed for tests
15+
pip3 install --no-cache-dir setuptools pwgen==0.8.2.post0 pytest==8.3.5 pytest-cov==6.0.0
1916

2017
COPY . /src/actinia-cloudevent-plugin/
21-
RUN pip3 install --no-cache-dir -e /src/actinia-cloudevent-plugin/
22-
23-
# For tests:
24-
RUN chmod a+x /src/actinia-cloudevent-plugin/tests_with_cloudevent_receiver.sh
18+
RUN pip3 install --no-cache-dir -e /src/actinia-cloudevent-plugin/ && \
19+
# For tests:
20+
chmod a+x /src/actinia-cloudevent-plugin/tests_with_cloudevent_receiver.sh
2521
# RUN make test
2622

27-
CMD gunicorn -b 0.0.0.0:8088 -w 8 --access-logfile=- -k gthread actinia_cloudevent_plugin.main:flask_app
23+
CMD ["gunicorn", "-b", "0.0.0.0:8088", "-w", "8", "--access-logfile=-", "-k", "gthread", "actinia_cloudevent_plugin.main:flask_app"]

src/actinia_cloudevent_plugin/api/hook.py renamed to src/actinia_cloudevent_plugin/api/hooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
from flask import jsonify, make_response, request
3131
from flask_restful_swagger_2 import Resource, swagger
3232

33-
from actinia_cloudevent_plugin.apidocs import hook
33+
from actinia_cloudevent_plugin.apidocs import hooks
3434
from actinia_cloudevent_plugin.model.response_models import (
3535
SimpleStatusCodeResponseModel,
3636
)
3737
from actinia_cloudevent_plugin.resources.config import EVENTRECEIVER
3838

3939

40-
class Hook(Resource):
40+
class Hooks(Resource):
4141
"""Webhook handling."""
4242

4343
def get(self, source_name):
@@ -56,7 +56,7 @@ def head(self, source_name):
5656
_source_name = source_name
5757
return make_response("", 200)
5858

59-
@swagger.doc(hook.describe_hook_post_docs)
59+
@swagger.doc(hooks.describe_hooks_post_docs)
6060
def post(self, source_name) -> SimpleStatusCodeResponseModel:
6161
"""Translate actinia webhook call to cloudevent.
6262
File renamed without changes.

src/actinia_cloudevent_plugin/endpoints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
from flask_restful_swagger_2 import Api
2727

2828
from actinia_cloudevent_plugin.api.cloudevent import Cloudevent
29-
from actinia_cloudevent_plugin.api.hook import Hook
29+
from actinia_cloudevent_plugin.api.hooks import Hooks
3030

3131

3232
# endpoints loaded if run as actinia-core plugin as well as standalone app
3333
def create_endpoints(flask_api: Api) -> None:
3434
"""Create plugin endpoints."""
3535
apidoc = flask_api
3636
apidoc.add_resource(Cloudevent, "/")
37-
apidoc.add_resource(Hook, "/hooks/<string:source_name>")
37+
apidoc.add_resource(Hooks, "/hooks/<string:source_name>")

0 commit comments

Comments
 (0)