Skip to content

Commit

Permalink
pyflakes: fix issues and setup automation
Browse files Browse the repository at this point in the history
Fixed issues reported by pyflakes and added automation for running
pyflakes.

Fixes #64

Signed-off-by: Sandro Bonazzola <[email protected]>
  • Loading branch information
sandrobonazzola committed Sep 9, 2022
1 parent f960763 commit 42a3158
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
run: |
pip install sphinx
pip install sphinx-rtd-theme
- name: Check with pyflakes
run: |
pip install pyflakes
pyflakes `find . -name "*.py"`
- name: Test
run: cd src && python3 -m unittest discover -v
- name: Document
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

# -- Path setup --------------------------------------------------------------

import os
import sys
sys.path.insert(0, '/home/sbonazzo/NotBackedUp/upstream/arcaflow-plugin-sdk-python/src')

Expand Down
1 change: 0 additions & 1 deletion src/arcaflow_plugin_sdk/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import dataclasses
import inspect
import io
import json
Expand Down
2 changes: 1 addition & 1 deletion src/arcaflow_plugin_sdk/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -5966,7 +5966,7 @@ def test_object_serialization(
"2. Your sample data is invalid according to your own rules\n" \
"3. There is a bug in the SDK (please report it)\n\n" \
"Check the error message below for details.\n\n" \
"---\n\n".format(type(dc).__name__, traceback.extract_stack())
"---\n\n{}".format(type(dc).__name__, traceback.extract_stack())
result += "Error message:\n" + e.__str__() + "\n\n"
# noinspection PyDataclass
result += "Input:\n" + pprint.pformat(dataclasses.asdict(dc)) + "\n\n"
Expand Down
5 changes: 2 additions & 3 deletions src/arcaflow_plugin_sdk/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import enum
import unittest

from arcaflow_plugin_sdk.schema import PropertyType, ConstraintException, BadArgumentException, SchemaBuildException, \
IntType
from arcaflow_plugin_sdk.schema import PropertyType, ConstraintException, BadArgumentException, SchemaBuildException


class Color(enum.Enum):
Expand Down Expand Up @@ -422,7 +421,7 @@ class TestSubclass(TestParent):
pass

# If a is missing from 'TestSubclass', it will fail.
s = schema.ObjectType(
schema.ObjectType(
TestSubclass,
{
"a": schema.PropertyType(
Expand Down
1 change: 0 additions & 1 deletion test_example_plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
import re
import unittest
import example_plugin
from arcaflow_plugin_sdk import plugin
Expand Down

0 comments on commit 42a3158

Please sign in to comment.