Skip to content

Commit 5137511

Browse files
jmchiltonclaude
andcommitted
Fix lint, add ruff exclusions, enhance-docs in build pipeline
- Fix import ordering and remove unused imports in test_pydantic_schema - Add ruff exclude for generated schema files - Add pydantic to test deps, IWC Format2 conversion tests - Use enhance-docs for HTML post-processing (aliases, class rows, types) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f8a2359 commit 5137511

File tree

4 files changed

+196
-23
lines changed

4 files changed

+196
-23
lines changed

build_schema.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,23 @@ schema-salad-doc \
7070
--only "https://galaxyproject.org/gxformat2/native_v0_1#NativeGalaxyWorkflow" \
7171
workflow.yml > "$out"
7272

73-
# Post-process: fix format_version -> format-version and remove artificial class row
74-
sed -i.bak 's/format_version/format-version/g' "$out"
75-
python3 -c "
76-
import re, sys
77-
html = open('$out').read()
78-
html = re.sub(r'<div class=\"row responsive-table-row\">\s*\n<div[^>]*><code>class</code></div>\n.*?</div>\n</div>\n', '', html, flags=re.DOTALL)
79-
open('$out', 'w').write(html)
80-
"
81-
rm -f "$out.bak"
82-
83-
# Pydantic models (requires schema-salad-plus-pydantic)
73+
# Pydantic models and enhanced docs (requires schema-salad-plus-pydantic)
74+
# enhance-docs handles: pydantic:type overrides, pydantic:alias renames,
75+
# and removing artificial class rows from documentRoot records.
8476
SKIP_PYDANTIC=${SKIP_PYDANTIC:-0}
8577
if [ $SKIP_PYDANTIC -eq 0 ]; then
8678
cd "${PROJECT_DIRECTORY}"
8779
schema-salad-plus-pydantic generate schema/v19_09/workflow.yml -o gxformat2/schema/gxformat2.py
8880
schema-salad-plus-pydantic generate schema/native_v0_1/workflow.yml -o gxformat2/schema/native.py
81+
schema-salad-plus-pydantic enhance-docs schema/native_v0_1/workflow.yml "${DIST_DIRECTORY}/native_v0_1.html"
82+
else
83+
# Fallback post-processing without schema-salad-plus-pydantic
84+
sed -i.bak 's/format_version/format-version/g' "$out"
85+
python3 -c "
86+
import re
87+
html = open('$out').read()
88+
html = re.sub(r'<div class=\"row responsive-table-row\">\s*\n<div[^>]*><code>class</code></div>\n.*?</div>\n</div>\n', '', html, flags=re.DOTALL)
89+
open('$out', 'w').write(html)
90+
"
91+
rm -f "$out.bak"
8992
fi

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ dev = [
6767
"cwltool>=3.0.20200807132242",
6868
]
6969

70+
[tool.ruff]
71+
exclude = [
72+
"gxformat2/schema/v19_09.py",
73+
"gxformat2/schema/native_v0_1.py",
74+
"gxformat2/schema/gxformat2.py",
75+
"gxformat2/schema/native.py",
76+
]
77+
7078
[tool.black]
7179
line-length = 120
7280
extend-exclude = '''

tests/test_pydantic_schema.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,16 @@
1111
import pytest
1212

1313
from gxformat2.export import from_galaxy_native
14+
from gxformat2.schema.gxformat2 import (
15+
GalaxyWorkflow,
16+
WorkflowStep,
17+
)
1418
from gxformat2.schema.native import (
15-
NativeCreatorOrganization,
16-
NativeCreatorPerson,
17-
NativeFrameComment,
1819
NativeGalaxyWorkflow,
1920
NativeInputConnection,
20-
NativeMarkdownComment,
2121
NativePostJobAction,
2222
NativeStep,
2323
NativeStepType,
24-
NativeTextComment,
25-
)
26-
from gxformat2.schema.gxformat2 import (
27-
GalaxyWorkflow,
28-
WorkflowComment,
29-
WorkflowStep,
30-
WorkflowStepType,
3124
)
3225
from gxformat2.yaml import ordered_load
3326

0 commit comments

Comments
 (0)