Skip to content

Commit 28a2932

Browse files
authored
chore: update model doc generation to remove unnecessary headlines. (#53)
* chore: update model doc generation to remove unnecessary headlines. Signed-off-by: Jeff Napper <[email protected]> * fix: remove submodule checkout that is not needed. Signed-off-by: Jeff Napper <[email protected]> * chore: label tests for acp-spec and create GHA-specific test target without the spec. Signed-off-by: Jeff Napper <[email protected]> --------- Signed-off-by: Jeff Napper <[email protected]>
1 parent a75cea8 commit 28a2932

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

.github/workflows/run_check.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ jobs:
2929
steps:
3030
- name: Checkout
3131
uses: actions/checkout@v4
32-
with:
33-
submodules: true
34-
token: ${{ secrets.GH_PAT_REPO_ACCESS }}
3532

3633
- name: Set up python ${{ env.PYTHON_VERSION }}
3734
id: setup-python
@@ -48,7 +45,7 @@ jobs:
4845
run: poetry check
4946

5047
- name: Check code
51-
run: make check
48+
run: make test_gha
5249
shell: bash
5350

5451
- name: Print summary

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,7 @@ test: setup_test
114114
check: test
115115
scripts/check-models.sh
116116

117+
test_gha: setup_test
118+
poetry run pytest --exitfirst -vv -m "not needs_acp_spec" tests/
119+
117120
all: install generate test

scripts/generate_model_autodoc.sh

+2-10
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,18 @@
55
# Note: This script generates the sphinx rst docs for the
66
# package models.
77

8-
echo "API Models
9-
===============
10-
"
11-
128
for model in agntcy_acp/acp_v0/models/[a-z]*.py ; do
139
awk -f - "${model}" <<'EOF'
1410
/^class/ && /BaseModel/ {
1511
match($2, "[^(]+");
1612
MODEL = substr($2,RSTART,RLENGTH-RSTART+1);
17-
printf("\n\`\`%s\`\`\n", MODEL);
18-
print("***************************************");
19-
printf(".. autopydantic_model:: agntcy_acp.models.%s\n", MODEL);
13+
printf("\n.. autopydantic_model:: agntcy_acp.models.%s\n", MODEL);
2014
print(" :members:");
2115
}
2216
/^class/ && /Enum/ {
2317
match($2, "[^(]+");
2418
MODEL = substr($2,RSTART,RLENGTH-RSTART+1);
25-
printf("\n\`\`%s\`\`\n", MODEL);
26-
print("***************************************");
27-
printf(".. autoclass:: agntcy_acp.models.%s\n", MODEL);
19+
printf("\n.. autoclass:: agntcy_acp.models.%s\n", MODEL);
2820
print(" :members:");
2921
}
3022
EOF

tests/test_oas_generator.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from openapi_spec_validator.readers import read_from_filename
88
from deepdiff import diff
99

10+
@pytest.mark.needs_acp_spec
1011
@pytest.mark.parametrize(
1112
"test_filename, oas_ref_filename",
1213
[

0 commit comments

Comments
 (0)