Skip to content

Commit

Permalink
change entrypoint for python module
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleader committed Dec 18, 2023
1 parent 635417b commit 4dd96ee
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
contents: write
pull-requests: write
with:
plugin_path: "arcaflow_plugin_template_python/template_python_plugin.py"
plugin_path: "arcaflow_plugin_template_python/arcaflow_template_python_plugin.py"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN python -m pip install -r requirements.txt

WORKDIR /app/${package}

ENTRYPOINT ["python", "template_python_plugin.py"]
ENTRYPOINT ["python", "arcaflow_template_python_plugin.py"]
CMD []

LABEL org.opencontainers.image.source="https://github.com/arcalot/arcaflow-plugin-template-python"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import typing
from arcaflow_plugin_sdk import plugin
from template_python_schema import (
from arcaflow_template_python_schema import (
InputParams,
SuccessOutput,
ErrorOutput,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Arcalot"]
license = "Apache-2.0+GPL-2.0-only"

packages = [
{ include="template_python_plugin.py", from="./arcaflow_plugin_template_python" },
{ include="arcaflow_template_python_plugin.py", from="./arcaflow_plugin_template_python" },
]

[tool.poetry.dependencies]
Expand Down
20 changes: 10 additions & 10 deletions tests/test_arcaflow_plugin_template_python.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#!/usr/bin/env python3
import unittest
import template_python_plugin
from arcaflow_plugin_sdk import plugin
import arcaflow_template_python_plugin as plugin
from arcaflow_plugin_sdk import plugin as plugin_sdk


class HelloWorldTest(unittest.TestCase):
@staticmethod
def test_serialization():
plugin.test_object_serialization(template_python_plugin.InputParams("John Doe"))
plugin_sdk.test_object_serialization(plugin.InputParams("John Doe"))

plugin.test_object_serialization(
template_python_plugin.SuccessOutput("Hello, world!")
plugin_sdk.test_object_serialization(
plugin.SuccessOutput("Hello, world!")
)

plugin.test_object_serialization(
template_python_plugin.ErrorOutput(error="This is an error")
plugin_sdk.test_object_serialization(
plugin.ErrorOutput(error="This is an error")
)

def test_functional(self):
input = template_python_plugin.InputParams(name="Example Joe")
input = plugin.InputParams(name="Example Joe")

output_id, output_data = template_python_plugin.hello_world(
output_id, output_data = plugin.hello_world(
params=input, run_id="plugin_ci"
)

# The example plugin always returns an error:
self.assertEqual("success", output_id)
self.assertEqual(
output_data,
template_python_plugin.SuccessOutput("Hello, Example Joe!"),
plugin.SuccessOutput("Hello, Example Joe!"),
)


Expand Down

0 comments on commit 4dd96ee

Please sign in to comment.