Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ jobs:
- name: Check import order (isort)
run: isort --check --profile black --line-length 79 .
- name: Check docstring formatting
run: docformatter --check --recursive --black --wrap-descriptions 79 --wrap-summaries 79 .
# schema.py excluded: docformatter 1.7.8 crashes on it
Comment thread
jaredoconnell marked this conversation as resolved.
# Upstream: https://github.com/PyCQA/docformatter/issues/355
# Tracking: https://github.com/arcalot/arcaflow-plugin-sdk-python/issues/147
run: >-
docformatter --check --black
--wrap-descriptions 79 --wrap-summaries 79
$(find . -name '*.py' -not -path './.venv/*'
-not -path './docs/*' -not -name 'schema.py')
- name: Error and style linting
id: flake8
run: flake8 --max-line-length 79 --ignore E203,W503 .
Expand All @@ -42,7 +49,7 @@ jobs:
run: exit 1
- name: Install poetry
run: |
python -m pip install poetry==1.4
python -m pip install poetry==${{ vars.ARCALOT_POETRY_VERSION }}
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
Expand Down
7 changes: 4 additions & 3 deletions example_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,16 @@ class ErrorOutput:
def hello_world(
params: InputParams,
) -> typing.Tuple[str, typing.Union[SuccessOutput, ErrorOutput]]:
"""The function is the implementation for the step. It needs the decorator
above to make it into a step. The type hints for the params are required.
"""The function is the implementation for the step.

It needs the decorator above to make it into a step. The type hints for
the params are required.

:param params:

:return: the string identifying which output it is, as well the output
structure
"""

return "success", SuccessOutput("Hello, {}!".format(params.name))


Expand Down
1,274 changes: 676 additions & 598 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.12"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
Expand Down
1 change: 1 addition & 0 deletions src/arcaflow_plugin_sdk/atp.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| E ->> P: Start step
| P ->> E: Execution results
"""

import dataclasses
import io
import os
Expand Down
7 changes: 4 additions & 3 deletions src/arcaflow_plugin_sdk/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ def run(
stdout: io.TextIOWrapper = stdout,
stderr: io.TextIOWrapper = stderr,
) -> int:
"""Run takes a schema and runs it as a command line utility. It returns the
exit code of the program. It is intended to be used as an entry point for
your plugin.
"""Run takes a schema and runs it as a command line utility.

It returns the exit code of the program. It is intended to be used as an
entry point for your plugin.

:param s: the schema to run
:param argv: command line arguments
Expand Down
23 changes: 17 additions & 6 deletions src/arcaflow_plugin_sdk/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6825,12 +6825,23 @@ def _resolve_forward(
scope: ScopeType,
) -> AbstractType:
t: typing.ForwardRef
# TODO is there a better way to directly evaluate a forward ref?
# Note: This is an unstable API.
# noinspection PyProtectedMember
resolved = t._evaluate(
globalns=None, localns=None, recursive_guard=frozenset()
)
# Resolve ForwardRef to its actual type. We must pass
# this module's globals so the ref can find schema
# classes defined here (e.g. StringEnumSchema).
# Python 3.14+ (PEP 649) provides a stable public API;
# older versions require the internal _evaluate method.
if sys.version_info >= (3, 14):
resolved = typing.evaluate_forward_ref(
t, globals=globals()
)
else:
# noinspection PyProtectedMember
resolved = t._evaluate(
globalns=globals(),
localns=None,
type_params=(),
recursive_guard=frozenset(),
)
Comment thread
jaredoconnell marked this conversation as resolved.
return cls._resolve(resolved, resolved, path, scope)

@classmethod
Expand Down
Loading